cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yu...@apache.org
Subject [1/3] cassandra git commit: Fix DatabaseDescriptorRefTest
Date Fri, 30 Sep 2016 14:58:39 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-3.X 02404115e -> cf5cd158e
  refs/heads/trunk 56e01770b -> 8d4478ba2


Fix DatabaseDescriptorRefTest

patch by yukim; reviewed by Alex Petrov for CASSANDRA-12677


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

Branch: refs/heads/cassandra-3.X
Commit: cf5cd158e9ccc24239015b5928f65628c3f5663e
Parents: 0240411
Author: Yuki Morishita <yukim@apache.org>
Authored: Tue Sep 20 16:31:18 2016 -0500
Committer: Yuki Morishita <yukim@apache.org>
Committed: Fri Sep 30 09:57:37 2016 -0500

----------------------------------------------------------------------
 src/java/org/apache/cassandra/config/DatabaseDescriptor.java     | 2 --
 src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java   | 4 +++-
 .../org/apache/cassandra/test/microbench/MutationBench.java      | 3 +++
 .../org/apache/cassandra/config/DatabaseDescriptorRefTest.java   | 1 +
 .../org/apache/cassandra/io/sstable/StressCQLSSTableWriter.java  | 3 +++
 5 files changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/cf5cd158/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
index 880cb1e..36def79 100644
--- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
+++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
@@ -44,7 +44,6 @@ import org.apache.cassandra.auth.IRoleManager;
 import org.apache.cassandra.config.Config.CommitLogSync;
 import org.apache.cassandra.config.Config.RequestSchedulerId;
 import org.apache.cassandra.dht.IPartitioner;
-import org.apache.cassandra.dht.Murmur3Partitioner;
 import org.apache.cassandra.exceptions.ConfigurationException;
 import org.apache.cassandra.io.FSWriteError;
 import org.apache.cassandra.io.util.DiskOptimizationStrategy;
@@ -220,7 +219,6 @@ public class DatabaseDescriptor
         Config.setClientMode(true);
         conf = new Config();
         diskOptimizationStrategy = new SpinningDiskOptimizationStrategy();
-        partitioner = Murmur3Partitioner.instance;
     }
 
     public static boolean isClientInitialized()

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cf5cd158/src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java b/src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java
index dd9eb59..8a9d01d 100644
--- a/src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java
+++ b/src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java
@@ -53,7 +53,6 @@ import org.apache.cassandra.exceptions.InvalidRequestException;
 import org.apache.cassandra.exceptions.RequestValidationException;
 import org.apache.cassandra.exceptions.SyntaxException;
 import org.apache.cassandra.io.sstable.format.SSTableFormat;
-import org.apache.cassandra.io.util.SpinningDiskOptimizationStrategy;
 import org.apache.cassandra.schema.KeyspaceMetadata;
 import org.apache.cassandra.schema.KeyspaceParams;
 import org.apache.cassandra.schema.Types;
@@ -106,6 +105,9 @@ public class CQLSSTableWriter implements Closeable
     static
     {
         DatabaseDescriptor.clientInitialization(false);
+        // Partitioner is not set in client mode.
+        if (DatabaseDescriptor.getPartitioner() == null)
+            DatabaseDescriptor.setPartitionerUnsafe(Murmur3Partitioner.instance);
     }
 
     private final AbstractSSTableSimpleWriter writer;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cf5cd158/test/microbench/org/apache/cassandra/test/microbench/MutationBench.java
----------------------------------------------------------------------
diff --git a/test/microbench/org/apache/cassandra/test/microbench/MutationBench.java b/test/microbench/org/apache/cassandra/test/microbench/MutationBench.java
index 20d8ff5..8c177cf 100644
--- a/test/microbench/org/apache/cassandra/test/microbench/MutationBench.java
+++ b/test/microbench/org/apache/cassandra/test/microbench/MutationBench.java
@@ -65,6 +65,9 @@ public class MutationBench
     static
     {
         DatabaseDescriptor.clientInitialization(false);
+        // Partitioner is not set in client mode.
+        if (DatabaseDescriptor.getPartitioner() == null)
+            DatabaseDescriptor.setPartitionerUnsafe(Murmur3Partitioner.instance);
     }
 
     static String keyspace = "keyspace1";

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cf5cd158/test/unit/org/apache/cassandra/config/DatabaseDescriptorRefTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/config/DatabaseDescriptorRefTest.java b/test/unit/org/apache/cassandra/config/DatabaseDescriptorRefTest.java
index 2dcfbd1..421142f 100644
--- a/test/unit/org/apache/cassandra/config/DatabaseDescriptorRefTest.java
+++ b/test/unit/org/apache/cassandra/config/DatabaseDescriptorRefTest.java
@@ -99,6 +99,7 @@ public class DatabaseDescriptorRefTest
     "org.apache.cassandra.io.util.DataOutputStreamPlus",
     "org.apache.cassandra.io.util.DataOutputPlus",
     "org.apache.cassandra.io.util.DiskOptimizationStrategy",
+    "org.apache.cassandra.io.util.SpinningDiskOptimizationStrategy",
     "org.apache.cassandra.locator.SimpleSeedProvider",
     "org.apache.cassandra.locator.SeedProvider",
     "org.apache.cassandra.net.BackPressureStrategy",

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cf5cd158/tools/stress/src/org/apache/cassandra/io/sstable/StressCQLSSTableWriter.java
----------------------------------------------------------------------
diff --git a/tools/stress/src/org/apache/cassandra/io/sstable/StressCQLSSTableWriter.java
b/tools/stress/src/org/apache/cassandra/io/sstable/StressCQLSSTableWriter.java
index d9bf669..4fe05a8 100644
--- a/tools/stress/src/org/apache/cassandra/io/sstable/StressCQLSSTableWriter.java
+++ b/tools/stress/src/org/apache/cassandra/io/sstable/StressCQLSSTableWriter.java
@@ -99,6 +99,9 @@ public class StressCQLSSTableWriter implements Closeable
     static
     {
         DatabaseDescriptor.clientInitialization(false);
+        // Partitioner is not set in client mode.
+        if (DatabaseDescriptor.getPartitioner() == null)
+            DatabaseDescriptor.setPartitionerUnsafe(Murmur3Partitioner.instance);
     }
 
     private final AbstractSSTableSimpleWriter writer;


Mime
View raw message