cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From slebre...@apache.org
Subject svn commit: r1147838 - in /cassandra/branches/cassandra-0.8: CHANGES.txt src/java/org/apache/cassandra/io/sstable/SSTableLoader.java src/java/org/apache/cassandra/service/StorageService.java src/java/org/apache/cassandra/tools/BulkLoader.java
Date Mon, 18 Jul 2011 12:43:32 GMT
Author: slebresne
Date: Mon Jul 18 12:43:31 2011
New Revision: 1147838

URL: http://svn.apache.org/viewvc?rev=1147838&view=rev
Log:
Fix JMX bulkload call
patch by slebresne; reviewed by jbellis for CASSANDRA-2908

Modified:
    cassandra/branches/cassandra-0.8/CHANGES.txt
    cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/io/sstable/SSTableLoader.java
    cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/service/StorageService.java
    cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/tools/BulkLoader.java

Modified: cassandra/branches/cassandra-0.8/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/CHANGES.txt?rev=1147838&r1=1147837&r2=1147838&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/CHANGES.txt (original)
+++ cassandra/branches/cassandra-0.8/CHANGES.txt Mon Jul 18 12:43:31 2011
@@ -28,6 +28,7 @@
  * fix protocol versioning (CASSANDRA-2818, 2860)
  * support spaces in path to log4j configuration (CASSANDRA-2383)
  * avoid including inferred types in CF update (CASSANDRA-2809)
+ * fix JMX bulkload call (CASSANDRA-2908)
 
 
 0.8.1

Modified: cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/io/sstable/SSTableLoader.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/io/sstable/SSTableLoader.java?rev=1147838&r1=1147837&r2=1147838&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/io/sstable/SSTableLoader.java
(original)
+++ cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/io/sstable/SSTableLoader.java
Mon Jul 18 12:43:31 2011
@@ -101,7 +101,7 @@ public class SSTableLoader
 
     public LoaderFuture stream(Set<InetAddress> toIgnore) throws IOException
     {
-        client.init();
+        client.init(keyspace);
 
         Collection<SSTableReader> sstables = openSSTables();
         if (sstables.isEmpty())
@@ -234,7 +234,7 @@ public class SSTableLoader
          * This method is guaranted to be called before any other method of a
          * client.
          */
-        public abstract void init();
+        public abstract void init(String keyspace);
 
         /**
          * Stop the client.

Modified: cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/service/StorageService.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/service/StorageService.java?rev=1147838&r1=1147837&r2=1147838&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/service/StorageService.java
(original)
+++ cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/service/StorageService.java
Mon Jul 18 12:43:31 2011
@@ -2472,7 +2472,15 @@ public class StorageService implements I
 
         SSTableLoader.Client client = new SSTableLoader.Client()
         {
-            public void init() {}
+            public void init(String keyspace)
+            {
+                for (Map.Entry<Range, List<InetAddress>> entry : StorageService.instance.getRangeToAddressMap(keyspace).entrySet())
+                {
+                    Range range = entry.getKey();
+                    for (InetAddress endpoint : entry.getValue())
+                        addRangeForEndpoint(range, endpoint);
+                }
+            }
 
             public boolean validateColumnFamily(String keyspace, String cfName)
             {

Modified: cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/tools/BulkLoader.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/tools/BulkLoader.java?rev=1147838&r1=1147837&r2=1147838&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/tools/BulkLoader.java (original)
+++ cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/tools/BulkLoader.java Mon
Jul 18 12:43:31 2011
@@ -57,7 +57,7 @@ public class BulkLoader
         LoaderOptions options = LoaderOptions.parseArgs(args);
         try
         {
-            SSTableLoader loader = new SSTableLoader(options.directory, new ExternalClient(options.directory.getName(),
options), options);
+            SSTableLoader loader = new SSTableLoader(options.directory, new ExternalClient(options),
options);
             SSTableLoader.LoaderFuture future = loader.stream(options.ignores);
 
             if (options.noProgress)
@@ -164,18 +164,16 @@ public class BulkLoader
 
     static class ExternalClient extends SSTableLoader.Client
     {
-        private final String keyspace;
-        private final Map<String, Set<String>> knownCfs = new HashMap<String,
Set<String>>();
+        private final Map<String, Map<String, CFMetaData>> knownCfs = new HashMap<String,
Map<String, CFMetaData>>();
         private final SSTableLoader.OutputHandler outputHandler;
 
-        public ExternalClient(String keyspace, SSTableLoader.OutputHandler outputHandler)
+        public ExternalClient(SSTableLoader.OutputHandler outputHandler)
         {
             super();
-            this.keyspace = keyspace;
             this.outputHandler = outputHandler;
         }
 
-        public void init()
+        public void init(String keyspace)
         {
             outputHandler.output(String.format("Starting client (and waiting %d seconds for
gossip) ...", StorageService.RING_DELAY / 1000));
             try



Mime
View raw message