本文整理汇总了Java中org.apache.cassandra.db.columniterator.IdentityQueryFilter类的典型用法代码示例。如果您正苦于以下问题:Java IdentityQueryFilter类的具体用法?Java IdentityQueryFilter怎么用?Java IdentityQueryFilter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IdentityQueryFilter类属于org.apache.cassandra.db.columniterator包,在下文中一共展示了IdentityQueryFilter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testScrubOneRow
import org.apache.cassandra.db.columniterator.IdentityQueryFilter; //导入依赖的package包/类
@Test
public void testScrubOneRow() throws ExecutionException, InterruptedException
{
CompactionManager.instance.disableAutoCompaction();
Keyspace keyspace = Keyspace.open(KEYSPACE);
ColumnFamilyStore cfs = keyspace.getColumnFamilyStore(CF);
cfs.clearUnsafe();
List<Row> rows;
// insert data and verify we get it back w/ range query
fillCF(cfs, 1);
rows = cfs.getRangeSlice(Util.range("", ""), null, new IdentityQueryFilter(), 1000);
assertEquals(1, rows.size());
CompactionManager.instance.performScrub(cfs, false);
// check data is still there
rows = cfs.getRangeSlice(Util.range("", ""), null, new IdentityQueryFilter(), 1000);
assertEquals(1, rows.size());
}
示例2: testScrubMultiRow
import org.apache.cassandra.db.columniterator.IdentityQueryFilter; //导入依赖的package包/类
@Test
public void testScrubMultiRow() throws ExecutionException, InterruptedException
{
CompactionManager.instance.disableAutoCompaction();
Keyspace keyspace = Keyspace.open(KEYSPACE);
ColumnFamilyStore cfs = keyspace.getColumnFamilyStore(CF);
cfs.clearUnsafe();
List<Row> rows;
// insert data and verify we get it back w/ range query
fillCF(cfs, 10);
rows = cfs.getRangeSlice(Util.range("", ""), null, new IdentityQueryFilter(), 1000);
assertEquals(10, rows.size());
CompactionManager.instance.performScrub(cfs, false);
// check data is still there
rows = cfs.getRangeSlice(Util.range("", ""), null, new IdentityQueryFilter(), 1000);
assertEquals(10, rows.size());
}
示例3: testScrubOneRow
import org.apache.cassandra.db.columniterator.IdentityQueryFilter; //导入依赖的package包/类
@Test
public void testScrubOneRow() throws IOException, ExecutionException, InterruptedException, ConfigurationException
{
CompactionManager.instance.disableAutoCompaction();
Keyspace keyspace = Keyspace.open(KEYSPACE);
ColumnFamilyStore cfs = keyspace.getColumnFamilyStore(CF);
List<Row> rows;
// insert data and verify we get it back w/ range query
fillCF(cfs, 1);
rows = cfs.getRangeSlice(Util.range("", ""), null, new IdentityQueryFilter(), 1000);
assertEquals(1, rows.size());
CompactionManager.instance.performScrub(cfs);
// check data is still there
rows = cfs.getRangeSlice(Util.range("", ""), null, new IdentityQueryFilter(), 1000);
assertEquals(1, rows.size());
}
示例4: testScrubMultiRow
import org.apache.cassandra.db.columniterator.IdentityQueryFilter; //导入依赖的package包/类
@Test
public void testScrubMultiRow() throws IOException, ExecutionException, InterruptedException, ConfigurationException
{
CompactionManager.instance.disableAutoCompaction();
Keyspace keyspace = Keyspace.open(KEYSPACE);
ColumnFamilyStore cfs = keyspace.getColumnFamilyStore(CF);
List<Row> rows;
// insert data and verify we get it back w/ range query
fillCF(cfs, 10);
rows = cfs.getRangeSlice(Util.range("", ""), null, new IdentityQueryFilter(), 1000);
assertEquals(10, rows.size());
CompactionManager.instance.performScrub(cfs);
// check data is still there
rows = cfs.getRangeSlice(Util.range("", ""), null, new IdentityQueryFilter(), 1000);
assertEquals(10, rows.size());
}
示例5: getPaged
import org.apache.cassandra.db.columniterator.IdentityQueryFilter; //导入依赖的package包/类
private static Set<DecoratedKey> getPaged(ColumnFamilyStore store, int pageSize, IndexExpression... expressions)
{
List<Row> currentPage;
Set<DecoratedKey> uniqueKeys = new TreeSet<>();
DecoratedKey lastKey = null;
do
{
currentPage = getIndexed(store, new IdentityQueryFilter(), lastKey, pageSize, expressions);
if (currentPage == null)
break;
for (Row row : currentPage)
uniqueKeys.add(row.key);
Row lastRow = Iterators.getLast(currentPage.iterator(), null);
if (lastRow == null)
break;
lastKey = lastRow.key;
}
while (currentPage.size() == pageSize);
return uniqueKeys;
}
示例6: testScrubOneRow
import org.apache.cassandra.db.columniterator.IdentityQueryFilter; //导入依赖的package包/类
@Test
public void testScrubOneRow() throws IOException, ExecutionException, InterruptedException, ConfigurationException
{
CompactionManager.instance.disableAutoCompaction();
Table table = Table.open(TABLE);
ColumnFamilyStore cfs = table.getColumnFamilyStore(CF);
List<Row> rows;
// insert data and verify we get it back w/ range query
fillCF(cfs, 1);
rows = cfs.getRangeSlice(null, Util.range("", ""), 1000, new IdentityQueryFilter(), null);
assertEquals(1, rows.size());
CompactionManager.instance.performScrub(cfs);
// check data is still there
rows = cfs.getRangeSlice(null, Util.range("", ""), 1000, new IdentityQueryFilter(), null);
assertEquals(1, rows.size());
}
示例7: testScrubMultiRow
import org.apache.cassandra.db.columniterator.IdentityQueryFilter; //导入依赖的package包/类
@Test
public void testScrubMultiRow() throws IOException, ExecutionException, InterruptedException, ConfigurationException
{
CompactionManager.instance.disableAutoCompaction();
Table table = Table.open(TABLE);
ColumnFamilyStore cfs = table.getColumnFamilyStore(CF);
List<Row> rows;
// insert data and verify we get it back w/ range query
fillCF(cfs, 10);
rows = cfs.getRangeSlice(null, Util.range("", ""), 1000, new IdentityQueryFilter(), null);
assertEquals(10, rows.size());
CompactionManager.instance.performScrub(cfs);
// check data is still there
rows = cfs.getRangeSlice(null, Util.range("", ""), 1000, new IdentityQueryFilter(), null);
assertEquals(10, rows.size());
}
示例8: testScrubOneRow
import org.apache.cassandra.db.columniterator.IdentityQueryFilter; //导入依赖的package包/类
@Test
public void testScrubOneRow() throws IOException, ExecutionException, InterruptedException, ConfigurationException
{
CompactionManager.instance.disableAutoCompaction();
Keyspace keyspace = Keyspace.open(KEYSPACE);
ColumnFamilyStore cfs = keyspace.getColumnFamilyStore(CF);
cfs.clearUnsafe();
List<Row> rows;
// insert data and verify we get it back w/ range query
fillCF(cfs, 1);
rows = cfs.getRangeSlice(Util.range("", ""), null, new IdentityQueryFilter(), 1000);
assertEquals(1, rows.size());
CompactionManager.instance.performScrub(cfs);
// check data is still there
rows = cfs.getRangeSlice(Util.range("", ""), null, new IdentityQueryFilter(), 1000);
assertEquals(1, rows.size());
}
示例9: testScrubMultiRow
import org.apache.cassandra.db.columniterator.IdentityQueryFilter; //导入依赖的package包/类
@Test
public void testScrubMultiRow() throws IOException, ExecutionException, InterruptedException, ConfigurationException
{
CompactionManager.instance.disableAutoCompaction();
Keyspace keyspace = Keyspace.open(KEYSPACE);
ColumnFamilyStore cfs = keyspace.getColumnFamilyStore(CF);
cfs.clearUnsafe();
List<Row> rows;
// insert data and verify we get it back w/ range query
fillCF(cfs, 10);
rows = cfs.getRangeSlice(Util.range("", ""), null, new IdentityQueryFilter(), 1000);
assertEquals(10, rows.size());
CompactionManager.instance.performScrub(cfs);
// check data is still there
rows = cfs.getRangeSlice(Util.range("", ""), null, new IdentityQueryFilter(), 1000);
assertEquals(10, rows.size());
}
示例10: testScrubOneRow
import org.apache.cassandra.db.columniterator.IdentityQueryFilter; //导入依赖的package包/类
@Test
public void testScrubOneRow() throws IOException, ExecutionException, InterruptedException, ConfigurationException
{
CompactionManager.instance.disableAutoCompaction();
Table table = Table.open(TABLE);
ColumnFamilyStore cfs = table.getColumnFamilyStore(CF);
cfs.clearUnsafe();
List<Row> rows;
// insert data and verify we get it back w/ range query
fillCF(cfs, 1);
rows = cfs.getRangeSlice(null, Util.range("", ""), 1000, new IdentityQueryFilter(), null);
assertEquals(1, rows.size());
CompactionManager.instance.performScrub(cfs);
// check data is still there
rows = cfs.getRangeSlice(null, Util.range("", ""), 1000, new IdentityQueryFilter(), null);
assertEquals(1, rows.size());
}
示例11: testScrubMultiRow
import org.apache.cassandra.db.columniterator.IdentityQueryFilter; //导入依赖的package包/类
@Test
public void testScrubMultiRow() throws IOException, ExecutionException, InterruptedException, ConfigurationException
{
CompactionManager.instance.disableAutoCompaction();
Table table = Table.open(TABLE);
ColumnFamilyStore cfs = table.getColumnFamilyStore(CF);
cfs.clearUnsafe();
List<Row> rows;
// insert data and verify we get it back w/ range query
fillCF(cfs, 10);
rows = cfs.getRangeSlice(null, Util.range("", ""), 1000, new IdentityQueryFilter(), null);
assertEquals(10, rows.size());
CompactionManager.instance.performScrub(cfs);
// check data is still there
rows = cfs.getRangeSlice(null, Util.range("", ""), 1000, new IdentityQueryFilter(), null);
assertEquals(10, rows.size());
}
示例12: testScrubOneRow
import org.apache.cassandra.db.columniterator.IdentityQueryFilter; //导入依赖的package包/类
@Test
public void testScrubOneRow() throws IOException, ExecutionException, InterruptedException, ConfigurationException
{
CompactionManager.instance.disableAutoCompaction();
Table table = Table.open(TABLE);
ColumnFamilyStore cfs = table.getColumnFamilyStore(CF);
List<Row> rows;
// insert data and verify we get it back w/ range query
fillCF(cfs, 1);
rows = cfs.getRangeSlice(null, Util.range("", ""), 1000, new IdentityQueryFilter());
assertEquals(1, rows.size());
CompactionManager.instance.performScrub(cfs);
// check data is still there
rows = cfs.getRangeSlice(null, Util.range("", ""), 1000, new IdentityQueryFilter());
assertEquals(1, rows.size());
}
示例13: testScrubMultiRow
import org.apache.cassandra.db.columniterator.IdentityQueryFilter; //导入依赖的package包/类
@Test
public void testScrubMultiRow() throws IOException, ExecutionException, InterruptedException, ConfigurationException
{
CompactionManager.instance.disableAutoCompaction();
Table table = Table.open(TABLE);
ColumnFamilyStore cfs = table.getColumnFamilyStore(CF);
List<Row> rows;
// insert data and verify we get it back w/ range query
fillCF(cfs, 10);
rows = cfs.getRangeSlice(null, Util.range("", ""), 1000, new IdentityQueryFilter());
assertEquals(10, rows.size());
CompactionManager.instance.performScrub(cfs);
// check data is still there
rows = cfs.getRangeSlice(null, Util.range("", ""), 1000, new IdentityQueryFilter());
assertEquals(10, rows.size());
}
示例14: testCleanup
import org.apache.cassandra.db.columniterator.IdentityQueryFilter; //导入依赖的package包/类
@Test
public void testCleanup() throws IOException, ExecutionException, InterruptedException, ConfigurationException
{
StorageService.instance.initServer();
Table table = Table.open(TABLE1);
ColumnFamilyStore cfs = table.getColumnFamilyStore(CF2);
List<Row> rows;
// insert data and verify we get it back w/ range query
fillCF(cfs, LOOPS);
rows = cfs.getRangeSlice(null, Util.range("", ""), 1000, new IdentityQueryFilter());
assertEquals(LOOPS, rows.size());
// with one token in the ring, owned by the local node, cleanup should be a no-op
CompactionManager.instance.performCleanup(cfs, new NodeId.OneShotRenewer());
// check data is still there
rows = cfs.getRangeSlice(null, Util.range("", ""), 1000, new IdentityQueryFilter());
assertEquals(LOOPS, rows.size());
}
示例15: pageRowLocally
import org.apache.cassandra.db.columniterator.IdentityQueryFilter; //导入依赖的package包/类
/**
* Convenience method to (locally) page an internal row.
* Used to 2ndary index a wide row without dying.
*/
public static Iterator<ColumnFamily> pageRowLocally(final ColumnFamilyStore cfs, ByteBuffer key, final int pageSize)
{
SliceFromReadCommand command = new SliceFromReadCommand(cfs.metadata.ksName, key, cfs.name, System.currentTimeMillis(), new IdentityQueryFilter());
final SliceQueryPager pager = new SliceQueryPager(command, null, null, true);
return new Iterator<ColumnFamily>()
{
// We don't use AbstractIterator because we don't want hasNext() to do an actual query
public boolean hasNext()
{
return !pager.isExhausted();
}
public ColumnFamily next()
{
try
{
List<Row> rows = pager.fetchPage(pageSize);
ColumnFamily cf = rows.isEmpty() ? null : rows.get(0).cf;
return cf == null ? ArrayBackedSortedColumns.factory.create(cfs.metadata) : cf;
}
catch (Exception e)
{
throw new RuntimeException(e);
}
}
public void remove()
{
throw new UnsupportedOperationException();
}
};
}