gora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djkevi...@apache.org
Subject [28/32] gora git commit: Fix formatting issues and update java doc comments
Date Thu, 27 Jul 2017 18:45:54 GMT
Fix formatting issues and update java doc comments


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

Branch: refs/heads/master
Commit: 9c384099633c80249316af35922c99a70cbbc5be
Parents: c0aa76e
Author: nishadi <ndimeshi@gmail.com>
Authored: Thu Jul 27 06:22:58 2017 +0530
Committer: nishadi <ndimeshi@gmail.com>
Committed: Thu Jul 27 06:22:58 2017 +0530

----------------------------------------------------------------------
 .../gora/aerospike/query/AerospikeQuery.java    |  1 -
 .../aerospike/query/AerospikeResultRecord.java  |  3 +-
 .../gora/aerospike/store/AerospikeMapping.java  |  3 +
 .../store/AerospikeMappingBuilder.java          |  3 +
 .../aerospike/store/AerospikeParameters.java    |  3 +
 .../gora/aerospike/store/AerospikeStore.java    | 60 ++++++++++----------
 .../gora/aerospike/GoraAerospikeTestDriver.java | 15 +++--
 .../aerospike/store/TestAerospikeStore.java     |  1 -
 8 files changed, 50 insertions(+), 39 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/gora/blob/9c384099/gora-aerospike/src/main/java/org/apache/gora/aerospike/query/AerospikeQuery.java
----------------------------------------------------------------------
diff --git a/gora-aerospike/src/main/java/org/apache/gora/aerospike/query/AerospikeQuery.java
b/gora-aerospike/src/main/java/org/apache/gora/aerospike/query/AerospikeQuery.java
index d87fe6a..2f97f5f 100644
--- a/gora-aerospike/src/main/java/org/apache/gora/aerospike/query/AerospikeQuery.java
+++ b/gora-aerospike/src/main/java/org/apache/gora/aerospike/query/AerospikeQuery.java
@@ -29,5 +29,4 @@ public class AerospikeQuery<K, T extends PersistentBase> extends QueryBase<K,
T>
   public AerospikeQuery(DataStore<K, T> dataStore) {
     super(dataStore);
   }
-
 }

http://git-wip-us.apache.org/repos/asf/gora/blob/9c384099/gora-aerospike/src/main/java/org/apache/gora/aerospike/query/AerospikeResultRecord.java
----------------------------------------------------------------------
diff --git a/gora-aerospike/src/main/java/org/apache/gora/aerospike/query/AerospikeResultRecord.java
b/gora-aerospike/src/main/java/org/apache/gora/aerospike/query/AerospikeResultRecord.java
index 07d4309..069e568 100644
--- a/gora-aerospike/src/main/java/org/apache/gora/aerospike/query/AerospikeResultRecord.java
+++ b/gora-aerospike/src/main/java/org/apache/gora/aerospike/query/AerospikeResultRecord.java
@@ -21,11 +21,12 @@ import com.aerospike.client.Key;
 import com.aerospike.client.Record;
 
 /**
- * Class to hold Aerospike result records
+ * Class to represent Aerospike result records
  */
 public class AerospikeResultRecord {
 
   private Key key;
+
   private Record record;
 
   public AerospikeResultRecord(Key key, Record record) {

http://git-wip-us.apache.org/repos/asf/gora/blob/9c384099/gora-aerospike/src/main/java/org/apache/gora/aerospike/store/AerospikeMapping.java
----------------------------------------------------------------------
diff --git a/gora-aerospike/src/main/java/org/apache/gora/aerospike/store/AerospikeMapping.java
b/gora-aerospike/src/main/java/org/apache/gora/aerospike/store/AerospikeMapping.java
index cb000a0..7de7a2d 100644
--- a/gora-aerospike/src/main/java/org/apache/gora/aerospike/store/AerospikeMapping.java
+++ b/gora-aerospike/src/main/java/org/apache/gora/aerospike/store/AerospikeMapping.java
@@ -22,6 +22,9 @@ import com.aerospike.client.policy.WritePolicy;
 import java.util.HashMap;
 import java.util.Map;
 
+/**
+ * Class to represent the Aerospike Mapping
+ */
 public class AerospikeMapping {
   private String namespace;
 

http://git-wip-us.apache.org/repos/asf/gora/blob/9c384099/gora-aerospike/src/main/java/org/apache/gora/aerospike/store/AerospikeMappingBuilder.java
----------------------------------------------------------------------
diff --git a/gora-aerospike/src/main/java/org/apache/gora/aerospike/store/AerospikeMappingBuilder.java
b/gora-aerospike/src/main/java/org/apache/gora/aerospike/store/AerospikeMappingBuilder.java
index f24c08f..6d4f901 100644
--- a/gora-aerospike/src/main/java/org/apache/gora/aerospike/store/AerospikeMappingBuilder.java
+++ b/gora-aerospike/src/main/java/org/apache/gora/aerospike/store/AerospikeMappingBuilder.java
@@ -35,6 +35,9 @@ import java.util.Locale;
 import java.util.Map;
 import java.util.HashMap;
 
+/**
+ * Class to represent the Aerospike mapping builder
+ */
 public class AerospikeMappingBuilder {
 
   private static final Logger LOG = LoggerFactory.getLogger(AerospikeMappingBuilder.class);

http://git-wip-us.apache.org/repos/asf/gora/blob/9c384099/gora-aerospike/src/main/java/org/apache/gora/aerospike/store/AerospikeParameters.java
----------------------------------------------------------------------
diff --git a/gora-aerospike/src/main/java/org/apache/gora/aerospike/store/AerospikeParameters.java
b/gora-aerospike/src/main/java/org/apache/gora/aerospike/store/AerospikeParameters.java
index 61ea17a..4fe61cd 100644
--- a/gora-aerospike/src/main/java/org/apache/gora/aerospike/store/AerospikeParameters.java
+++ b/gora-aerospike/src/main/java/org/apache/gora/aerospike/store/AerospikeParameters.java
@@ -25,6 +25,9 @@ import org.slf4j.LoggerFactory;
 import java.lang.reflect.Field;
 import java.util.Properties;
 
+/**
+ * Class to represent the Aerospike specific parameters
+ */
 public class AerospikeParameters {
   private String host;
 

http://git-wip-us.apache.org/repos/asf/gora/blob/9c384099/gora-aerospike/src/main/java/org/apache/gora/aerospike/store/AerospikeStore.java
----------------------------------------------------------------------
diff --git a/gora-aerospike/src/main/java/org/apache/gora/aerospike/store/AerospikeStore.java
b/gora-aerospike/src/main/java/org/apache/gora/aerospike/store/AerospikeStore.java
index 5b3a1b9..8bd8d9f 100644
--- a/gora-aerospike/src/main/java/org/apache/gora/aerospike/store/AerospikeStore.java
+++ b/gora-aerospike/src/main/java/org/apache/gora/aerospike/store/AerospikeStore.java
@@ -229,8 +229,8 @@ public class AerospikeStore<K, T extends PersistentBase> extends
DataStoreBase<K
     Result<K, T> result = query.execute();
     int deleteCount = 0;
     try {
-      while(result.next()) {
-        if(aerospikeClient.delete(null,getAerospikeKey(result.getKey()))){
+      while (result.next()) {
+        if (aerospikeClient.delete(null, getAerospikeKey(result.getKey()))) {
           deleteCount++;
         }
       }
@@ -267,39 +267,39 @@ public class AerospikeStore<K, T extends PersistentBase> extends
DataStoreBase<K
     }
 
     // Query execution for single key
-    else if (query.getKey()!= null) {
+    else if (query.getKey() != null) {
       Key key = getAerospikeKey(query.getKey());
       Record record = aerospikeClient.get(null, key);
-      if(record != null){
+      if (record != null) {
         resultRecords.add(new AerospikeResultRecord(key, record));
       }
     }
 
     // Query execution for key ranges
     // ToDo: Implement Query execution for key ranges
-//    else if (query.getStartKey() != null && query.getEndKey() != null) {
-//
-//      // the key range filtering at the gora-module, which is not a better solution
-//      String lowerBound  = query.getStartKey().toString();
-//      String upperBound  = query.getEndKey().toString();
-//
-//      try (RecordSet recordSet = aerospikeClient.query(null, getStatement(namespace, set)))
{
-//        while (recordSet.next()) {
-//          Key key = recordSet.getKey();
-//          Record record = recordSet.getRecord();
-//
-//          String input = key.userKey.toString();
-//          boolean isSpecifiedRange =  input.compareToIgnoreCase(lowerBound) >= 0 &&
input
-//                  .compareToIgnoreCase(upperBound) <= 0;
-//
-//          if (isSpecifiedRange) {
-//            AerospikeResultRecord aerospikeRecord = new AerospikeResultRecord(key, record);
-//            resultRecords.add(aerospikeRecord);
-//          }
-//
-//        }
-//      }
-//    }
+    //    else if (query.getStartKey() != null && query.getEndKey() != null) {
+    //
+    //      // the key range filtering at the gora side, which is not a better solution
+    //      String lowerBound  = query.getStartKey().toString();
+    //      String upperBound  = query.getEndKey().toString();
+    //
+    //      try (RecordSet recordSet = aerospikeClient.query(null, getStatement(namespace,
set))) {
+    //        while (recordSet.next()) {
+    //          Key key = recordSet.getKey();
+    //          Record record = recordSet.getRecord();
+    //
+    //          String input = key.userKey.toString();
+    //          boolean isSpecifiedRange =  input.compareToIgnoreCase(lowerBound) >= 0
&& input
+    //                  .compareToIgnoreCase(upperBound) <= 0;
+    //
+    //          if (isSpecifiedRange) {
+    //            AerospikeResultRecord aerospikeRecord = new AerospikeResultRecord(key,
record);
+    //            resultRecords.add(aerospikeRecord);
+    //          }
+    //
+    //        }
+    //      }
+    //    }
     return new AerospikeQueryResult<>(this, query, resultRecords, getFieldsToQuery(null));
   }
 
@@ -326,13 +326,13 @@ public class AerospikeStore<K, T extends PersistentBase> extends
DataStoreBase<K
   }
 
   /**
-   * Method to create a statement
+   * Method to create a Aerospike specific statement
    *
    * @param namespace the namespace
    * @param set       the set
    * @return the statement
    */
-  private Statement getStatement(String namespace, String set){
+  private Statement getStatement(String namespace, String set) {
     Statement stmt = new Statement();
     stmt.setNamespace(namespace);
     stmt.setSetName(set);
@@ -354,7 +354,7 @@ public class AerospikeStore<K, T extends PersistentBase> extends
DataStoreBase<K
    * @param key persistent key
    * @return aerospike key for the record
    */
-  public Key getAerospikeKey(K key) {
+  private Key getAerospikeKey(K key) {
     Value keyValue;
     if (keyClass.getSimpleName().equalsIgnoreCase("string")) {
       keyValue = Value.get(key.toString());

http://git-wip-us.apache.org/repos/asf/gora/blob/9c384099/gora-aerospike/src/test/java/org/apache/gora/aerospike/GoraAerospikeTestDriver.java
----------------------------------------------------------------------
diff --git a/gora-aerospike/src/test/java/org/apache/gora/aerospike/GoraAerospikeTestDriver.java
b/gora-aerospike/src/test/java/org/apache/gora/aerospike/GoraAerospikeTestDriver.java
index 302f605..74b32b1 100644
--- a/gora-aerospike/src/test/java/org/apache/gora/aerospike/GoraAerospikeTestDriver.java
+++ b/gora-aerospike/src/test/java/org/apache/gora/aerospike/GoraAerospikeTestDriver.java
@@ -30,11 +30,13 @@ import java.util.Properties;
 
 /**
  * Helper class for third part tests using gora-aerospike backend.
+ *
  * @see GoraTestDriver
  */
 public class GoraAerospikeTestDriver extends GoraTestDriver {
 
   private final GenericContainer aerospikeContainer;
+
   private final Properties properties = DataStoreFactory.createProps();
 
   public GoraAerospikeTestDriver(GenericContainer aerospikeContainer) {
@@ -49,7 +51,8 @@ public class GoraAerospikeTestDriver extends GoraTestDriver {
     Thread.sleep(5000);
 
     properties.setProperty("gora.aerospikestore.server.ip", "localhost");
-    properties.setProperty("gora.aerospikestore.server.port", aerospikeContainer.getMappedPort(3000).toString());
+    properties.setProperty("gora.aerospikestore.server.port",
+            aerospikeContainer.getMappedPort(3000).toString());
   }
 
   @Override
@@ -59,18 +62,18 @@ public class GoraAerospikeTestDriver extends GoraTestDriver {
   /**
    * Instantiate a new {@link DataStore}. Uses 'null' schema.
    *
-   * @param keyClass The key class.
+   * @param keyClass        The key class.
    * @param persistentClass The value class.
    * @return A new store instance.
    * @throws GoraException If an error occur in creating the data store
    */
   @Override
-  public <K, T extends Persistent> DataStore<K, T> createDataStore(Class<K>
keyClass, Class<T> persistentClass)
-          throws GoraException {
+  public <K, T extends Persistent> DataStore<K, T> createDataStore(Class<K>
keyClass,
+          Class<T> persistentClass) throws GoraException {
 
     final DataStore<K, T> dataStore = DataStoreFactory
-            .createDataStore((Class<? extends DataStore<K, T>>) dataStoreClass,
keyClass, persistentClass, conf,
-                    properties);
+            .createDataStore((Class<? extends DataStore<K, T>>) dataStoreClass,
keyClass,
+                    persistentClass, conf, properties);
     dataStores.add(dataStore);
     log.info("Datastore for {} was added.", persistentClass);
     return dataStore;

http://git-wip-us.apache.org/repos/asf/gora/blob/9c384099/gora-aerospike/src/test/java/org/apache/gora/aerospike/store/TestAerospikeStore.java
----------------------------------------------------------------------
diff --git a/gora-aerospike/src/test/java/org/apache/gora/aerospike/store/TestAerospikeStore.java
b/gora-aerospike/src/test/java/org/apache/gora/aerospike/store/TestAerospikeStore.java
index 9e66327..11ed458 100644
--- a/gora-aerospike/src/test/java/org/apache/gora/aerospike/store/TestAerospikeStore.java
+++ b/gora-aerospike/src/test/java/org/apache/gora/aerospike/store/TestAerospikeStore.java
@@ -139,7 +139,6 @@ public class TestAerospikeStore extends DataStoreTestBase {
     webPageStore.flush();
     DataStoreTestUtil.assertEmptyResults(webPageStore.newQuery());
 
-
     //test 2 - delete all
     WebPageDataCreator.createWebPageData(webPageStore);
 


Mime
View raw message