cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brandonwilli...@apache.org
Subject [3/4] git commit: SS.bulkLoad specifies the partitioner. Patch by brandonwilliams, reviewed by jbellis for CASSANDRA-4368
Date Mon, 25 Jun 2012 17:38:56 GMT
SS.bulkLoad specifies the partitioner.
Patch by brandonwilliams, reviewed by jbellis for CASSANDRA-4368


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

Branch: refs/heads/trunk
Commit: eacdca02dd400c514278a2e0665f3878298f2c7f
Parents: 7a510ac
Author: Brandon Williams <brandonwilliams@apache.org>
Authored: Mon Jun 25 12:38:03 2012 -0500
Committer: Brandon Williams <brandonwilliams@apache.org>
Committed: Mon Jun 25 12:38:03 2012 -0500

----------------------------------------------------------------------
 .../apache/cassandra/io/sstable/SSTableLoader.java |   13 +++++++++++-
 .../apache/cassandra/service/StorageService.java   |   16 +++++++++++---
 2 files changed, 24 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/eacdca02/src/java/org/apache/cassandra/io/sstable/SSTableLoader.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/sstable/SSTableLoader.java b/src/java/org/apache/cassandra/io/sstable/SSTableLoader.java
index c76d1e3..2ffe671 100644
--- a/src/java/org/apache/cassandra/io/sstable/SSTableLoader.java
+++ b/src/java/org/apache/cassandra/io/sstable/SSTableLoader.java
@@ -295,7 +295,18 @@ public class SSTableLoader
 
         protected void setPartitioner(String partclass) throws ConfigurationException
         {
-            this.partitioner = FBUtilities.newPartitioner(partclass);
+            setPartitioner(FBUtilities.newPartitioner(partclass));
+        }
+
+        protected void setPartitioner(IPartitioner partitioner) throws ConfigurationException
+        {
+            this.partitioner = partitioner;
+            DatabaseDescriptor.setPartitioner(partitioner);
+        }
+
+        protected void setPartitioner(IPartitioner partitioner) throws ConfigurationException
+        {
+            this.partitioner = partitioner;
             DatabaseDescriptor.setPartitioner(partitioner);
         }
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/eacdca02/src/java/org/apache/cassandra/service/StorageService.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/StorageService.java b/src/java/org/apache/cassandra/service/StorageService.java
index f7782f9..dbaf751 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -3015,11 +3015,19 @@ public class StorageService implements IEndpointStateChangeSubscriber,
StorageSe
             @Override
             public void init(String keyspace)
             {
-                for (Map.Entry<Range<Token>, List<InetAddress>> entry :
StorageService.instance.getRangeToAddressMap(keyspace).entrySet())
+                try
+                {
+                    setPartitioner(DatabaseDescriptor.getPartitioner());
+                    for (Map.Entry<Range<Token>, List<InetAddress>> entry
: StorageService.instance.getRangeToAddressMap(keyspace).entrySet())
+                    {
+                        Range<Token> range = entry.getKey();
+                        for (InetAddress endpoint : entry.getValue())
+                            addRangeForEndpoint(range, endpoint);
+                    }
+                }
+                catch (Exception e)
                 {
-                    Range<Token> range = entry.getKey();
-                    for (InetAddress endpoint : entry.getValue())
-                        addRangeForEndpoint(range, endpoint);
+                    throw new RuntimeException(e);
                 }
             }
 


Mime
View raw message