gora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lewi...@apache.org
Subject [7/8] gora git commit: GORA-490 added package-info files and javadocs for gora-solr
Date Wed, 24 Aug 2016 22:51:50 GMT
GORA-490 added package-info files and javadocs for gora-solr


Project: http://git-wip-us.apache.org/repos/asf/gora/repo
Commit: http://git-wip-us.apache.org/repos/asf/gora/commit/259f1635
Tree: http://git-wip-us.apache.org/repos/asf/gora/tree/259f1635
Diff: http://git-wip-us.apache.org/repos/asf/gora/diff/259f1635

Branch: refs/heads/master
Commit: 259f16353623eb9138d0c60d55b7864a0a05dbdb
Parents: 75243c6
Author: cihad guzel <cguzelg@gmail.com>
Authored: Thu Aug 25 01:03:19 2016 +0300
Committer: cihad guzel <cguzelg@gmail.com>
Committed: Thu Aug 25 01:37:57 2016 +0300

----------------------------------------------------------------------
 .../org/apache/gora/solr/query/SolrQuery.java   | 22 ++++++++++++++++++--
 .../org/apache/gora/solr/query/SolrResult.java  | 18 ++++++++++++++++
 .../apache/gora/solr/query/package-info.java    | 21 +++++++++++++++++++
 .../org/apache/gora/solr/store/SolrMapping.java |  3 +++
 .../org/apache/gora/solr/store/SolrStore.java   | 15 +++++++++++++
 .../apache/gora/solr/store/package-info.java    | 20 ++++++++++++++++++
 .../java/org/apache/gora/solr/package-info.java | 21 +++++++++++++++++++
 7 files changed, 118 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/gora/blob/259f1635/gora-solr-5/src/main/java/org/apache/gora/solr/query/SolrQuery.java
----------------------------------------------------------------------
diff --git a/gora-solr-5/src/main/java/org/apache/gora/solr/query/SolrQuery.java b/gora-solr-5/src/main/java/org/apache/gora/solr/query/SolrQuery.java
index b19e384..425f5c4 100644
--- a/gora-solr-5/src/main/java/org/apache/gora/solr/query/SolrQuery.java
+++ b/gora-solr-5/src/main/java/org/apache/gora/solr/query/SolrQuery.java
@@ -18,24 +18,42 @@
 package org.apache.gora.solr.query;
 
 import org.apache.gora.persistency.impl.PersistentBase;
+import org.apache.gora.query.Query;
 import org.apache.gora.query.impl.QueryBase;
 import org.apache.gora.solr.store.SolrMapping;
 import org.apache.gora.solr.store.SolrStore;
 import org.apache.gora.store.DataStore;
 
+/**
+ * Solr specific implementation of the {@link Query} interface.
+ */
 public class SolrQuery<K, T extends PersistentBase> extends QueryBase<K, T> {
   SolrStore<K, T> store;
 
+  /**
+   * Constructor for the query
+   */
   public SolrQuery() {
     super(null);
     store = null;
   }
-  
+
+  /**
+   * Constructor for the query
+   *
+   * @param dataStore Data store used
+   *
+   */
   public SolrQuery(DataStore<K, T> dataStore) {
     super(dataStore);
     store = (SolrStore<K, T>)dataStore;
   }
-  
+
+  /**
+   * Create a solr query
+   *
+   * @return the solr query string
+   */
   public String toSolrQuery() {
     SolrMapping mapping = store.getMapping();
     String fld = mapping.getPrimaryKey();

http://git-wip-us.apache.org/repos/asf/gora/blob/259f1635/gora-solr-5/src/main/java/org/apache/gora/solr/query/SolrResult.java
----------------------------------------------------------------------
diff --git a/gora-solr-5/src/main/java/org/apache/gora/solr/query/SolrResult.java b/gora-solr-5/src/main/java/org/apache/gora/solr/query/SolrResult.java
index 7006e2d..d3ef88a 100644
--- a/gora-solr-5/src/main/java/org/apache/gora/solr/query/SolrResult.java
+++ b/gora-solr-5/src/main/java/org/apache/gora/solr/query/SolrResult.java
@@ -35,6 +35,10 @@ import org.apache.solr.common.SolrDocumentList;
 import org.apache.solr.common.params.CommonParams;
 import org.apache.solr.common.params.ModifiableSolrParams;
 
+/**
+ * SolrResult specific implementation of the {@link org.apache.gora.query.Result}
+ * interface.
+ */
 public class SolrResult<K, T extends PersistentBase> extends ResultBase<K, T>
{
 
   SolrDocumentList list = null;
@@ -42,6 +46,14 @@ public class SolrResult<K, T extends PersistentBase> extends ResultBase<K,
T> {
   String[] fields;
   int pos = 0;
 
+  /**
+   * Constructor for the result set
+   *
+   * @param dataStore Data store used
+   * @param query     Query used
+   * @param server    A client that talks directly to a Solr server
+   * @param resultsSize  The number of rows to be returned
+   */
   public SolrResult(DataStore<K, T> dataStore, Query<K, T> query,
       SolrClient server, int resultsSize) throws IOException {
     super(dataStore, query);
@@ -75,6 +87,9 @@ public class SolrResult<K, T extends PersistentBase> extends ResultBase<K,
T> {
     }
   }
 
+  /**
+   * Gets the next item
+   */
   @SuppressWarnings("unchecked")
   @Override
   protected boolean nextInner() throws IOException {
@@ -92,6 +107,9 @@ public class SolrResult<K, T extends PersistentBase> extends ResultBase<K,
T> {
     if (list != null) list.clear();
   }
 
+  /**
+   * Gets the items reading progress
+   */
   @Override
   public float getProgress() throws IOException {
     if (list != null && list.size() > 0) {

http://git-wip-us.apache.org/repos/asf/gora/blob/259f1635/gora-solr-5/src/main/java/org/apache/gora/solr/query/package-info.java
----------------------------------------------------------------------
diff --git a/gora-solr-5/src/main/java/org/apache/gora/solr/query/package-info.java b/gora-solr-5/src/main/java/org/apache/gora/solr/query/package-info.java
new file mode 100644
index 0000000..92f6bf5
--- /dev/null
+++ b/gora-solr-5/src/main/java/org/apache/gora/solr/query/package-info.java
@@ -0,0 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * This package contains all the Solr store query representation class as well as Result
set representing class
+ * when query is executed over the Solr dataStore.
+ */
+package org.apache.gora.solr.query;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/gora/blob/259f1635/gora-solr-5/src/main/java/org/apache/gora/solr/store/SolrMapping.java
----------------------------------------------------------------------
diff --git a/gora-solr-5/src/main/java/org/apache/gora/solr/store/SolrMapping.java b/gora-solr-5/src/main/java/org/apache/gora/solr/store/SolrMapping.java
index 424ae71..635b426 100644
--- a/gora-solr-5/src/main/java/org/apache/gora/solr/store/SolrMapping.java
+++ b/gora-solr-5/src/main/java/org/apache/gora/solr/store/SolrMapping.java
@@ -19,6 +19,9 @@ package org.apache.gora.solr.store;
 
 import java.util.HashMap;
 
+/**
+ * Mapping definitions for Solr.
+ */
 public class SolrMapping {
   HashMap<String,String> mapping;
   String coreName;

http://git-wip-us.apache.org/repos/asf/gora/blob/259f1635/gora-solr-5/src/main/java/org/apache/gora/solr/store/SolrStore.java
----------------------------------------------------------------------
diff --git a/gora-solr-5/src/main/java/org/apache/gora/solr/store/SolrStore.java b/gora-solr-5/src/main/java/org/apache/gora/solr/store/SolrStore.java
index 8c8d2f7..5d34cf0 100644
--- a/gora-solr-5/src/main/java/org/apache/gora/solr/store/SolrStore.java
+++ b/gora-solr-5/src/main/java/org/apache/gora/solr/store/SolrStore.java
@@ -65,6 +65,12 @@ import org.jdom.input.SAXBuilder;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+/**
+ * Implementation of a Solr data store to be used by gora.
+ *
+ * @param <K> class to be used for the key
+ * @param <T> class to be persisted within the store
+ */
 public class SolrStore<K, T extends PersistentBase> extends DataStoreBase<K, T>
{
 
   private static final Logger LOG = LoggerFactory.getLogger(SolrStore.class);
@@ -182,6 +188,15 @@ public class SolrStore<K, T extends PersistentBase> extends DataStoreBase<K,
T>
 
   public static final ConcurrentHashMap<Schema, SpecificDatumWriter<?>> writerMap
= new ConcurrentHashMap<>();
 
+  /**
+   * Initialize the data store by reading the credentials, setting the client's properties
up and
+   * reading the mapping file. Initialize is called when then the call to
+   * {@link org.apache.gora.store.DataStoreFactory#createDataStore} is made.
+   *
+   * @param keyClass
+   * @param persistentClass
+   * @param properties
+   */
   @Override
   public void initialize(Class<K> keyClass, Class<T> persistentClass,
       Properties properties) {

http://git-wip-us.apache.org/repos/asf/gora/blob/259f1635/gora-solr-5/src/main/java/org/apache/gora/solr/store/package-info.java
----------------------------------------------------------------------
diff --git a/gora-solr-5/src/main/java/org/apache/gora/solr/store/package-info.java b/gora-solr-5/src/main/java/org/apache/gora/solr/store/package-info.java
new file mode 100644
index 0000000..7ae4275
--- /dev/null
+++ b/gora-solr-5/src/main/java/org/apache/gora/solr/store/package-info.java
@@ -0,0 +1,20 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * This package contains all the Solr store related classes.
+ */
+package org.apache.gora.solr.store;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/gora/blob/259f1635/gora-solr-5/src/test/java/org/apache/gora/solr/package-info.java
----------------------------------------------------------------------
diff --git a/gora-solr-5/src/test/java/org/apache/gora/solr/package-info.java b/gora-solr-5/src/test/java/org/apache/gora/solr/package-info.java
new file mode 100644
index 0000000..1499ba1
--- /dev/null
+++ b/gora-solr-5/src/test/java/org/apache/gora/solr/package-info.java
@@ -0,0 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * Tests for <code>gora-solr</code> including
+ * the test driver for {@link org.apache.gora.solr.GoraSolrTestDriver}
+ */
+package org.apache.gora.solr;
\ No newline at end of file


Mime
View raw message