cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [06/14] git commit: fix build, sort of
Date Mon, 22 Apr 2013 14:43:07 GMT
fix build, sort of


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

Branch: refs/heads/trunk
Commit: 811f82c5b151bb1f6178392470981883d5e1dfc5
Parents: 317ab72
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Fri Apr 19 14:04:41 2013 -0500
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Fri Apr 19 14:04:41 2013 -0500

----------------------------------------------------------------------
 src/java/org/apache/cassandra/db/ColumnIndex.java  |    8 ++++++++
 .../org/apache/cassandra/cache/ObjectSizeTest.java |    3 ++-
 2 files changed, 10 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/811f82c5/src/java/org/apache/cassandra/db/ColumnIndex.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/ColumnIndex.java b/src/java/org/apache/cassandra/db/ColumnIndex.java
index e2ac3e4..658e94f 100644
--- a/src/java/org/apache/cassandra/db/ColumnIndex.java
+++ b/src/java/org/apache/cassandra/db/ColumnIndex.java
@@ -22,6 +22,8 @@ import java.io.IOException;
 import java.nio.ByteBuffer;
 import java.util.*;
 
+import com.google.common.annotations.VisibleForTesting;
+
 import org.apache.cassandra.config.DatabaseDescriptor;
 import org.apache.cassandra.io.sstable.IndexHelper;
 import org.apache.cassandra.utils.AlwaysPresentFilter;
@@ -49,6 +51,12 @@ public class ColumnIndex
         this.bloomFilter = bloomFilter;
     }
 
+    @VisibleForTesting
+    public static ColumnIndex nothing()
+    {
+        return new ColumnIndex(0);
+    }
+
     /**
      * Help to create an index for a column family based on size of columns,
      * and write said columns to disk.

http://git-wip-us.apache.org/repos/asf/cassandra/blob/811f82c5/test/unit/org/apache/cassandra/cache/ObjectSizeTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/cache/ObjectSizeTest.java b/test/unit/org/apache/cassandra/cache/ObjectSizeTest.java
index 47aab6d..94e795f 100644
--- a/test/unit/org/apache/cassandra/cache/ObjectSizeTest.java
+++ b/test/unit/org/apache/cassandra/cache/ObjectSizeTest.java
@@ -6,6 +6,7 @@ import java.util.UUID;
 import org.junit.Test;
 
 import junit.framework.Assert;
+import org.apache.cassandra.db.ColumnIndex;
 import org.apache.cassandra.db.DeletionTime;
 import org.apache.cassandra.db.RowIndexEntry;
 import org.apache.cassandra.utils.ObjectSizes;
@@ -56,7 +57,7 @@ public class ObjectSizeTest
     @Test
     public void testKeyCacheValueWithDelInfo()
     {
-        RowIndexEntry entry = RowIndexEntry.create(123, new DeletionTime(123, 123), null);
+        RowIndexEntry entry = RowIndexEntry.create(123, new DeletionTime(123, 123), ColumnIndex.nothing());
         long size = entry.memorySize();
         long size2 = meter.measureDeep(entry);
         Assert.assertEquals(size, size2);


Mime
View raw message