cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bened...@apache.org
Subject [1/3] cassandra git commit: pass correct (but unused in this context) value to SSTableWriter.afterAppend, and rename parameter name
Date Thu, 12 Mar 2015 12:27:50 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 4831ba14a -> cbd4de8f5
  refs/heads/trunk 24915cd48 -> e5d119aab


pass correct (but unused in this context) value to SSTableWriter.afterAppend, and rename parameter
name


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

Branch: refs/heads/cassandra-2.1
Commit: cbd4de8f51cf0da1579abcd8d93803c4e8845024
Parents: 4831ba1
Author: Benedict Elliott Smith <benedict@apache.org>
Authored: Thu Mar 12 12:26:03 2015 +0000
Committer: Benedict Elliott Smith <benedict@apache.org>
Committed: Thu Mar 12 12:26:03 2015 +0000

----------------------------------------------------------------------
 .../apache/cassandra/io/sstable/SSTableWriter.java    | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/cbd4de8f/src/java/org/apache/cassandra/io/sstable/SSTableWriter.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/sstable/SSTableWriter.java b/src/java/org/apache/cassandra/io/sstable/SSTableWriter.java
index b35b652..440961f 100644
--- a/src/java/org/apache/cassandra/io/sstable/SSTableWriter.java
+++ b/src/java/org/apache/cassandra/io/sstable/SSTableWriter.java
@@ -173,7 +173,7 @@ public class SSTableWriter extends SSTable
         return (lastWrittenKey == null) ? 0 : dataFile.getFilePointer();
     }
 
-    private void afterAppend(DecoratedKey decoratedKey, long dataPosition, RowIndexEntry
index)
+    private void afterAppend(DecoratedKey decoratedKey, long dataEnd, RowIndexEntry index)
     {
         sstableMetadataCollector.addKey(decoratedKey.getKey());
         lastWrittenKey = decoratedKey;
@@ -182,9 +182,9 @@ public class SSTableWriter extends SSTable
             first = lastWrittenKey;
 
         if (logger.isTraceEnabled())
-            logger.trace("wrote " + decoratedKey + " at " + dataPosition);
-        iwriter.append(decoratedKey, index, dataPosition);
-        dbuilder.addPotentialBoundary(dataPosition);
+            logger.trace("wrote " + decoratedKey + " at " + dataEnd);
+        iwriter.append(decoratedKey, index, dataEnd);
+        dbuilder.addPotentialBoundary(dataEnd);
     }
 
     /**
@@ -222,16 +222,18 @@ public class SSTableWriter extends SSTable
         }
 
         long startPosition = beforeAppend(decoratedKey);
+        long endPosition;
         try
         {
             RowIndexEntry entry = rawAppend(cf, startPosition, decoratedKey, dataFile.stream);
-            afterAppend(decoratedKey, startPosition, entry);
+            endPosition = dataFile.getFilePointer();
+            afterAppend(decoratedKey, endPosition, entry);
         }
         catch (IOException e)
         {
             throw new FSWriteError(e, dataFile.getPath());
         }
-        sstableMetadataCollector.update(dataFile.getFilePointer() - startPosition, cf.getColumnStats());
+        sstableMetadataCollector.update(endPosition - startPosition, cf.getColumnStats());
     }
 
     public static RowIndexEntry rawAppend(ColumnFamily cf, long startPosition, DecoratedKey
key, DataOutputPlus out) throws IOException


Mime
View raw message