当前位置: 首页>>代码示例>>Java>>正文


Java IdentityQueryFilter类代码示例

本文整理汇总了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());
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:22,代码来源:ScrubTest.java

示例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());
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:22,代码来源:ScrubTest.java

示例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());
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:21,代码来源:ScrubTest.java

示例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());
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:21,代码来源:ScrubTest.java

示例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;
}
 
开发者ID:xedin,项目名称:sasi,代码行数:27,代码来源:SSTableAttachedSecondaryIndexTest.java

示例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());
}
 
开发者ID:dprguiuc,项目名称:Cassandra-Wasef,代码行数:21,代码来源:ScrubTest.java

示例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());
}
 
开发者ID:dprguiuc,项目名称:Cassandra-Wasef,代码行数:21,代码来源:ScrubTest.java

示例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());
}
 
开发者ID:mafernandez-stratio,项目名称:cassandra-cqlMod,代码行数:22,代码来源:ScrubTest.java

示例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());
}
 
开发者ID:mafernandez-stratio,项目名称:cassandra-cqlMod,代码行数:22,代码来源:ScrubTest.java

示例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());
}
 
开发者ID:wso2,项目名称:wso2-cassandra,代码行数:22,代码来源:ScrubTest.java

示例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());
}
 
开发者ID:wso2,项目名称:wso2-cassandra,代码行数:22,代码来源:ScrubTest.java

示例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());
}
 
开发者ID:devdattakulkarni,项目名称:Cassandra-KVPM,代码行数:21,代码来源:ScrubTest.java

示例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());
}
 
开发者ID:devdattakulkarni,项目名称:Cassandra-KVPM,代码行数:21,代码来源:ScrubTest.java

示例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());
}
 
开发者ID:devdattakulkarni,项目名称:Cassandra-KVPM,代码行数:23,代码来源:CleanupTest.java

示例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();
        }
    };
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:38,代码来源:QueryPagers.java


注:本文中的org.apache.cassandra.db.columniterator.IdentityQueryFilter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。