cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [2/3] git commit: update unsafetruncate -> unsafesystem patch by Christian Spriegel and jbellis for CASSANDRA-5704
Date Thu, 18 Jul 2013 16:45:32 GMT
update unsafetruncate -> unsafesystem
patch by Christian Spriegel and jbellis for CASSANDRA-5704


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

Branch: refs/heads/trunk
Commit: b0107843c41d1d82e7631f2d5557e67c73c6e51b
Parents: 681983a
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Thu Jul 18 09:40:21 2013 -0700
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Thu Jul 18 09:40:21 2013 -0700

----------------------------------------------------------------------
 CHANGES.txt                                      |  2 +-
 src/java/org/apache/cassandra/db/DefsTable.java  | 12 +++---------
 .../org/apache/cassandra/db/SystemTable.java     | 19 ++++---------------
 3 files changed, 8 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/b0107843/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 4886aa4..253c649 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,5 +1,5 @@
 1.2.7
- * add cassandra.unsafetruncate property (CASSANDRA-5704)
+ * add cassandra.unsafesystem property (CASSANDRA-5704)
  * (Hadoop) quote identifiers in CqlPagingRecordReader (CASSANDRA-5763)
  * Add replace_node functionality for vnodes (CASSANDRA-5337)
  * Add timeout events to query traces (CASSANDRA-5520)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/b0107843/src/java/org/apache/cassandra/db/DefsTable.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/DefsTable.java b/src/java/org/apache/cassandra/db/DefsTable.java
index b96205d..ea15cd0 100644
--- a/src/java/org/apache/cassandra/db/DefsTable.java
+++ b/src/java/org/apache/cassandra/db/DefsTable.java
@@ -44,7 +44,6 @@ import org.apache.cassandra.exceptions.ConfigurationException;
 import org.apache.cassandra.service.StorageService;
 import org.apache.cassandra.service.MigrationManager;
 import org.apache.cassandra.utils.ByteBufferUtil;
-import org.apache.cassandra.utils.FBUtilities;
 
 /**
  * SCHEMA_{KEYSPACES, COLUMNFAMILIES, COLUMNS}_CF are used to store Keyspace/ColumnFamily
attributes to make schema
@@ -620,14 +619,9 @@ public class DefsTable
 
     private static void flushSchemaCFs()
     {
-        flushSchemaCF(SystemTable.SCHEMA_KEYSPACES_CF);
-        flushSchemaCF(SystemTable.SCHEMA_COLUMNFAMILIES_CF);
-        flushSchemaCF(SystemTable.SCHEMA_COLUMNS_CF);
-    }
-
-    private static void flushSchemaCF(String cfName)
-    {
-        FBUtilities.waitOnFuture(SystemTable.schemaCFS(cfName).forceFlush());
+        SystemTable.forceBlockingFlush(SystemTable.SCHEMA_KEYSPACES_CF);
+        SystemTable.forceBlockingFlush(SystemTable.SCHEMA_COLUMNFAMILIES_CF);
+        SystemTable.forceBlockingFlush(SystemTable.SCHEMA_COLUMNS_CF);
     }
 
     private static ByteBuffer toUTF8Bytes(UUID version)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/b0107843/src/java/org/apache/cassandra/db/SystemTable.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/SystemTable.java b/src/java/org/apache/cassandra/db/SystemTable.java
index 1d9fd72..4c74df5 100644
--- a/src/java/org/apache/cassandra/db/SystemTable.java
+++ b/src/java/org/apache/cassandra/db/SystemTable.java
@@ -185,8 +185,7 @@ public class SystemTable
     {
         String req = "UPDATE system.%s SET truncated_at = truncated_at + %s WHERE key = '%s'";
         processInternal(String.format(req, LOCAL_CF, truncationAsMapEntry(cfs, truncatedAt,
position), LOCAL_KEY));
-        if (!Boolean.getBoolean("cassandra.unsafetruncate"))
-            forceBlockingFlush(LOCAL_CF);
+        forceBlockingFlush(LOCAL_CF);
     }
 
     /**
@@ -347,20 +346,10 @@ public class SystemTable
         return tokens;
     }
 
-    private static void forceBlockingFlush(String cfname)
+    public static void forceBlockingFlush(String cfname)
     {
-        try
-        {
-            Table.open(Table.SYSTEM_KS).getColumnFamilyStore(cfname).forceBlockingFlush();
-        }
-        catch (ExecutionException e)
-        {
-            throw new RuntimeException(e);
-        }
-        catch (InterruptedException e)
-        {
-            throw new AssertionError(e);
-        }
+        if (!Boolean.getBoolean("cassandra.unsafesystem"))
+            FBUtilities.waitOnFuture(Table.open(Table.SYSTEM_KS).getColumnFamilyStore(cfname).forceFlush());
     }
 
     /**


Mime
View raw message