cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bened...@apache.org
Subject [2/3] cassandra git commit: nit comments
Date Thu, 12 Feb 2015 14:04:41 GMT
nit comments


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

Branch: refs/heads/trunk
Commit: 107a794d5e215c4d71a643c8e5b2afa3e9c43190
Parents: 0ced7a3
Author: Benedict Elliott Smith <benedict@apache.org>
Authored: Thu Feb 12 14:04:23 2015 +0000
Committer: Benedict Elliott Smith <benedict@apache.org>
Committed: Thu Feb 12 14:04:23 2015 +0000

----------------------------------------------------------------------
 .../apache/cassandra/io/compress/CompressedSequentialWriter.java   | 2 ++
 src/java/org/apache/cassandra/io/compress/CompressionMetadata.java | 1 +
 2 files changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/107a794d/src/java/org/apache/cassandra/io/compress/CompressedSequentialWriter.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/compress/CompressedSequentialWriter.java b/src/java/org/apache/cassandra/io/compress/CompressedSequentialWriter.java
index ea0d785..ad53e83 100644
--- a/src/java/org/apache/cassandra/io/compress/CompressedSequentialWriter.java
+++ b/src/java/org/apache/cassandra/io/compress/CompressedSequentialWriter.java
@@ -150,6 +150,8 @@ public class CompressedSequentialWriter extends SequentialWriter
     {
         if (overrideLength <= 0)
             return metadataWriter.open(originalSize, chunkOffset, isFinal ? FINAL : SHARED_FINAL);
+        // we are early opening the file, make sure we open metadata with the correct size
+        assert !isFinal;
         return metadataWriter.open(overrideLength, chunkOffset, SHARED);
     }
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/107a794d/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 ad087c7..fd8248e 100644
--- a/src/java/org/apache/cassandra/io/compress/CompressionMetadata.java
+++ b/src/java/org/apache/cassandra/io/compress/CompressionMetadata.java
@@ -351,6 +351,7 @@ public class CompressionMetadata
                         this.offsets.unreference();
                     }
                     // null out our reference to the original shared data to catch accidental
reuse
+                    // note that since noone is writing to this Writer while we open it,
null:ing out this.offsets is safe
                     this.offsets = null;
                     if (type == OpenType.SHARED_FINAL)
                     {


Mime
View raw message