cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmcken...@apache.org
Subject [10/19] cassandra git commit: 10534 2.2 patch
Date Fri, 13 Nov 2015 14:59:05 GMT
10534 2.2 patch


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

Branch: refs/heads/cassandra-3.0
Commit: 73a730f926d25a7d4f693507937b8565b701259c
Parents: 3639454
Author: Stefania Alborghetti <stefania.alborghetti@datastax.com>
Authored: Fri Nov 13 09:57:42 2015 -0500
Committer: Joshua McKenzie <jmckenzie@apache.org>
Committed: Fri Nov 13 09:57:42 2015 -0500

----------------------------------------------------------------------
 .../apache/cassandra/io/compress/CompressionMetadata.java    | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/73a730f9/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 23a9f3e..e5d470c 100644
--- a/src/java/org/apache/cassandra/io/compress/CompressionMetadata.java
+++ b/src/java/org/apache/cassandra/io/compress/CompressionMetadata.java
@@ -345,11 +345,15 @@ public class CompressionMetadata
             }
 
             // flush the data to disk
-            try (DataOutputStream out = new DataOutputStream(new BufferedOutputStream(new
FileOutputStream(filePath))))
+            try (FileOutputStream fos = new FileOutputStream(filePath);
+                 DataOutputStream out = new DataOutputStream(new BufferedOutputStream(fos)))
             {
                 writeHeader(out, dataLength, count);
-                for (int i = 0 ; i < count ; i++)
+                for (int i = 0; i < count; i++)
                     out.writeLong(offsets.getLong(i * 8L));
+
+                out.flush();
+                fos.getFD().sync();
             }
             catch (IOException e)
             {


Mime
View raw message