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

Java OnDiskAtomIterator类代码示例

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

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



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

示例1: LazilyCompactedRow

import org.apache.cassandra.db.columniterator.OnDiskAtomIterator; //导入依赖的package包/类
public LazilyCompactedRow(CompactionController controller, List<? extends OnDiskAtomIterator> rows)
{
    super(rows.get(0).getKey());
    this.rows = rows;
    this.controller = controller;
    indexer = controller.cfs.indexManager.gcUpdaterFor(key);

    // Combine top-level tombstones, keeping the one with the highest markedForDeleteAt timestamp.  This may be
    // purged (depending on gcBefore), but we need to remember it to properly delete columns during the merge
    maxRowTombstone = DeletionTime.LIVE;
    for (OnDiskAtomIterator row : rows)
    {
        DeletionTime rowTombstone = row.getColumnFamily().deletionInfo().getTopLevelDeletion();
        if (maxRowTombstone.compareTo(rowTombstone) < 0)
            maxRowTombstone = rowTombstone;
    }

    emptyColumnFamily = ArrayBackedSortedColumns.factory.create(controller.cfs.metadata);
    emptyColumnFamily.delete(maxRowTombstone);
    if (!maxRowTombstone.isLive() && maxRowTombstone.markedForDeleteAt < getMaxPurgeableTimestamp())
        emptyColumnFamily.purgeTombstones(controller.gcBefore);

    reducer = new Reducer();
    merger = Iterators.filter(MergeIterator.get(rows, emptyColumnFamily.getComparator().onDiskAtomComparator(), reducer), Predicates.notNull());
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:26,代码来源:LazilyCompactedRow.java


示例2: assertContentEquals

import org.apache.cassandra.db.columniterator.OnDiskAtomIterator; //导入依赖的package包/类
public static void assertContentEquals(OnDiskAtomIterator lhs, OnDiskAtomIterator rhs)
{
    assertEquals(lhs.getKey(), rhs.getKey());
    // check metadata
    ColumnFamily lcf = lhs.getColumnFamily();
    ColumnFamily rcf = rhs.getColumnFamily();
    if (lcf == null)
    {
        if (rcf == null)
            return;
        throw new AssertionError("LHS had no content for " + rhs.getKey());
    }
    else if (rcf == null)
        throw new AssertionError("RHS had no content for " + lhs.getKey());
    assertEquals(lcf.deletionInfo(), rcf.deletionInfo());
    // iterate columns
    while (lhs.hasNext())
    {
        Cell clhs = (Cell)lhs.next();
        assert rhs.hasNext() : "LHS contained more columns than RHS for " + lhs.getKey();
        Cell crhs = (Cell)rhs.next();

        assertEquals("Mismatched columns for " + lhs.getKey(), clhs, crhs);
    }
    assert !rhs.hasNext() : "RHS contained more columns than LHS for " + lhs.getKey();
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:27,代码来源:SSTableUtils.java


示例3: LazilyCompactedRow

import org.apache.cassandra.db.columniterator.OnDiskAtomIterator; //导入依赖的package包/类
public LazilyCompactedRow(CompactionController controller, List<? extends OnDiskAtomIterator> rows)
{
    super(rows.get(0).getKey());
    this.rows = rows;
    this.controller = controller;
    indexer = controller.cfs.indexManager.updaterFor(key);

    maxDelTimestamp = Long.MIN_VALUE;
    for (OnDiskAtomIterator row : rows)
    {
        ColumnFamily cf = row.getColumnFamily();
        maxDelTimestamp = Math.max(maxDelTimestamp, cf.deletionInfo().maxTimestamp());

        if (emptyColumnFamily == null)
            emptyColumnFamily = cf;
        else
            emptyColumnFamily.delete(cf);
    }
    this.shouldPurge = controller.shouldPurge(key, maxDelTimestamp);
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:21,代码来源:LazilyCompactedRow.java


示例4: assertContentEquals

import org.apache.cassandra.db.columniterator.OnDiskAtomIterator; //导入依赖的package包/类
public static void assertContentEquals(OnDiskAtomIterator lhs, OnDiskAtomIterator rhs) throws IOException
{
    assertEquals(lhs.getKey(), rhs.getKey());
    // check metadata
    ColumnFamily lcf = lhs.getColumnFamily();
    ColumnFamily rcf = rhs.getColumnFamily();
    if (lcf == null)
    {
        if (rcf == null)
            return;
        throw new AssertionError("LHS had no content for " + rhs.getKey());
    }
    else if (rcf == null)
        throw new AssertionError("RHS had no content for " + lhs.getKey());
    assertEquals(lcf.deletionInfo(), rcf.deletionInfo());
    // iterate columns
    while (lhs.hasNext())
    {
        Column clhs = (Column)lhs.next();
        assert rhs.hasNext() : "LHS contained more columns than RHS for " + lhs.getKey();
        Column crhs = (Column)rhs.next();

        assertEquals("Mismatched columns for " + lhs.getKey(), clhs, crhs);
    }
    assert !rhs.hasNext() : "RHS contained more columns than LHS for " + lhs.getKey();
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:27,代码来源:SSTableUtils.java


示例5: assertContentEquals

import org.apache.cassandra.db.columniterator.OnDiskAtomIterator; //导入依赖的package包/类
public static void assertContentEquals(OnDiskAtomIterator lhs, OnDiskAtomIterator rhs) throws IOException
{
    assertEquals(lhs.getKey(), rhs.getKey());
    // check metadata
    ColumnFamily lcf = lhs.getColumnFamily();
    ColumnFamily rcf = rhs.getColumnFamily();
    if (lcf == null)
    {
        if (rcf == null)
            return;
        throw new AssertionError("LHS had no content for " + rhs.getKey());
    }
    else if (rcf == null)
        throw new AssertionError("RHS had no content for " + lhs.getKey());
    assertEquals(lcf.deletionInfo(), rcf.deletionInfo());
    // iterate columns
    while (lhs.hasNext())
    {
        IColumn clhs = (IColumn)lhs.next();
        assert rhs.hasNext() : "LHS contained more columns than RHS for " + lhs.getKey();
        IColumn crhs = (IColumn)rhs.next();

        assertEquals("Mismatched columns for " + lhs.getKey(), clhs, crhs);
    }
    assert !rhs.hasNext() : "RHS contained more columns than LHS for " + lhs.getKey();
}
 
开发者ID:dprguiuc,项目名称:Cassandra-Wasef,代码行数:27,代码来源:SSTableUtils.java


示例6: assertContentEquals

import org.apache.cassandra.db.columniterator.OnDiskAtomIterator; //导入依赖的package包/类
public static void assertContentEquals(OnDiskAtomIterator lhs, OnDiskAtomIterator rhs) throws IOException
{
    assertEquals(lhs.getKey(), rhs.getKey());
    // check metadata
    ColumnFamily lcf = lhs.getColumnFamily();
    ColumnFamily rcf = rhs.getColumnFamily();
    if (lcf == null)
    {
        if (rcf == null)
            return;
        throw new AssertionError("LHS had no content for " + rhs.getKey());
    }
    else if (rcf == null)
        throw new AssertionError("RHS had no content for " + lhs.getKey());
    assertEquals(lcf.deletionInfo(), rcf.deletionInfo());
    // iterate columns
    while (lhs.hasNext())
    {
        Cell clhs = (Cell)lhs.next();
        assert rhs.hasNext() : "LHS contained more columns than RHS for " + lhs.getKey();
        Cell crhs = (Cell)rhs.next();

        assertEquals("Mismatched columns for " + lhs.getKey(), clhs, crhs);
    }
    assert !rhs.hasNext() : "RHS contained more columns than LHS for " + lhs.getKey();
}
 
开发者ID:mafernandez-stratio,项目名称:cassandra-cqlMod,代码行数:27,代码来源:SSTableUtils.java


示例7: next

import org.apache.cassandra.db.columniterator.OnDiskAtomIterator; //导入依赖的package包/类
public OnDiskAtomIterator next()
{
    try
    {
        if (row != null)
            dfile.seek(finishedAt);
        assert !dfile.isEOF();

        // Read data header
        DecoratedKey key = sstable.decodeKey(ByteBufferUtil.readWithShortLength(dfile));
        long dataSize = SSTableReader.readRowSize(dfile, sstable.descriptor);
        long dataStart = dfile.getFilePointer();
        finishedAt = dataStart + dataSize;

        row = new SSTableIdentityIterator(sstable, dfile, key, dataStart, dataSize);
        return row;
    }
    catch (IOException e)
    {
        sstable.markSuspect();
        throw new CorruptSSTableException(e, dfile.getPath());
    }
}
 
开发者ID:jackliu8722,项目名称:cassandra-1.2.16,代码行数:24,代码来源:SSTableScanner.java


示例8: next

import org.apache.cassandra.db.columniterator.OnDiskAtomIterator; //导入依赖的package包/类
public OnDiskAtomIterator next()
{
    final Map.Entry<DecoratedKey, ColumnFamily> entry = iter.next();
    return new LazyColumnIterator(entry.getKey(), new IColumnIteratorFactory()
    {
        public OnDiskAtomIterator create()
        {
            return range.columnFilter(entry.getKey().getKey()).getColumnIterator(entry.getKey(), entry.getValue());
        }
    });
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:12,代码来源:RowIteratorFactory.java


示例9: close

import org.apache.cassandra.db.columniterator.OnDiskAtomIterator; //导入依赖的package包/类
public void close()
{
    for (OnDiskAtomIterator row : rows)
    {
        try
        {
            row.close();
        }
        catch (IOException e)
        {
            throw new RuntimeException(e);
        }
    }
    closed = true;
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:16,代码来源:LazilyCompactedRow.java


示例10: computeNext

import org.apache.cassandra.db.columniterator.OnDiskAtomIterator; //导入依赖的package包/类
protected OnDiskAtomIterator computeNext()
{
    if (currentScanner == null)
        return endOfData();

    try
    {
        while (true)
        {
            if (currentScanner.hasNext())
                return currentScanner.next();

            positionOffset += currentScanner.getLengthInBytes();
            currentScanner.close();
            if (!sstableIterator.hasNext())
            {
                // reset to null so getCurrentPosition does not return wrong value
                currentScanner = null;
                return endOfData();
            }
            currentScanner = sstableIterator.next().getScanner(range, CompactionManager.instance.getRateLimiter());
        }
    }
    catch (IOException e)
    {
        throw new RuntimeException(e);
    }
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:29,代码来源:LeveledCompactionStrategy.java


示例11: getColumnIterator

import org.apache.cassandra.db.columniterator.OnDiskAtomIterator; //导入依赖的package包/类
public OnDiskAtomIterator getColumnIterator(final DecoratedKey key, final ColumnFamily cf)
{
    assert cf != null;
    final Iterator<Cell> iter = getColumnIterator(cf);

    return new OnDiskAtomIterator()
    {
        public ColumnFamily getColumnFamily()
        {
            return cf;
        }

        public DecoratedKey getKey()
        {
            return key;
        }

        public boolean hasNext()
        {
            return iter.hasNext();
        }

        public OnDiskAtom next()
        {
            return iter.next();
        }

        public void close() throws IOException { }

        public void remove()
        {
            throw new UnsupportedOperationException();
        }
    };
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:36,代码来源:SliceQueryFilter.java


示例12: next

import org.apache.cassandra.db.columniterator.OnDiskAtomIterator; //导入依赖的package包/类
public OnDiskAtomIterator next()
{
    final Map.Entry<DecoratedKey, T> entry = iter.next();
    return new LazyColumnIterator(entry.getKey(), new IColumnIteratorFactory()
    {
        public OnDiskAtomIterator create()
        {
            return range.columnFilter(entry.getKey().key).getColumnFamilyIterator(entry.getKey(), entry.getValue());
        }
    });
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:12,代码来源:RowIteratorFactory.java


示例13: filterColumnFamily

import org.apache.cassandra.db.columniterator.OnDiskAtomIterator; //导入依赖的package包/类
/**
 *  Filter a cached row, which will not be modified by the filter, but may be modified by throwing out
 *  tombstones that are no longer relevant.
 *  The returned column family won't be thread safe.
 */
ColumnFamily filterColumnFamily(ColumnFamily cached, QueryFilter filter)
{
    ColumnFamily cf = cached.cloneMeShallow(ArrayBackedSortedColumns.factory, filter.filter.isReversed());
    OnDiskAtomIterator ci = filter.getColumnFamilyIterator(cached);

    int gcBefore = gcBefore(filter.timestamp);
    filter.collateOnDiskAtom(cf, ci, gcBefore);
    return removeDeletedCF(cf, gcBefore);
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:15,代码来源:ColumnFamilyStore.java


示例14: getMemtableColumnIterator

import org.apache.cassandra.db.columniterator.OnDiskAtomIterator; //导入依赖的package包/类
public OnDiskAtomIterator getMemtableColumnIterator(Memtable memtable)
{
    ColumnFamily cf = memtable.getColumnFamily(key);
    if (cf == null)
        return null;
    return getColumnFamilyIterator(cf);
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:8,代码来源:QueryFilter.java


示例15: prune

import org.apache.cassandra.db.columniterator.OnDiskAtomIterator; //导入依赖的package包/类
public ColumnFamily prune(DecoratedKey rowKey, ColumnFamily data)
{
    if (optimizedFilter == null)
        return data;

    ColumnFamily pruned = data.cloneMeShallow();
    IDiskAtomFilter filter = dataRange.columnFilter(rowKey.key);
    OnDiskAtomIterator iter = filter.getColumnFamilyIterator(rowKey, data);
    filter.collectReducedColumns(pruned, QueryFilter.gatherTombstones(pruned, iter), cfs.gcBefore(timestamp), timestamp);
    return pruned;
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:12,代码来源:ExtendedFilter.java


示例16: getColumnFamilyIterator

import org.apache.cassandra.db.columniterator.OnDiskAtomIterator; //导入依赖的package包/类
public OnDiskAtomIterator getColumnFamilyIterator(final DecoratedKey key, final ColumnFamily cf)
{
    assert cf != null;
    final Iterator<Column> filteredIter = reversed ? cf.reverseIterator(slices) : cf.iterator(slices);

    return new OnDiskAtomIterator()
    {
        public ColumnFamily getColumnFamily()
        {
            return cf;
        }

        public DecoratedKey getKey()
        {
            return key;
        }

        public boolean hasNext()
        {
            return filteredIter.hasNext();
        }

        public OnDiskAtom next()
        {
            return filteredIter.next();
        }

        public void close() throws IOException { }

        public void remove()
        {
            throw new UnsupportedOperationException();
        }
    };
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:36,代码来源:SliceQueryFilter.java


示例17: getNamesIterator

import org.apache.cassandra.db.columniterator.OnDiskAtomIterator; //导入依赖的package包/类
public static OnDiskAtomIterator getNamesIterator(final DecoratedKey key, final ColumnFamily cf, final NamesQueryFilter filter)
{
    assert cf != null;
    final boolean isStandard = !cf.isSuper();

    return new SimpleAbstractColumnIterator()
    {
        private Iterator<ByteBuffer> iter = filter.columns.iterator();

        public ColumnFamily getColumnFamily()
        {
            return cf;
        }

        public DecoratedKey getKey()
        {
            return key;
        }

        protected OnDiskAtom computeNext()
        {
            while (iter.hasNext())
            {
                ByteBuffer current = iter.next();
                IColumn column = cf.getColumn(current);
                if (column != null)
                    // clone supercolumns so caller can freely removeDeleted or otherwise mutate it
                    return isStandard ? column : ((SuperColumn)column).cloneMe();
            }
            return endOfData();
        }
    };
}
 
开发者ID:wso2,项目名称:wso2-cassandra,代码行数:34,代码来源:Memtable.java


示例18: LazilyCompactedRow

import org.apache.cassandra.db.columniterator.OnDiskAtomIterator; //导入依赖的package包/类
public LazilyCompactedRow(CompactionController controller, List<? extends OnDiskAtomIterator> rows)
{
    super(rows.get(0).getKey());
    this.rows = rows;
    this.controller = controller;
    indexer = controller.cfs.indexManager.gcUpdaterFor(key);

    // Combine top-level tombstones, keeping the one with the highest markedForDeleteAt timestamp.  This may be
    // purged (depending on gcBefore), but we need to remember it to properly delete columns during the merge
    maxRowTombstone = DeletionTime.LIVE;
    for (OnDiskAtomIterator row : rows)
    {
        DeletionTime rowTombstone = row.getColumnFamily().deletionInfo().getTopLevelDeletion();
        if (maxRowTombstone.compareTo(rowTombstone) < 0)
            maxRowTombstone = rowTombstone;
    }

    // tombstones with a localDeletionTime before this can be purged.  This is the minimum timestamp for any sstable
    // containing `key` outside of the set of sstables involved in this compaction.
    maxPurgeableTimestamp = controller.maxPurgeableTimestamp(key);

    emptyColumnFamily = ArrayBackedSortedColumns.factory.create(controller.cfs.metadata);
    emptyColumnFamily.delete(maxRowTombstone);
    if (maxRowTombstone.markedForDeleteAt < maxPurgeableTimestamp)
        emptyColumnFamily.purgeTombstones(controller.gcBefore);

    reducer = new Reducer();
    merger = Iterators.filter(MergeIterator.get(rows, emptyColumnFamily.getComparator().onDiskAtomComparator(), reducer), Predicates.notNull());
}
 
开发者ID:daidong,项目名称:GraphTrek,代码行数:30,代码来源:LazilyCompactedRow.java


示例19: getMemtableColumnIterator

import org.apache.cassandra.db.columniterator.OnDiskAtomIterator; //导入依赖的package包/类
public OnDiskAtomIterator getMemtableColumnIterator(ColumnFamily cf, DecoratedKey key)
{
    assert cf != null;
    if (path.superColumnName == null)
        return filter.getMemtableColumnIterator(cf, key);
    return superFilter.getMemtableColumnIterator(cf, key);
}
 
开发者ID:wso2,项目名称:wso2-cassandra,代码行数:8,代码来源:QueryFilter.java


示例20: next

import org.apache.cassandra.db.columniterator.OnDiskAtomIterator; //导入依赖的package包/类
public OnDiskAtomIterator next()
{
    final Map.Entry<DecoratedKey, ColumnFamily> entry = iter.next();
    return new LazyColumnIterator(entry.getKey(), new IColumnIteratorFactory()
    {
        public OnDiskAtomIterator create()
        {
            return filter.getMemtableColumnIterator(entry.getValue(), entry.getKey());
        }
    });
}
 
开发者ID:jackliu8722,项目名称:cassandra-1.2.16,代码行数:12,代码来源:RowIteratorFactory.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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