/** * Creates an {@code ArrayBackedCachedPartition} holding all the data of the provided iterator. * * Warning: Note that this method does not close the provided iterator and it is * up to the caller to do so. * * @param iterator the iterator got gather in memory. * @param nowInSec the time of the creation in seconds. This is the time at which {@link #cachedLiveRows} applies. * @return the created partition. */ public static CachedBTreePartition create(UnfilteredRowIterator iterator, int nowInSec) { return create(iterator, 16, nowInSec); }
/** * Creates an {@code ArrayBackedCachedPartition} holding all the data of the provided iterator. * * Warning: Note that this method does not close the provided iterator and it is * up to the caller to do so. * * @param iterator the iterator got gather in memory. * @param nowInSec the time of the creation in seconds. This is the time at which {@link #cachedLiveRows} applies. * @return the created partition. */ public static CachedBTreePartition create(UnfilteredRowIterator iterator, int nowInSec) { return create(iterator, 16, nowInSec); }
/** * Creates an {@code ArrayBackedCachedPartition} holding all the data of the provided iterator. * * Warning: Note that this method does not close the provided iterator and it is * up to the caller to do so. * * @param iterator the iterator got gather in memory. * @param nowInSec the time of the creation in seconds. This is the time at which {@link #cachedLiveRows} applies. * @return the created partition. */ public static CachedBTreePartition create(UnfilteredRowIterator iterator, int nowInSec) { return create(iterator, 16, nowInSec); }
public Pair<RowCacheKey, IRowCacheEntry> call() throws Exception { DecoratedKey key = cfs.decorateKey(buffer); int nowInSec = FBUtilities.nowInSeconds(); SinglePartitionReadCommand cmd = SinglePartitionReadCommand.fullPartitionRead(cfs.metadata, nowInSec, key); try (ReadExecutionController controller = cmd.executionController(); UnfilteredRowIterator iter = cmd.queryMemtableAndDisk(cfs, controller)) { CachedPartition toCache = CachedBTreePartition.create(DataLimits.cqlLimits(rowsToCache).filter(iter, nowInSec, true), nowInSec); return Pair.create(new RowCacheKey(cfs.metadata.ksAndCFName, key), (IRowCacheEntry)toCache); } } });
public Pair<RowCacheKey, IRowCacheEntry> call() throws Exception { DecoratedKey key = cfs.decorateKey(buffer); int nowInSec = FBUtilities.nowInSeconds(); SinglePartitionReadCommand cmd = SinglePartitionReadCommand.fullPartitionRead(cfs.metadata, nowInSec, key); try (ReadExecutionController controller = cmd.executionController(); UnfilteredRowIterator iter = cmd.queryMemtableAndDisk(cfs, controller)) { CachedPartition toCache = CachedBTreePartition.create(DataLimits.cqlLimits(rowsToCache).filter(iter, nowInSec, true), nowInSec); return Pair.create(new RowCacheKey(cfs.metadata.ksAndCFName, key), (IRowCacheEntry)toCache); } } });
public Pair<RowCacheKey, IRowCacheEntry> call() throws Exception { DecoratedKey key = cfs.decorateKey(buffer); int nowInSec = FBUtilities.nowInSeconds(); SinglePartitionReadCommand cmd = SinglePartitionReadCommand.fullPartitionRead(cfs.metadata, nowInSec, key); try (ReadExecutionController controller = cmd.executionController(); UnfilteredRowIterator iter = cmd.queryMemtableAndDisk(cfs, controller)) { CachedPartition toCache = CachedBTreePartition.create(DataLimits.cqlLimits(rowsToCache).filter(iter, nowInSec, true), nowInSec); return Pair.create(new RowCacheKey(cfs.metadata.ksAndCFName, key), (IRowCacheEntry)toCache); } } });
CachedPartition toCache = CachedBTreePartition.create(toCacheIterator, nowInSec());
CachedPartition toCache = CachedBTreePartition.create(toCacheIterator, nowInSec());
CachedPartition toCache = CachedBTreePartition.create(toCacheIterator, nowInSec());