Merge branch 'cassandra-3.0' into cassandra-3.11

This commit is contained in:
Aleksey Yeschenko 2017-08-30 18:05:09 +01:00
commit 02e9846f1a
3 changed files with 6 additions and 19 deletions

View File

@ -308,19 +308,6 @@ public abstract class ReadCommand extends MonitorableImpl implements ReadQuery
return index;
}
/**
* Index instance chosen for this query. Can be null.
*
* @return Index instance chosen for this query. Can be null.
*/
@Nullable
public Index index()
{
return null == index
? null
: Keyspace.openAndGetStore(metadata).indexManager.getIndex(index);
}
/**
* The clustering index filter this command to use for the provided key.
* <p>

View File

@ -115,7 +115,7 @@ public class SecondaryIndexTest
.filterOn("birthdate", Operator.EQ, 1L)
.build();
Index.Searcher searcher = rc.index().searcherFor(rc);
Index.Searcher searcher = rc.getIndex(cfs).searcherFor(rc);
try (ReadExecutionController executionController = rc.executionController();
UnfilteredPartitionIterator pi = searcher.search(executionController))
{
@ -202,7 +202,7 @@ public class SecondaryIndexTest
// verify that it's not being indexed under any other value either
ReadCommand rc = Util.cmd(cfs).build();
assertNull(rc.index());
assertNull(rc.getIndex(cfs));
// resurrect w/ a newer timestamp
new RowUpdateBuilder(cfs.metadata, 2, "k1").clustering("c").add("birthdate", 1L).build().apply();;
@ -220,13 +220,13 @@ public class SecondaryIndexTest
// todo - checking the # of index searchers for the command is probably not the best thing to test here
RowUpdateBuilder.deleteRow(cfs.metadata, 3, "k1", "c").applyUnsafe();
rc = Util.cmd(cfs).build();
assertNull(rc.index());
assertNull(rc.getIndex(cfs));
// make sure obsolete mutations don't generate an index entry
// todo - checking the # of index searchers for the command is probably not the best thing to test here
new RowUpdateBuilder(cfs.metadata, 3, "k1").clustering("c").add("birthdate", 1L).build().apply();;
rc = Util.cmd(cfs).build();
assertNull(rc.index());
assertNull(rc.getIndex(cfs));
}
@Test
@ -523,7 +523,7 @@ public class SecondaryIndexTest
ColumnDefinition cdef = cfs.metadata.getColumnDefinition(col);
ReadCommand rc = Util.cmd(cfs).filterOn(cdef.name.toString(), Operator.EQ, ((AbstractType) cdef.cellValueType()).decompose(val)).build();
Index.Searcher searcher = rc.index().searcherFor(rc);
Index.Searcher searcher = rc.getIndex(cfs).searcherFor(rc);
if (count != 0)
assertNotNull(searcher);

View File

@ -595,7 +595,7 @@ public class SSTableReaderTest
.columns("birthdate")
.filterOn("birthdate", Operator.EQ, 1L)
.build();
Index.Searcher searcher = rc.index().searcherFor(rc);
Index.Searcher searcher = rc.getIndex(indexedCFS).searcherFor(rc);
assertNotNull(searcher);
try (ReadExecutionController executionController = rc.executionController())
{