cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbros...@apache.org
Subject cassandra git commit: push down indexFileLength calc, to where it's used
Date Tue, 12 Jul 2016 04:00:26 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk 9fed08449 -> 019d43734


push down indexFileLength calc, to where it's used


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

Branch: refs/heads/trunk
Commit: 019d43734d30499242af621541cf1c48958046e3
Parents: 9fed084
Author: Dave Brosius <dbrosius@mebigfatguy.com>
Authored: Tue Jul 12 00:00:04 2016 -0400
Committer: Dave Brosius <dbrosius@mebigfatguy.com>
Committed: Tue Jul 12 00:00:04 2016 -0400

----------------------------------------------------------------------
 src/java/org/apache/cassandra/io/sstable/format/SSTableReader.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/019d4373/src/java/org/apache/cassandra/io/sstable/format/SSTableReader.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/sstable/format/SSTableReader.java b/src/java/org/apache/cassandra/io/sstable/format/SSTableReader.java
index 78a6825..fc0849f 100644
--- a/src/java/org/apache/cassandra/io/sstable/format/SSTableReader.java
+++ b/src/java/org/apache/cassandra/io/sstable/format/SSTableReader.java
@@ -752,11 +752,11 @@ public abstract class SSTableReader extends SSTable implements SelfRefCounted<SS
                 builtSummary = true;
             }
 
-            long indexFileLength = new File(descriptor.filenameFor(Component.PRIMARY_INDEX)).length();
             int dataBufferSize = optimizationStrategy.bufferSize(sstableMetadata.estimatedPartitionSize.percentile(DatabaseDescriptor.getDiskOptimizationEstimatePercentile()));
 
             if (components.contains(Component.PRIMARY_INDEX))
             {
+                long indexFileLength = new File(descriptor.filenameFor(Component.PRIMARY_INDEX)).length();
                 int indexBufferSize = optimizationStrategy.bufferSize(indexFileLength / indexSummary.size());
                 ifile = ibuilder.bufferSize(indexBufferSize).complete();
             }


Mime
View raw message