You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by br...@apache.org on 2013/10/30 22:12:42 UTC
[1/4] git commit: fix sstr test
Updated Branches:
refs/heads/cassandra-2.0 830711c72 -> 47b8fc422
refs/heads/trunk 3d00fe6cd -> ddb8bc68a
fix sstr test
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/47b8fc42
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/47b8fc42
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/47b8fc42
Branch: refs/heads/cassandra-2.0
Commit: 47b8fc422f3978c7173c91e7324953d81e5f5b63
Parents: 830711c
Author: Brandon Williams <br...@apache.org>
Authored: Wed Oct 30 16:10:26 2013 -0500
Committer: Brandon Williams <br...@apache.org>
Committed: Wed Oct 30 16:10:26 2013 -0500
----------------------------------------------------------------------
.../org/apache/cassandra/io/sstable/SSTableReaderTest.java | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/47b8fc42/test/unit/org/apache/cassandra/io/sstable/SSTableReaderTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/io/sstable/SSTableReaderTest.java b/test/unit/org/apache/cassandra/io/sstable/SSTableReaderTest.java
index 8a9619d..427d089 100644
--- a/test/unit/org/apache/cassandra/io/sstable/SSTableReaderTest.java
+++ b/test/unit/org/apache/cassandra/io/sstable/SSTableReaderTest.java
@@ -305,12 +305,13 @@ public class SSTableReaderTest extends SchemaLoader
foundScanner = true;
}
assertTrue(foundScanner);
+ }
@Test
public void testGetPositionsForRangesFromTableOpenedForBulkLoading() throws IOException, ExecutionException, InterruptedException
{
- Table table = Table.open("Keyspace1");
- ColumnFamilyStore store = table.getColumnFamilyStore("Standard2");
+ Keyspace keyspace = Keyspace.open("Keyspace1");
+ ColumnFamilyStore store = keyspace.getColumnFamilyStore("Standard2");
// insert data and compact to a single sstable. The
// number of keys inserted is greater than index_interval
@@ -320,7 +321,7 @@ public class SSTableReaderTest extends SchemaLoader
{
ByteBuffer key = ByteBufferUtil.bytes(String.valueOf(j));
RowMutation rm = new RowMutation("Keyspace1", key);
- rm.add(new QueryPath("Standard2", null, ByteBufferUtil.bytes("0")), ByteBufferUtil.EMPTY_BYTE_BUFFER, j);
+ rm.add("Standard2", ByteBufferUtil.bytes("0"), ByteBufferUtil.EMPTY_BYTE_BUFFER, j);
rm.apply();
}
store.forceBlockingFlush();
@@ -337,7 +338,7 @@ public class SSTableReaderTest extends SchemaLoader
// re-open the same sstable as it would be during bulk loading
Set<Component> components = Sets.newHashSet(Component.DATA, Component.PRIMARY_INDEX);
- SSTableReader bulkLoaded = SSTableReader.openForBatch(sstable.descriptor, components, sstable.partitioner);
+ SSTableReader bulkLoaded = SSTableReader.openForBatch(sstable.descriptor, components, store.metadata, sstable.partitioner);
sections = bulkLoaded.getPositionsForRanges(ranges);
assert sections.size() == 1 : "Expected to find range in sstable opened for bulk loading";
}
[2/4] git commit: fix sstr test
Posted by br...@apache.org.
fix sstr test
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/47b8fc42
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/47b8fc42
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/47b8fc42
Branch: refs/heads/trunk
Commit: 47b8fc422f3978c7173c91e7324953d81e5f5b63
Parents: 830711c
Author: Brandon Williams <br...@apache.org>
Authored: Wed Oct 30 16:10:26 2013 -0500
Committer: Brandon Williams <br...@apache.org>
Committed: Wed Oct 30 16:10:26 2013 -0500
----------------------------------------------------------------------
.../org/apache/cassandra/io/sstable/SSTableReaderTest.java | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/47b8fc42/test/unit/org/apache/cassandra/io/sstable/SSTableReaderTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/io/sstable/SSTableReaderTest.java b/test/unit/org/apache/cassandra/io/sstable/SSTableReaderTest.java
index 8a9619d..427d089 100644
--- a/test/unit/org/apache/cassandra/io/sstable/SSTableReaderTest.java
+++ b/test/unit/org/apache/cassandra/io/sstable/SSTableReaderTest.java
@@ -305,12 +305,13 @@ public class SSTableReaderTest extends SchemaLoader
foundScanner = true;
}
assertTrue(foundScanner);
+ }
@Test
public void testGetPositionsForRangesFromTableOpenedForBulkLoading() throws IOException, ExecutionException, InterruptedException
{
- Table table = Table.open("Keyspace1");
- ColumnFamilyStore store = table.getColumnFamilyStore("Standard2");
+ Keyspace keyspace = Keyspace.open("Keyspace1");
+ ColumnFamilyStore store = keyspace.getColumnFamilyStore("Standard2");
// insert data and compact to a single sstable. The
// number of keys inserted is greater than index_interval
@@ -320,7 +321,7 @@ public class SSTableReaderTest extends SchemaLoader
{
ByteBuffer key = ByteBufferUtil.bytes(String.valueOf(j));
RowMutation rm = new RowMutation("Keyspace1", key);
- rm.add(new QueryPath("Standard2", null, ByteBufferUtil.bytes("0")), ByteBufferUtil.EMPTY_BYTE_BUFFER, j);
+ rm.add("Standard2", ByteBufferUtil.bytes("0"), ByteBufferUtil.EMPTY_BYTE_BUFFER, j);
rm.apply();
}
store.forceBlockingFlush();
@@ -337,7 +338,7 @@ public class SSTableReaderTest extends SchemaLoader
// re-open the same sstable as it would be during bulk loading
Set<Component> components = Sets.newHashSet(Component.DATA, Component.PRIMARY_INDEX);
- SSTableReader bulkLoaded = SSTableReader.openForBatch(sstable.descriptor, components, sstable.partitioner);
+ SSTableReader bulkLoaded = SSTableReader.openForBatch(sstable.descriptor, components, store.metadata, sstable.partitioner);
sections = bulkLoaded.getPositionsForRanges(ranges);
assert sections.size() == 1 : "Expected to find range in sstable opened for bulk loading";
}
[3/4] git commit: Merge branch 'cassandra-2.0' into trunk
Posted by br...@apache.org.
Merge branch 'cassandra-2.0' into trunk
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/8c03c83e
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/8c03c83e
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/8c03c83e
Branch: refs/heads/trunk
Commit: 8c03c83edf3d5b1ca54739bd7c9981d25659ec1c
Parents: 3d00fe6 47b8fc4
Author: Brandon Williams <br...@apache.org>
Authored: Wed Oct 30 16:10:38 2013 -0500
Committer: Brandon Williams <br...@apache.org>
Committed: Wed Oct 30 16:10:38 2013 -0500
----------------------------------------------------------------------
----------------------------------------------------------------------
[4/4] git commit: fix sstr test
Posted by br...@apache.org.
fix sstr test
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/ddb8bc68
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/ddb8bc68
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/ddb8bc68
Branch: refs/heads/trunk
Commit: ddb8bc68a9e6198c6eb5d49afdaff2bdc57a1ede
Parents: 8c03c83
Author: Brandon Williams <br...@apache.org>
Authored: Wed Oct 30 16:11:06 2013 -0500
Committer: Brandon Williams <br...@apache.org>
Committed: Wed Oct 30 16:11:06 2013 -0500
----------------------------------------------------------------------
.../cassandra/io/sstable/SSTableReaderTest.java | 36 ++++++++++++++++++++
1 file changed, 36 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/ddb8bc68/test/unit/org/apache/cassandra/io/sstable/SSTableReaderTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/io/sstable/SSTableReaderTest.java b/test/unit/org/apache/cassandra/io/sstable/SSTableReaderTest.java
index 8c0d908..36d8fbe 100644
--- a/test/unit/org/apache/cassandra/io/sstable/SSTableReaderTest.java
+++ b/test/unit/org/apache/cassandra/io/sstable/SSTableReaderTest.java
@@ -305,6 +305,42 @@ public class SSTableReaderTest extends SchemaLoader
assertTrue(foundScanner);
}
+ @Test
+ public void testGetPositionsForRangesFromTableOpenedForBulkLoading() throws IOException, ExecutionException, InterruptedException
+ {
+ Keyspace keyspace = Keyspace.open("Keyspace1");
+ ColumnFamilyStore store = keyspace.getColumnFamilyStore("Standard2");
+
+ // insert data and compact to a single sstable. The
+ // number of keys inserted is greater than index_interval
+ // to ensure multiple segments in the index file
+ CompactionManager.instance.disableAutoCompaction();
+ for (int j = 0; j < 130; j++)
+ {
+ ByteBuffer key = ByteBufferUtil.bytes(String.valueOf(j));
+ RowMutation rm = new RowMutation("Keyspace1", key);
+ rm.add("Standard2", ByteBufferUtil.bytes("0"), ByteBufferUtil.EMPTY_BYTE_BUFFER, j);
+ rm.apply();
+ }
+ store.forceBlockingFlush();
+ CompactionManager.instance.performMaximal(store);
+
+ // construct a range which is present in the sstable, but whose
+ // keys are not found in the first segment of the index.
+ List<Range<Token>> ranges = new ArrayList<Range<Token>>();
+ ranges.add(new Range<Token>(t(98), t(99)));
+
+ SSTableReader sstable = store.getSSTables().iterator().next();
+ List<Pair<Long,Long>> sections = sstable.getPositionsForRanges(ranges);
+ assert sections.size() == 1 : "Expected to find range in sstable" ;
+
+ // re-open the same sstable as it would be during bulk loading
+ Set<Component> components = Sets.newHashSet(Component.DATA, Component.PRIMARY_INDEX);
+ SSTableReader bulkLoaded = SSTableReader.openForBatch(sstable.descriptor, components, store.metadata, sstable.partitioner);
+ sections = bulkLoaded.getPositionsForRanges(ranges);
+ assert sections.size() == 1 : "Expected to find range in sstable opened for bulk loading";
+ }
+
private void assertIndexQueryWorks(ColumnFamilyStore indexedCFS) throws IOException
{
assert "Indexed1".equals(indexedCFS.name);