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


Java QueryFilter.getSliceFilter方法代码示例

本文整理汇总了Java中org.apache.cassandra.db.filter.QueryFilter.getSliceFilter方法的典型用法代码示例。如果您正苦于以下问题:Java QueryFilter.getSliceFilter方法的具体用法?Java QueryFilter.getSliceFilter怎么用?Java QueryFilter.getSliceFilter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.cassandra.db.filter.QueryFilter的用法示例。


在下文中一共展示了QueryFilter.getSliceFilter方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getCurrentLocalCounterId

import org.apache.cassandra.db.filter.QueryFilter; //导入方法依赖的package包/类
/**
 * Read the current local node id from the system keyspace or null if no
 * such node id is recorded.
 */
public static CounterId getCurrentLocalCounterId()
{
    Keyspace keyspace = Keyspace.open(Keyspace.SYSTEM_KS);

    // Get the last CounterId (since CounterId are timeuuid is thus ordered from the older to the newer one)
    QueryFilter filter = QueryFilter.getSliceFilter(decorate(ALL_LOCAL_NODE_ID_KEY),
                                                    COUNTER_ID_CF,
                                                    ByteBufferUtil.EMPTY_BYTE_BUFFER,
                                                    ByteBufferUtil.EMPTY_BYTE_BUFFER,
                                                    true,
                                                    1,
                                                    System.currentTimeMillis());
    ColumnFamily cf = keyspace.getColumnFamilyStore(COUNTER_ID_CF).getColumnFamily(filter);
    if (cf != null && cf.getColumnCount() != 0)
        return CounterId.wrap(cf.iterator().next().name());
    else
        return null;
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:23,代码来源:SystemKeyspace.java

示例2: getCurrentLocalCounterId

import org.apache.cassandra.db.filter.QueryFilter; //导入方法依赖的package包/类
/**
 * Read the current local node id from the system table or null if no
 * such node id is recorded.
 */
public static CounterId getCurrentLocalCounterId()
{
    Table table = Table.open(Table.SYSTEM_KS);

    // Get the last CounterId (since CounterId are timeuuid is thus ordered from the older to the newer one)
    QueryFilter filter = QueryFilter.getSliceFilter(decorate(ALL_LOCAL_NODE_ID_KEY),
                                                    new QueryPath(COUNTER_ID_CF),
                                                    ByteBufferUtil.EMPTY_BYTE_BUFFER,
                                                    ByteBufferUtil.EMPTY_BYTE_BUFFER,
                                                    true,
                                                    1);
    ColumnFamily cf = table.getColumnFamilyStore(COUNTER_ID_CF).getColumnFamily(filter);
    if (cf != null && cf.getColumnCount() != 0)
        return CounterId.wrap(cf.iterator().next().name());
    else
        return null;
}
 
开发者ID:dprguiuc,项目名称:Cassandra-Wasef,代码行数:22,代码来源:SystemTable.java

示例3: getCurrentLocalCounterId

import org.apache.cassandra.db.filter.QueryFilter; //导入方法依赖的package包/类
/**
 * Read the current local node id from the system keyspace or null if no
 * such node id is recorded.
 */
public static CounterId getCurrentLocalCounterId()
{
    Keyspace keyspace = Keyspace.open(Keyspace.SYSTEM_KS);

    // Get the last CounterId (since CounterId are timeuuid is thus ordered from the older to the newer one)
    QueryFilter filter = QueryFilter.getSliceFilter(decorate(ALL_LOCAL_NODE_ID_KEY),
                                                    COUNTER_ID_CF,
                                                    Composites.EMPTY,
                                                    Composites.EMPTY,
                                                    true,
                                                    1,
                                                    System.currentTimeMillis());
    ColumnFamily cf = keyspace.getColumnFamilyStore(COUNTER_ID_CF).getColumnFamily(filter);
    if (cf != null && cf.getColumnCount() != 0)
        return CounterId.wrap(cf.iterator().next().name().toByteBuffer());
    else
        return null;
}
 
开发者ID:mafernandez-stratio,项目名称:cassandra-cqlMod,代码行数:23,代码来源:SystemKeyspace.java

示例4: getCurrentLocalCounterId

import org.apache.cassandra.db.filter.QueryFilter; //导入方法依赖的package包/类
/**
 * Read the current local node id from the system keyspace or null if no
 * such node id is recorded.
 */
public static CounterId getCurrentLocalCounterId()
{
    Keyspace keyspace = Keyspace.open(Keyspace.SYSTEM_KS);

    // Get the last CounterId (since CounterId are timeuuid is thus ordered from the older to the newer one)
    QueryFilter filter = QueryFilter.getSliceFilter(decorate(ALL_LOCAL_NODE_ID_KEY),
                                                    COUNTER_ID_CF,
                                                    Composites.EMPTY,
                                                    Composites.EMPTY,
                                                    true,
                                                    1,
                                                    System.currentTimeMillis());
    ColumnFamily cf = keyspace.getColumnFamilyStore(COUNTER_ID_CF).getColumnFamily(filter);
    if (cf != null && cf.hasColumns())
        return CounterId.wrap(cf.iterator().next().name().toByteBuffer());
    else
        return null;
}
 
开发者ID:rajath26,项目名称:cassandra-trunk,代码行数:23,代码来源:SystemKeyspace.java

示例5: testEmptyRow

import org.apache.cassandra.db.filter.QueryFilter; //导入方法依赖的package包/类
@Test
public void testEmptyRow() throws Exception
{
    Keyspace keyspace = Keyspace.open("Keyspace1");
    final ColumnFamilyStore store = keyspace.getColumnFamilyStore("Standard2");
    Mutation rm;

    rm = new Mutation("Keyspace1", ByteBufferUtil.bytes("key1"));
    rm.delete("Standard2", System.currentTimeMillis());
    rm.apply();

    Runnable r = new WrappedRunnable()
    {
        public void runMayThrow() throws IOException
        {
            QueryFilter sliceFilter = QueryFilter.getSliceFilter(Util.dk("key1"), "Standard2", Composites.EMPTY, Composites.EMPTY, false, 1, System.currentTimeMillis());
            ColumnFamily cf = store.getColumnFamily(sliceFilter);
            assertTrue(cf.isMarkedForDelete());
            assertFalse(cf.hasColumns());

            QueryFilter namesFilter = Util.namesQueryFilter(store, Util.dk("key1"), "a");
            cf = store.getColumnFamily(namesFilter);
            assertTrue(cf.isMarkedForDelete());
            assertFalse(cf.hasColumns());
        }
    };

    KeyspaceTest.reTest(store, r);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:30,代码来源:ColumnFamilyStoreTest.java

示例6: testEmptyRow

import org.apache.cassandra.db.filter.QueryFilter; //导入方法依赖的package包/类
@Test
public void testEmptyRow() throws Exception
{
    Keyspace keyspace = Keyspace.open(KEYSPACE1);
    final ColumnFamilyStore store = keyspace.getColumnFamilyStore(CF_STANDARD2);
    Mutation rm;

    rm = new Mutation(KEYSPACE1, ByteBufferUtil.bytes("key1"));
    rm.delete(CF_STANDARD2, System.currentTimeMillis());
    rm.applyUnsafe();

    Runnable r = new WrappedRunnable()
    {
        public void runMayThrow() throws IOException
        {
            QueryFilter sliceFilter = QueryFilter.getSliceFilter(Util.dk("key1"), CF_STANDARD2, Composites.EMPTY, Composites.EMPTY, false, 1, System.currentTimeMillis());
            ColumnFamily cf = store.getColumnFamily(sliceFilter);
            assertTrue(cf.isMarkedForDelete());
            assertFalse(cf.hasColumns());

            QueryFilter namesFilter = Util.namesQueryFilter(store, Util.dk("key1"), "a");
            cf = store.getColumnFamily(namesFilter);
            assertTrue(cf.isMarkedForDelete());
            assertFalse(cf.hasColumns());
        }
    };

    KeyspaceTest.reTest(store, r);
}
 
开发者ID:daidong,项目名称:GraphTrek,代码行数:30,代码来源:ColumnFamilyStoreTest.java

示例7: localStorageQuery

import org.apache.cassandra.db.filter.QueryFilter; //导入方法依赖的package包/类
private ColumnFamily localStorageQuery(String target, String dataTag){
	Table table = Table.open(Metadata.MetaData_KS);
	QueryFilter filter = QueryFilter.getSliceFilter(
			StorageService.getPartitioner().decorateKey(ByteBufferUtil.bytes(target)),
			new QueryPath(Metadata.MetadataRegistry_CF),
			Column.decomposeName(dataTag, "admin_tag"),
			Column.decomposeName(dataTag, "admin_tag"),
			false,
			Integer.MAX_VALUE);
	
	return table.getColumnFamilyStore(Metadata.MetadataRegistry_CF).getColumnFamily(filter);
}
 
开发者ID:dprguiuc,项目名称:Cassandra-Wasef,代码行数:13,代码来源:MetadataRegistry.java


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