usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject [41/50] usergrid git commit: Add additional socket options to datastax driver configuration.
Date Mon, 22 Aug 2016 15:00:45 GMT
Add additional socket options to datastax driver configuration.


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

Branch: refs/heads/asf-site
Commit: cdab708732cc4a0c9effbe65e5609179f9a5b949
Parents: 320cf00
Author: Michael Russo <mrusso@apigee.com>
Authored: Thu Aug 18 22:50:54 2016 -0700
Committer: Michael Russo <mrusso@apigee.com>
Committed: Thu Aug 18 22:50:54 2016 -0700

----------------------------------------------------------------------
 .../core/datastax/impl/DataStaxClusterImpl.java       |  6 ++++++
 .../apache/usergrid/persistence/map/MapManager.java   |  2 +-
 .../usergrid/persistence/map/MapManagerTest.java      | 14 +++++++-------
 stack/corepersistence/pom.xml                         |  2 +-
 4 files changed, 15 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/cdab7087/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/datastax/impl/DataStaxClusterImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/datastax/impl/DataStaxClusterImpl.java
b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/datastax/impl/DataStaxClusterImpl.java
index 3146b65..93d3ea4 100644
--- a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/datastax/impl/DataStaxClusterImpl.java
+++ b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/datastax/impl/DataStaxClusterImpl.java
@@ -169,6 +169,11 @@ public class DataStaxClusterImpl implements DataStaxCluster {
             .setIdleTimeoutSeconds(cassandraFig.getTimeout() / 1000)
             .setPoolTimeoutMillis(cassandraFig.getPoolTimeout());
 
+        // purposely add a couple seconds to the driver's lower level socket timeouts vs.
cassandra timeouts
+        final SocketOptions socketOptions = new SocketOptions()
+            .setConnectTimeoutMillis(cassandraFig.getPoolTimeout() + 2000)
+            .setReadTimeoutMillis(cassandraFig.getTimeout() + 2000);
+
         final QueryOptions queryOptions = new QueryOptions()
             .setConsistencyLevel(defaultConsistencyLevel);
 
@@ -180,6 +185,7 @@ public class DataStaxClusterImpl implements DataStaxCluster {
             .withLoadBalancingPolicy(loadBalancingPolicy)
             .withPoolingOptions(poolingOptions)
             .withQueryOptions(queryOptions)
+            .withSocketOptions(socketOptions)
             .withProtocolVersion(getProtocolVersion(cassandraFig.getVersion()));
 
         // only add auth credentials if they were provided

http://git-wip-us.apache.org/repos/asf/usergrid/blob/cdab7087/stack/corepersistence/map/src/main/java/org/apache/usergrid/persistence/map/MapManager.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/map/src/main/java/org/apache/usergrid/persistence/map/MapManager.java
b/stack/corepersistence/map/src/main/java/org/apache/usergrid/persistence/map/MapManager.java
index 5fffaca..e1d121e 100644
--- a/stack/corepersistence/map/src/main/java/org/apache/usergrid/persistence/map/MapManager.java
+++ b/stack/corepersistence/map/src/main/java/org/apache/usergrid/persistence/map/MapManager.java
@@ -92,7 +92,7 @@ public interface MapManager {
     void delete( final String key );
 
     /**
-     * Return a page of keys that exist within the map
+     * Return a page of keys that exist within the map.  Keys are sorted descending.
      * @param cursor
      * @param limit
      */

http://git-wip-us.apache.org/repos/asf/usergrid/blob/cdab7087/stack/corepersistence/map/src/test/java/org/apache/usergrid/persistence/map/MapManagerTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/map/src/test/java/org/apache/usergrid/persistence/map/MapManagerTest.java
b/stack/corepersistence/map/src/test/java/org/apache/usergrid/persistence/map/MapManagerTest.java
index 254c915..89f6799 100644
--- a/stack/corepersistence/map/src/test/java/org/apache/usergrid/persistence/map/MapManagerTest.java
+++ b/stack/corepersistence/map/src/test/java/org/apache/usergrid/persistence/map/MapManagerTest.java
@@ -121,14 +121,14 @@ public class MapManagerTest {
         MapKeyResults keyResults = mm.getKeys(null, 3);
 
         assertEquals(3, keyResults.getKeys().size());
-        assertEquals(key1, keyResults.getKeys().get(0));
+        assertEquals(key6, keyResults.getKeys().get(0));
 
         assertNotNull(keyResults.getCursor());
 
         MapKeyResults keyResults2 = mm.getKeys(keyResults.getCursor(), 3);
 
         assertEquals(3, keyResults2.getKeys().size());
-        assertEquals(key4, keyResults2.getKeys().get(0));
+        assertEquals(key3, keyResults2.getKeys().get(0));
 
 
     }
@@ -157,17 +157,17 @@ public class MapManagerTest {
         MapKeyResults keyResults = mm.getKeys(null, 6);
 
         assertEquals(6, keyResults.getKeys().size());
-        assertEquals(key1, keyResults.getKeys().get(0));
+        assertEquals(key6, keyResults.getKeys().get(0));
 
 
-        mm.delete(key1);
-        mm.delete(key2);
-        mm.delete(key3);
+        mm.delete(key4);
+        mm.delete(key5);
+        mm.delete(key6);
 
         MapKeyResults keyResults2 = mm.getKeys(null, 6);
 
         assertEquals(3, keyResults2.getKeys().size());
-        assertEquals(key4, keyResults2.getKeys().get(0));
+        assertEquals(key3, keyResults2.getKeys().get(0));
 
 
     }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/cdab7087/stack/corepersistence/pom.xml
----------------------------------------------------------------------
diff --git a/stack/corepersistence/pom.xml b/stack/corepersistence/pom.xml
index 6ee4c80..fe976bc 100644
--- a/stack/corepersistence/pom.xml
+++ b/stack/corepersistence/pom.xml
@@ -80,7 +80,7 @@ limitations under the License.
         <commons.collections.version>3.2.1</commons.collections.version>
         <commons.io.version>2.4</commons.io.version>
         <commons.lang.version>3.1</commons.lang.version>
-        <datastax.version>2.1.10.3</datastax.version>
+        <datastax.version>2.1.9</datastax.version>
         <elasticsearch.version>1.4.4</elasticsearch.version>
         <fasterxml-uuid.version>3.1.3</fasterxml-uuid.version>
         <guava.version>18.0</guava.version>


Mime
View raw message