cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sn...@apache.org
Subject [1/2] cassandra git commit: Hadoop integration is incompatible with Cassandra Driver 3.0.0
Date Thu, 04 Feb 2016 18:34:39 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk c164e51e7 -> b51f9495e


Hadoop integration is incompatible with Cassandra Driver 3.0.0

patch by Robert Stupp; reviewed by Jeremiah Jordan for CASSANDRA-11001


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

Branch: refs/heads/trunk
Commit: f34036265ec31b7ffe3a7a43b70be9039d01b544
Parents: b9bdd9e
Author: Robert Stupp <snazy@snazy.de>
Authored: Thu Feb 4 19:30:50 2016 +0100
Committer: Robert Stupp <snazy@snazy.de>
Committed: Thu Feb 4 19:30:50 2016 +0100

----------------------------------------------------------------------
 CHANGES.txt                                      |   4 ++++
 ...-core-3.0.0-beta1-bb1bce4-SNAPSHOT-shaded.jar | Bin 2288891 -> 0 bytes
 lib/cassandra-driver-core-3.0.0-shaded.jar       | Bin 0 -> 2433676 bytes
 .../cassandra/cql3/functions/UDHelper.java       |   2 +-
 .../cassandra/hadoop/cql3/CqlConfigHelper.java   |  10 +++++++---
 .../org/apache/cassandra/tools/BulkLoader.java   |   6 +++++-
 .../cassandra/cql3/IndexQueryPagingTest.java     |   3 ++-
 .../cql3/validation/entities/UFTest.java         |   8 ++++----
 .../cassandra/stress/util/JavaDriverClient.java  |   8 +++++---
 9 files changed, 28 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/f3403626/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 6e313c3..21ae788 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,3 +1,7 @@
+3.0.4
+ * Hadoop integration is incompatible with Cassandra Driver 3.0.0 (CASSANDRA-11001)
+
+
 3.0.3
  * Remove double initialization of newly added tables (CASSANDRA-11027)
  * Filter keys searcher results by target range (CASSANDRA-11104)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f3403626/lib/cassandra-driver-core-3.0.0-beta1-bb1bce4-SNAPSHOT-shaded.jar
----------------------------------------------------------------------
diff --git a/lib/cassandra-driver-core-3.0.0-beta1-bb1bce4-SNAPSHOT-shaded.jar b/lib/cassandra-driver-core-3.0.0-beta1-bb1bce4-SNAPSHOT-shaded.jar
deleted file mode 100644
index b8f002f..0000000
Binary files a/lib/cassandra-driver-core-3.0.0-beta1-bb1bce4-SNAPSHOT-shaded.jar and /dev/null
differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f3403626/lib/cassandra-driver-core-3.0.0-shaded.jar
----------------------------------------------------------------------
diff --git a/lib/cassandra-driver-core-3.0.0-shaded.jar b/lib/cassandra-driver-core-3.0.0-shaded.jar
new file mode 100644
index 0000000..86093a9
Binary files /dev/null and b/lib/cassandra-driver-core-3.0.0-shaded.jar differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f3403626/src/java/org/apache/cassandra/cql3/functions/UDHelper.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/functions/UDHelper.java b/src/java/org/apache/cassandra/cql3/functions/UDHelper.java
index d7700c4..cc62c84 100644
--- a/src/java/org/apache/cassandra/cql3/functions/UDHelper.java
+++ b/src/java/org/apache/cassandra/cql3/functions/UDHelper.java
@@ -44,7 +44,7 @@ public final class UDHelper
     {
         try
         {
-            Class<?> cls = Class.forName("com.datastax.driver.core.CassandraTypeParser");
+            Class<?> cls = Class.forName("com.datastax.driver.core.DataTypeClassNameParser");
             Method m = cls.getDeclaredMethod("parseOne", String.class, ProtocolVersion.class,
CodecRegistry.class);
             m.setAccessible(true);
             methodParseOne = MethodHandles.lookup().unreflect(m);

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f3403626/src/java/org/apache/cassandra/hadoop/cql3/CqlConfigHelper.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/hadoop/cql3/CqlConfigHelper.java b/src/java/org/apache/cassandra/hadoop/cql3/CqlConfigHelper.java
index 5d5d392..4e731e7 100644
--- a/src/java/org/apache/cassandra/hadoop/cql3/CqlConfigHelper.java
+++ b/src/java/org/apache/cassandra/hadoop/cql3/CqlConfigHelper.java
@@ -40,6 +40,7 @@ import org.apache.commons.lang3.StringUtils;
 import com.datastax.driver.core.AuthProvider;
 import com.datastax.driver.core.Cluster;
 import com.datastax.driver.core.HostDistance;
+import com.datastax.driver.core.JdkSSLOptions;
 import com.datastax.driver.core.PlainTextAuthProvider;
 import com.datastax.driver.core.ProtocolVersion;
 import com.datastax.driver.core.policies.LoadBalancingPolicy;
@@ -445,7 +446,7 @@ public class CqlConfigHelper
             if (maxConnections.isPresent())
                 poolingOptions.setMaxConnectionsPerHost(hostDistance, maxConnections.get());
             if (maxSimultaneousRequests.isPresent())
-                poolingOptions.setMaxSimultaneousRequestsPerConnectionThreshold(hostDistance,
maxSimultaneousRequests.get());
+                poolingOptions.setNewConnectionThreshold(hostDistance, maxSimultaneousRequests.get());
         }
 
         return poolingOptions;
@@ -545,10 +546,13 @@ public class CqlConfigHelper
             {
                 throw new RuntimeException(e);
             }
-            String[] css = SSLOptions.DEFAULT_SSL_CIPHER_SUITES;
+            String[] css = null;
             if (cipherSuites.isPresent())
                 css = cipherSuites.get().split(",");
-            return Optional.of(new SSLOptions(context,css));
+            return Optional.of(JdkSSLOptions.builder()
+                                            .withSSLContext(context)
+                                            .withCipherSuites(css)
+                                            .build());
         }
         return Optional.absent();
     }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f3403626/src/java/org/apache/cassandra/tools/BulkLoader.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/tools/BulkLoader.java b/src/java/org/apache/cassandra/tools/BulkLoader.java
index 3e32f66..2dc915d 100644
--- a/src/java/org/apache/cassandra/tools/BulkLoader.java
+++ b/src/java/org/apache/cassandra/tools/BulkLoader.java
@@ -31,6 +31,7 @@ import com.google.common.collect.Multimap;
 import org.apache.commons.cli.*;
 
 import com.datastax.driver.core.AuthProvider;
+import com.datastax.driver.core.JdkSSLOptions;
 import com.datastax.driver.core.PlainTextAuthProvider;
 import com.datastax.driver.core.SSLOptions;
 import javax.net.ssl.SSLContext;
@@ -272,7 +273,10 @@ public class BulkLoader
             throw new RuntimeException("Could not create SSL Context.", e);
         }
 
-        return new SSLOptions(sslContext, clientEncryptionOptions.cipher_suites);
+        return JdkSSLOptions.builder()
+                            .withSSLContext(sslContext)
+                            .withCipherSuites(clientEncryptionOptions.cipher_suites)
+                            .build();
     }
 
     static class ExternalClient extends NativeSSTableLoaderClient

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f3403626/test/unit/org/apache/cassandra/cql3/IndexQueryPagingTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/cql3/IndexQueryPagingTest.java b/test/unit/org/apache/cassandra/cql3/IndexQueryPagingTest.java
index a947593..afca512 100644
--- a/test/unit/org/apache/cassandra/cql3/IndexQueryPagingTest.java
+++ b/test/unit/org/apache/cassandra/cql3/IndexQueryPagingTest.java
@@ -3,6 +3,7 @@ package org.apache.cassandra.cql3;
 import org.junit.Test;
 
 import com.datastax.driver.core.Session;
+import com.datastax.driver.core.SimpleStatement;
 import com.datastax.driver.core.Statement;
 
 import static org.junit.Assert.assertEquals;
@@ -77,7 +78,7 @@ public class IndexQueryPagingTest extends CQLTester
         // that all rows are returned, so we know that paging
         // of the results was involved.
         Session session = sessionNet();
-        Statement stmt = session.newSimpleStatement(String.format(cql, KEYSPACE + "." + currentTable()));
+        Statement stmt = new SimpleStatement(String.format(cql, KEYSPACE + '.' + currentTable()));
         stmt.setFetchSize(rowCount - 1);
         assertEquals(rowCount, session.execute(stmt).all().size());
     }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f3403626/test/unit/org/apache/cassandra/cql3/validation/entities/UFTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/cql3/validation/entities/UFTest.java b/test/unit/org/apache/cassandra/cql3/validation/entities/UFTest.java
index 6d54e36..cc0e806 100644
--- a/test/unit/org/apache/cassandra/cql3/validation/entities/UFTest.java
+++ b/test/unit/org/apache/cassandra/cql3/validation/entities/UFTest.java
@@ -2043,10 +2043,10 @@ public class UFTest extends CQLTester
                                              "LANGUAGE java\n" +
                                              "AS 'return values.toString();';");
 
-        assertRows(execute("SELECT a, " + functionName + "(b) FROM %s WHERE a = 0"), row(0,
"(null, null)"));
-        assertRows(execute("SELECT a, " + functionName + "(b) FROM %s WHERE a = 1"), row(1,
"(1, 2)"));
-        assertRows(execute("SELECT a, " + functionName + "(b) FROM %s WHERE a = 2"), row(2,
"(4, 5)"));
-        assertRows(execute("SELECT a, " + functionName + "(b) FROM %s WHERE a = 3"), row(3,
"(7, 8)"));
+        assertRows(execute("SELECT a, " + functionName + "(b) FROM %s WHERE a = 0"), row(0,
"(NULL,NULL)"));
+        assertRows(execute("SELECT a, " + functionName + "(b) FROM %s WHERE a = 1"), row(1,
"(1,2)"));
+        assertRows(execute("SELECT a, " + functionName + "(b) FROM %s WHERE a = 2"), row(2,
"(4,5)"));
+        assertRows(execute("SELECT a, " + functionName + "(b) FROM %s WHERE a = 3"), row(3,
"(7,8)"));
 
         functionName = createFunction(KEYSPACE,
                                       "tuple<int, int>",

http://git-wip-us.apache.org/repos/asf/cassandra/blob/f3403626/tools/stress/src/org/apache/cassandra/stress/util/JavaDriverClient.java
----------------------------------------------------------------------
diff --git a/tools/stress/src/org/apache/cassandra/stress/util/JavaDriverClient.java b/tools/stress/src/org/apache/cassandra/stress/util/JavaDriverClient.java
index 7d5f38c..bbf1008 100644
--- a/tools/stress/src/org/apache/cassandra/stress/util/JavaDriverClient.java
+++ b/tools/stress/src/org/apache/cassandra/stress/util/JavaDriverClient.java
@@ -68,7 +68,7 @@ public class JavaDriverClient
         this.authProvider = settings.mode.authProvider;
         this.encryptionOptions = encryptionOptions;
         if (settings.node.isWhiteList)
-            whitelist = new WhiteListPolicy(new DCAwareRoundRobinPolicy(), settings.node.resolveAll(settings.port.nativePort));
+            whitelist = new WhiteListPolicy(DCAwareRoundRobinPolicy.builder().build(), settings.node.resolveAll(settings.port.nativePort));
         else
             whitelist = null;
         connectionsPerHost = settings.mode.connectionsPerHost == null ? 8 : settings.mode.connectionsPerHost;
@@ -124,7 +124,9 @@ public class JavaDriverClient
         {
             SSLContext sslContext;
             sslContext = SSLFactory.createSSLContext(encryptionOptions, true);
-            SSLOptions sslOptions = new SSLOptions(sslContext, encryptionOptions.cipher_suites);
+            SSLOptions sslOptions = JdkSSLOptions.builder()
+                                                 .withSSLContext(sslContext)
+                                                 .withCipherSuites(encryptionOptions.cipher_suites).build();
             clusterBuilder.withSSL(sslOptions);
         }
 
@@ -165,7 +167,7 @@ public class JavaDriverClient
 
     public ResultSet execute(String query, org.apache.cassandra.db.ConsistencyLevel consistency)
     {
-        SimpleStatement stmt = getSession().newSimpleStatement(query);
+        SimpleStatement stmt = new SimpleStatement(query);
         stmt.setConsistencyLevel(from(consistency));
         return getSession().execute(stmt);
     }


Mime
View raw message