cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [1/6] git commit: fsync compression metadata patch by jbellis; reviewed by Pavel Yaskevich for CASSANDRA-6531
Date Sat, 28 Dec 2013 06:17:44 GMT
Updated Branches:
  refs/heads/cassandra-1.2 f219e83b6 -> ecbf0fd6f
  refs/heads/cassandra-2.0 dc2412243 -> 6a211f485
  refs/heads/trunk e9a678319 -> 70f7574a4


fsync compression metadata
patch by jbellis; reviewed by Pavel Yaskevich for CASSANDRA-6531


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

Branch: refs/heads/cassandra-1.2
Commit: ecbf0fd6f9e2b0dd9c5f0c5439b677388d4caf9c
Parents: f219e83
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Sat Dec 28 00:16:02 2013 -0600
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Sat Dec 28 00:16:27 2013 -0600

----------------------------------------------------------------------
 CHANGES.txt                                                   | 1 +
 .../org/apache/cassandra/io/compress/CompressionMetadata.java | 7 ++++++-
 src/java/org/apache/cassandra/io/util/SequentialWriter.java   | 4 ++++
 3 files changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/ecbf0fd6/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 4eee4ee..6c63f9d 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -5,6 +5,7 @@
  * Don't drop local mutations without a trace (CASSANDRA-6510)
  * Don't allow null max_hint_window_in_ms (CASSANDRA-6419)
  * Validate SliceRange start and finish lengths (CASSANDRA-6521)
+ * fsync compression metadata (CASSANDRA-6531)
 
 
 1.2.13

http://git-wip-us.apache.org/repos/asf/cassandra/blob/ecbf0fd6/src/java/org/apache/cassandra/io/compress/CompressionMetadata.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/compress/CompressionMetadata.java b/src/java/org/apache/cassandra/io/compress/CompressionMetadata.java
index 93b0091..7a3f4e7 100644
--- a/src/java/org/apache/cassandra/io/compress/CompressionMetadata.java
+++ b/src/java/org/apache/cassandra/io/compress/CompressionMetadata.java
@@ -284,7 +284,6 @@ public class CompressionMetadata
 
             try
             {
-
                 // seek back to the data length position
                 seek(dataLengthOffset);
 
@@ -358,6 +357,12 @@ public class CompressionMetadata
                 throw new FSWriteError(e, filePath);
             }
         }
+
+        public void close() throws IOException
+        {
+            getFD().sync();
+            super.close();
+        }
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/cassandra/blob/ecbf0fd6/src/java/org/apache/cassandra/io/util/SequentialWriter.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/util/SequentialWriter.java b/src/java/org/apache/cassandra/io/util/SequentialWriter.java
index 77d4fcf..7508085 100644
--- a/src/java/org/apache/cassandra/io/util/SequentialWriter.java
+++ b/src/java/org/apache/cassandra/io/util/SequentialWriter.java
@@ -27,6 +27,10 @@ import org.apache.cassandra.io.FSReadError;
 import org.apache.cassandra.io.FSWriteError;
 import org.apache.cassandra.utils.CLibrary;
 
+/**
+ * Adds buffering, mark, and fsyncing to OutputStream.  We always fsync on close; we may
also
+ * fsync incrementally if Config.trickle_fsync is enabled.
+ */
 public class SequentialWriter extends OutputStream
 {
     // isDirty - true if this.buffer contains any un-synced bytes


Mime
View raw message