• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ExtendedFilter类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



ExtendedFilter类属于org.apache.cassandra.db.filter包,在下文中一共展示了ExtendedFilter类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: makeExtendedFilter

import org.apache.cassandra.db.filter.ExtendedFilter; //导入依赖的package包/类
public ExtendedFilter makeExtendedFilter(AbstractBounds<RowPosition> range,
                                         IDiskAtomFilter columnFilter,
                                         List<IndexExpression> rowFilter,
                                         int maxResults,
                                         boolean countCQL3Rows,
                                         boolean isPaging,
                                         long timestamp)
{
    DataRange dataRange;
    if (isPaging)
    {
        assert columnFilter instanceof SliceQueryFilter;
        SliceQueryFilter sfilter = (SliceQueryFilter)columnFilter;
        assert sfilter.slices.length == 1;
        // create a new SliceQueryFilter that selects all cells, but pass the original slice start and finish
        // through to DataRange.Paging to be used on the first and last partitions
        SliceQueryFilter newFilter = new SliceQueryFilter(ColumnSlice.ALL_COLUMNS_ARRAY, sfilter.isReversed(), sfilter.count);
        dataRange = new DataRange.Paging(range, newFilter, sfilter.start(), sfilter.finish(), metadata.comparator);
    }
    else
    {
        dataRange = new DataRange(range, columnFilter);
    }
    return ExtendedFilter.create(this, dataRange, rowFilter, maxResults, countCQL3Rows, timestamp);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:26,代码来源:ColumnFamilyStore.java


示例2: makePrefix

import org.apache.cassandra.db.filter.ExtendedFilter; //导入依赖的package包/类
private Composite makePrefix(CompositesIndex index, ByteBuffer key, ExtendedFilter filter, boolean isStart)
{
    if (key.remaining() == 0)
        return Composites.EMPTY;

    Composite prefix;
    IDiskAtomFilter columnFilter = filter.columnFilter(key);
    if (columnFilter instanceof SliceQueryFilter)
    {
        SliceQueryFilter sqf = (SliceQueryFilter)columnFilter;
        Composite columnName = isStart ? sqf.start() : sqf.finish();
        prefix = columnName.isEmpty() ? index.getIndexComparator().make(key) : index.makeIndexColumnPrefix(key, columnName);
    }
    else
    {
        prefix = index.getIndexComparator().make(key);
    }
    return isStart ? prefix.start() : prefix.end();
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:20,代码来源:CompositesSearcher.java


示例3: search

import org.apache.cassandra.db.filter.ExtendedFilter; //导入依赖的package包/类
/**
 * Performs a search across a number of column indexes
 *
 * @param filter the column range to restrict to
 * @return found indexed rows
 */
public List<Row> search(ExtendedFilter filter)
{
    List<SecondaryIndexSearcher> indexSearchers = getIndexSearchersForQuery(filter.getClause());

    if (indexSearchers.isEmpty())
        return Collections.emptyList();

    SecondaryIndexSearcher mostSelective = null;
    long bestEstimate = Long.MAX_VALUE;
    for (SecondaryIndexSearcher searcher : indexSearchers)
    {
        SecondaryIndex highestSelectivityIndex = searcher.highestSelectivityIndex(filter.getClause());
        long estimate = highestSelectivityIndex.estimateResultRows();
        if (estimate <= bestEstimate)
        {
            bestEstimate = estimate;
            mostSelective = searcher;
        }
    }

    return mostSelective.search(filter);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:29,代码来源:SecondaryIndexManager.java


示例4: createSecondaryIndexSearcher

import org.apache.cassandra.db.filter.ExtendedFilter; //导入依赖的package包/类
@Override
protected SecondaryIndexSearcher createSecondaryIndexSearcher(Set<ByteBuffer> columns)
{
    return new SecondaryIndexSearcher(baseCfs.indexManager, columns)
    {
        
        @Override
        public List<Row> search(ExtendedFilter filter)
        {
            return Arrays.asList(new Row(LAST_INDEXED_KEY, LAST_INDEXED_ROW));
        }

        @Override
        public void validate(IndexExpression indexExpression) throws InvalidRequestException
        {
            if (indexExpression.value.equals(ByteBufferUtil.bytes("invalid")))
                throw new InvalidRequestException("Invalid search!");
        }
        
    };
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:22,代码来源:PerRowSecondaryIndexTest.java


示例5: getRow

import org.apache.cassandra.db.filter.ExtendedFilter; //导入依赖的package包/类
private Row getRow(DecoratedKey key, ExtendedFilter filter)
{
    try
    {
        ColumnFamilyStore store = backend.getBaseCfs();
        ReadCommand cmd = ReadCommand.create(store.metadata.ksName,
                                             key.key,
                                             store.metadata.cfName,
                                             System.currentTimeMillis(),
                                             filter.columnFilter(key.key));

        return cmd.getRow(store.keyspace);
    }
    finally
    {
        controller.checkpoint();
    }
}
 
开发者ID:xedin,项目名称:sasi,代码行数:19,代码来源:QueryPlan.java


示例6: getIndexed

import org.apache.cassandra.db.filter.ExtendedFilter; //导入依赖的package包/类
private static List<Row> getIndexed(ColumnFamilyStore store, IDiskAtomFilter columnFilter, DecoratedKey startKey, int maxResults, IndexExpression... expressions)
{
    IPartitioner p = StorageService.getPartitioner();
    AbstractBounds<RowPosition> bounds;

    if (startKey == null)
    {
        bounds = new Range<>(p.getMinimumToken(), p.getMinimumToken()).toRowBounds();
    }
    else
    {
        bounds = new Bounds<>(startKey, p.getMinimumToken().maxKeyBound(p));
    }

    return store.indexManager.search(ExtendedFilter.create(store,
                                     new DataRange(bounds, columnFilter),
                                     Arrays.asList(expressions),
                                     maxResults,
                                     false,
                                     System.currentTimeMillis()));
}
 
开发者ID:xedin,项目名称:sasi,代码行数:22,代码来源:SSTableAttachedSecondaryIndexTest.java


示例7: makeExtendedFilter

import org.apache.cassandra.db.filter.ExtendedFilter; //导入依赖的package包/类
public ExtendedFilter makeExtendedFilter(AbstractBounds<RowPosition> range,
                                         IDiskAtomFilter columnFilter,
                                         List<IndexExpression> rowFilter,
                                         int maxResults,
                                         boolean countCQL3Rows,
                                         boolean isPaging,
                                         long timestamp)
{
    DataRange dataRange;
    if (isPaging)
    {
        assert columnFilter instanceof SliceQueryFilter;
        SliceQueryFilter sfilter = (SliceQueryFilter)columnFilter;
        assert sfilter.slices.length == 1;
        SliceQueryFilter newFilter = new SliceQueryFilter(ColumnSlice.ALL_COLUMNS_ARRAY, sfilter.isReversed(), sfilter.count);
        dataRange = new DataRange.Paging(range, newFilter, sfilter.start(), sfilter.finish(), metadata.comparator);
    }
    else
    {
        dataRange = new DataRange(range, columnFilter);
    }
    return ExtendedFilter.create(this, dataRange, rowFilter, maxResults, countCQL3Rows, timestamp);
}
 
开发者ID:daidong,项目名称:GraphTrek,代码行数:24,代码来源:ColumnFamilyStore.java


示例8: makePrefix

import org.apache.cassandra.db.filter.ExtendedFilter; //导入依赖的package包/类
private Composite makePrefix(CompositesIndex index, ByteBuffer key, ExtendedFilter filter, boolean isStart)
{
    if (key.remaining() == 0)
        return Composites.EMPTY;

    Composite prefix;
    IDiskAtomFilter columnFilter = filter.columnFilter(key);
    if (columnFilter instanceof SliceQueryFilter)
    {
        SliceQueryFilter sqf = (SliceQueryFilter)columnFilter;
        prefix = index.makeIndexColumnPrefix(key, isStart ? sqf.start() : sqf.finish());
    }
    else
    {
        prefix = index.getIndexComparator().make(key);
    }
    return isStart ? prefix.start() : prefix.end();
}
 
开发者ID:mafernandez-stratio,项目名称:cassandra-cqlMod,代码行数:19,代码来源:CompositesSearcher.java


示例9: executeLocally

import org.apache.cassandra.db.filter.ExtendedFilter; //导入依赖的package包/类
public List<Row> executeLocally()
{
    ColumnFamilyStore cfs = Keyspace.open(keyspace).getColumnFamilyStore(columnFamily);

    ExtendedFilter exFilter = cfs.makeExtendedFilter(keyRange, predicate, rowFilter, maxResults, countCQL3Rows, isPaging, timestamp);
    if (cfs.indexManager.hasIndexFor(rowFilter))
        return cfs.search(exFilter);
    else
        return cfs.getRangeSlice(exFilter);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:11,代码来源:RangeSliceCommand.java


示例10: getRangeSlice

import org.apache.cassandra.db.filter.ExtendedFilter; //导入依赖的package包/类
public List<Row> getRangeSlice(ExtendedFilter filter)
{
    long start = System.nanoTime();
    try (OpOrder.Group op = readOrdering.start())
    {
        return filter(getSequentialIterator(filter.dataRange, filter.timestamp), filter);
    }
    finally
    {
        metric.rangeLatency.addNano(System.nanoTime() - start);
    }
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:13,代码来源:ColumnFamilyStore.java


示例11: search

import org.apache.cassandra.db.filter.ExtendedFilter; //导入依赖的package包/类
@Override
public List<Row> search(ExtendedFilter filter)
{
    assert filter.getClause() != null && !filter.getClause().isEmpty();
    final IndexExpression primary = highestSelectivityPredicate(filter.getClause());
    final CompositesIndex index = (CompositesIndex)indexManager.getIndexForColumn(primary.column);
    // TODO: this should perhaps not open and maintain a writeOp for the full duration, but instead only *try* to delete stale entries, without blocking if there's no room
    // as it stands, we open a writeOp and keep it open for the duration to ensure that should this CF get flushed to make room we don't block the reclamation of any room being made
    try (OpOrder.Group writeOp = baseCfs.keyspace.writeOrder.start(); OpOrder.Group baseOp = baseCfs.readOrdering.start(); OpOrder.Group indexOp = index.getIndexCfs().readOrdering.start())
    {
        return baseCfs.filter(getIndexedIterator(writeOp, filter, primary, index), filter);
    }
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:14,代码来源:CompositesSearcher.java


示例12: search

import org.apache.cassandra.db.filter.ExtendedFilter; //导入依赖的package包/类
@Override
public List<Row> search(ExtendedFilter filter)
{
    assert filter.getClause() != null && !filter.getClause().isEmpty();
    final IndexExpression primary = highestSelectivityPredicate(filter.getClause());
    final SecondaryIndex index = indexManager.getIndexForColumn(primary.column);
    // TODO: this should perhaps not open and maintain a writeOp for the full duration, but instead only *try* to delete stale entries, without blocking if there's no room
    // as it stands, we open a writeOp and keep it open for the duration to ensure that should this CF get flushed to make room we don't block the reclamation of any room  being made
    try (OpOrder.Group writeOp = baseCfs.keyspace.writeOrder.start(); OpOrder.Group baseOp = baseCfs.readOrdering.start(); OpOrder.Group indexOp = index.getIndexCfs().readOrdering.start())
    {
        return baseCfs.filter(getIndexedIterator(writeOp, filter, primary, index), filter);
    }
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:14,代码来源:KeysSearcher.java


示例13: search

import org.apache.cassandra.db.filter.ExtendedFilter; //导入依赖的package包/类
/**
 * Performs a search across a number of column indexes
 * TODO: add support for querying across index types
 *
 * @param filter the column range to restrict to
 * @return found indexed rows
 */
public List<Row> search(ExtendedFilter filter)
{
    List<SecondaryIndexSearcher> indexSearchers = getIndexSearchersForQuery(filter.getClause());

    if (indexSearchers.isEmpty())
        return Collections.emptyList();

    //We currently don't support searching across multiple index types
    if (indexSearchers.size() > 1)
        throw new RuntimeException("Unable to search across multiple secondary index types");

    return indexSearchers.get(0).search(filter);
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:21,代码来源:SecondaryIndexManager.java


示例14: search

import org.apache.cassandra.db.filter.ExtendedFilter; //导入依赖的package包/类
public List<Row> search(ExtendedFilter filter)
{
    metrics.markRequest();

    long startTime = System.nanoTime();

    try
    {
        return filter != null && !filter.getClause().isEmpty()
                ? new QueryPlan(SSTableAttachedSecondaryIndex.this, filter, DatabaseDescriptor.getRangeRpcTimeout()).execute()
                : Collections.<Row>emptyList();
    }
    catch (Exception e)
    {
        metrics.markFailure();

        if (e instanceof TimeQuotaExceededException)
            metrics.markTimeout();
        else
            logger.warn("error occurred while searching SASI indexes; ignoring", e);

        return Collections.emptyList();
    }
    finally
    {
        metrics.updateLatency(System.nanoTime() - startTime, TimeUnit.NANOSECONDS);
    }
}
 
开发者ID:xedin,项目名称:sasi,代码行数:29,代码来源:SSTableAttachedSecondaryIndex.java


示例15: QueryController

import org.apache.cassandra.db.filter.ExtendedFilter; //导入依赖的package包/类
public QueryController(SSTableAttachedSecondaryIndex backend, ExtendedFilter filter, long timeQuotaMs)
{
    this.backend = backend;
    this.executionQuota = TimeUnit.MILLISECONDS.toNanos(timeQuotaMs);
    this.executionStart = System.nanoTime();
    this.scope = getSSTableScope(backend.getBaseCfs(), filter);
}
 
开发者ID:xedin,项目名称:sasi,代码行数:8,代码来源:QueryController.java


示例16: beforeTest

import org.apache.cassandra.db.filter.ExtendedFilter; //导入依赖的package包/类
@Before
public void beforeTest()
{
    ExtendedFilter filter = ExtendedFilter.create(BACKEND.getBaseCfs(),
                                                  DataRange.allData(new Murmur3Partitioner()),
                                                  null,
                                                  Integer.MAX_VALUE,
                                                  false,
                                                  System.currentTimeMillis());

    controller = new QueryController(BACKEND, filter, TimeUnit.SECONDS.toMillis(10));
}
 
开发者ID:xedin,项目名称:sasi,代码行数:13,代码来源:OperationTest.java


示例17: search

import org.apache.cassandra.db.filter.ExtendedFilter; //导入依赖的package包/类
@Override
public List<Row> search(ExtendedFilter filter)
{
    assert filter.getClause() != null && !filter.getClause().isEmpty();
    final IndexExpression primary = highestSelectivityPredicate(filter.getClause(), true);
    final CompositesIndex index = (CompositesIndex)indexManager.getIndexForColumn(primary.column);
    // TODO: this should perhaps not open and maintain a writeOp for the full duration, but instead only *try* to delete stale entries, without blocking if there's no room
    // as it stands, we open a writeOp and keep it open for the duration to ensure that should this CF get flushed to make room we don't block the reclamation of any room being made
    try (OpOrder.Group writeOp = baseCfs.keyspace.writeOrder.start(); OpOrder.Group baseOp = baseCfs.readOrdering.start(); OpOrder.Group indexOp = index.getIndexCfs().readOrdering.start())
    {
        return baseCfs.filter(getIndexedIterator(writeOp, filter, primary, index), filter);
    }
}
 
开发者ID:Stratio,项目名称:stratio-cassandra,代码行数:14,代码来源:CompositesSearcher.java


示例18: search

import org.apache.cassandra.db.filter.ExtendedFilter; //导入依赖的package包/类
/**
 * Performs a search across a number of column indexes
 *
 * @param filter the column range to restrict to
 * @return found indexed rows
 */
public List<Row> search(ExtendedFilter filter)
{
    SecondaryIndexSearcher mostSelective = getHighestSelectivityIndexSearcher(filter.getClause());
    if (mostSelective == null)
        return Collections.emptyList();
    else
        return mostSelective.search(filter);
}
 
开发者ID:Stratio,项目名称:stratio-cassandra,代码行数:15,代码来源:SecondaryIndexManager.java


示例19: search

import org.apache.cassandra.db.filter.ExtendedFilter; //导入依赖的package包/类
@Override
public List<Row> search(ExtendedFilter filter)
{
    assert filter.getClause() != null && !filter.getClause().isEmpty();
    final IndexExpression primary = highestSelectivityPredicate(filter.getClause(), true);
    final SecondaryIndex index = indexManager.getIndexForColumn(primary.column);
    // TODO: this should perhaps not open and maintain a writeOp for the full duration, but instead only *try* to delete stale entries, without blocking if there's no room
    // as it stands, we open a writeOp and keep it open for the duration to ensure that should this CF get flushed to make room we don't block the reclamation of any room  being made
    try (OpOrder.Group writeOp = baseCfs.keyspace.writeOrder.start(); OpOrder.Group baseOp = baseCfs.readOrdering.start(); OpOrder.Group indexOp = index.getIndexCfs().readOrdering.start())
    {
        return baseCfs.filter(getIndexedIterator(writeOp, filter, primary, index), filter);
    }
}
 
开发者ID:Stratio,项目名称:stratio-cassandra,代码行数:14,代码来源:KeysSearcher.java


示例20: executeLocally

import org.apache.cassandra.db.filter.ExtendedFilter; //导入依赖的package包/类
public List<Row> executeLocally()
{
    
    logger.info(">>> STRATIO >>> RangeSliceCommand.executeLocally()");
    
    ColumnFamilyStore cfs = Keyspace.open(keyspace).getColumnFamilyStore(columnFamily);

    ExtendedFilter exFilter = cfs.makeExtendedFilter(keyRange, predicate, rowFilter, maxResults, countCQL3Rows, isPaging, timestamp);
    if (cfs.indexManager.hasIndexFor(rowFilter))
        return cfs.search(exFilter);
    else
        return cfs.getRangeSlice(exFilter);
}
 
开发者ID:mafernandez-stratio,项目名称:cassandra-cqlMod,代码行数:14,代码来源:RangeSliceCommand.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Dashboard类代码示例发布时间:2022-05-23
下一篇:
Java Point2dImpl类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap