cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yu...@apache.org
Subject [2/3] cassandra git commit: Shutdown CommitLog executor
Date Thu, 15 Jan 2015 17:03:01 GMT
Shutdown CommitLog executor

This also reverts previous patch for CASSANDRA-8281
patch by Benjamin Lerer; reviewed by yukim for CASSANDRA-8281


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

Branch: refs/heads/trunk
Commit: a6e953c8c71caa1724d15dc31069aa073a9fe9ee
Parents: d406bab
Author: Benjamin Lerer <b_lerer@hotmail.com>
Authored: Thu Jan 15 10:22:19 2015 -0600
Committer: Yuki Morishita <yukim@apache.org>
Committed: Thu Jan 15 10:22:19 2015 -0600

----------------------------------------------------------------------
 .../apache/cassandra/io/sstable/CQLSSTableWriter.java  | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/a6e953c8/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 a42c480..85e54ab 100644
--- a/src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java
+++ b/src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java
@@ -34,6 +34,7 @@ import org.apache.cassandra.cql3.statements.*;
 import org.apache.cassandra.cql3.*;
 import org.apache.cassandra.config.*;
 import org.apache.cassandra.db.*;
+import org.apache.cassandra.db.commitlog.CommitLog;
 import org.apache.cassandra.db.composites.Composite;
 import org.apache.cassandra.db.marshal.AbstractType;
 import org.apache.cassandra.dht.IPartitioner;
@@ -78,8 +79,8 @@ public class CQLSSTableWriter implements Closeable
 {
     static
     {
-        // The CQLSSTableWriter must always be used in client mode.
-        Config.setClientMode(true);
+        // The Keyspace need to be initialized before we can call Keyspace.open
+        Keyspace.setInitialized();
     }
 
     private final AbstractSSTableSimpleWriter writer;
@@ -269,6 +270,14 @@ public class CQLSSTableWriter implements Closeable
     public void close() throws IOException
     {
         writer.close();
+        try
+        {
+            CommitLog.instance.shutdownBlocking();
+        }
+        catch (InterruptedException e)
+        {
+            Thread.currentThread().interrupt();
+        }
     }
 
     /**


Mime
View raw message