cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From slebre...@apache.org
Subject [1/2] cassandra git commit: Fix backward incompatibility in CqlInputFormat
Date Fri, 20 Nov 2015 14:21:25 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-3.1 4b364ecba -> f3fcdd7cb


Fix backward incompatibility in CqlInputFormat

patch by jlewandowski; reviewed by mike_tr_adamson for CASSANDRA-10717


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

Branch: refs/heads/cassandra-3.1
Commit: fee9791b0afccd063e1cacf913519f09f4db42ff
Parents: 8475042
Author: Sylvain Lebresne <sylvain@datastax.com>
Authored: Fri Nov 20 15:16:10 2015 +0100
Committer: Sylvain Lebresne <sylvain@datastax.com>
Committed: Fri Nov 20 15:16:10 2015 +0100

----------------------------------------------------------------------
 CHANGES.txt                                        |  1 +
 .../cassandra/hadoop/cql3/CqlConfigHelper.java     | 17 ++++++++++++++++-
 2 files changed, 17 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/fee9791b/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index a9b3f36..e6f5406 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.0.1
+ * Fix backward incompatibiliy in CqlInputFormat (CASSANDRA-10717)
  * Correctly preserve deletion info on updated rows when notifying indexers
    of single-row deletions (CASSANDRA-10694)
  * Notify indexers of partition delete during cleanup (CASSANDRA-10685)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/fee9791b/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 fe62ea7..5d5d392 100644
--- a/src/java/org/apache/cassandra/hadoop/cql3/CqlConfigHelper.java
+++ b/src/java/org/apache/cassandra/hadoop/cql3/CqlConfigHelper.java
@@ -501,11 +501,26 @@ public class CqlConfigHelper
         return new LimitedLocalNodeFirstLocalBalancingPolicy(stickHosts);
     }
 
+    private static Optional<AuthProvider> getDefaultAuthProvider(Configuration conf)
+    {
+        Optional<String> username = getStringSetting(USERNAME, conf);
+        Optional<String> password = getStringSetting(PASSWORD, conf);
+
+        if (username.isPresent() && password.isPresent())
+        {
+            return Optional.of(new PlainTextAuthProvider(username.get(), password.get()));
+        }
+        else
+        {
+            return Optional.absent();
+        }
+    }
+
     private static Optional<AuthProvider> getAuthProvider(Configuration conf)
     {
         Optional<String> authProvider = getInputNativeAuthProvider(conf);
         if (!authProvider.isPresent())
-            return Optional.absent();
+            return getDefaultAuthProvider(conf);
 
         return Optional.of(getClientAuthProvider(authProvider.get(), conf));
     }


Mime
View raw message