public static RowIterator toRowIterator(final CFMetaData metadata, final DecoratedKey key, final Iterator<LegacyCell> cells, final int nowInSec) { SerializationHelper helper = new SerializationHelper(metadata, 0, SerializationHelper.Flag.LOCAL); return UnfilteredRowIterators.filter(toUnfilteredRowIterator(metadata, key, LegacyDeletionInfo.live(), cells, false, helper), nowInSec); }
public static RowIterator toRowIterator(final CFMetaData metadata, final DecoratedKey key, final Iterator<LegacyCell> cells, final int nowInSec) { SerializationHelper helper = new SerializationHelper(metadata, 0, SerializationHelper.Flag.LOCAL); return UnfilteredRowIterators.filter(toUnfilteredRowIterator(metadata, key, LegacyDeletionInfo.live(), cells, false, helper), nowInSec); }
public static RowIterator toRowIterator(final CFMetaData metadata, final DecoratedKey key, final Iterator<LegacyCell> cells, final int nowInSec) { SerializationHelper helper = new SerializationHelper(metadata, 0, SerializationHelper.Flag.LOCAL); return UnfilteredRowIterators.filter(toUnfilteredRowIterator(metadata, key, LegacyDeletionInfo.live(), cells, false, helper), nowInSec); }
public RowIterator read(SinglePartitionReadCommand command) { ReadExecutionController control = command.executionController(); try { UnfilteredRowIterator unfilteredRows = command.queryMemtableAndDisk(baseCfs, control); return UnfilteredRowIterators.filter(unfilteredRows, nowInSec); } finally { control.close(); } }
public static RowIterator toRowIterator(final CFMetaData metadata, final DecoratedKey key, final Iterator<LegacyCell> cells, final int nowInSec) { SerializationHelper helper = new SerializationHelper(metadata, 0, SerializationHelper.Flag.LOCAL); return UnfilteredRowIterators.filter(toUnfilteredRowIterator(metadata, key, LegacyDeletionInfo.live(), cells, false, helper), nowInSec); }
@SuppressWarnings("resource") // Both the OpOrder and 'indexIter' are closed on exception, or through the closing of the result // of this method. public UnfilteredPartitionIterator search(ReadExecutionController executionController) { // the value of the index expression is the partition key in the index table DecoratedKey indexKey = index.getBackingTable().get().decorateKey(expression.getIndexValue()); UnfilteredRowIterator indexIter = queryIndex(indexKey, command, executionController); try { return queryDataFromIndex(indexKey, UnfilteredRowIterators.filter(indexIter, command.nowInSec()), command, executionController); } catch (RuntimeException | Error e) { indexIter.close(); throw e; } }
@SuppressWarnings("resource") // Both the OpOrder and 'indexIter' are closed on exception, or through the closing of the result // of this method. public UnfilteredPartitionIterator search(ReadExecutionController executionController) { // the value of the index expression is the partition key in the index table DecoratedKey indexKey = index.getBackingTable().get().decorateKey(expression.getIndexValue()); UnfilteredRowIterator indexIter = queryIndex(indexKey, command, executionController); try { return queryDataFromIndex(indexKey, UnfilteredRowIterators.filter(indexIter, command.nowInSec()), command, executionController); } catch (RuntimeException | Error e) { indexIter.close(); throw e; } }
@SuppressWarnings("resource") // Both the OpOrder and 'indexIter' are closed on exception, or through the closing of the result // of this method. public UnfilteredPartitionIterator search(ReadExecutionController executionController) { // the value of the index expression is the partition key in the index table DecoratedKey indexKey = index.getBackingTable().get().decorateKey(expression.getIndexValue()); UnfilteredRowIterator indexIter = queryIndex(indexKey, command, executionController); try { return queryDataFromIndex(indexKey, UnfilteredRowIterators.filter(indexIter, command.nowInSec()), command, executionController); } catch (RuntimeException | Error e) { indexIter.close(); throw e; } }
UnfilteredRowIterators.filter( ThriftResultsMerger.maybeWrap(expectedToUnfilteredRowIterator(), nowInSec), nowInSec));
UnfilteredRowIterators.filter( ThriftResultsMerger.maybeWrap(expectedToUnfilteredRowIterator(), nowInSec), nowInSec));
private static long readTypeTimestamp(String keyspaceName, String typeName) { ColumnFamilyStore store = org.apache.cassandra.db.Keyspace.open(SchemaConstants.SYSTEM_KEYSPACE_NAME) .getColumnFamilyStore(SystemKeyspace.LEGACY_USERTYPES); ClusteringComparator comparator = store.metadata.comparator; Slices slices = Slices.with(comparator, Slice.make(comparator, typeName)); int nowInSec = FBUtilities.nowInSeconds(); DecoratedKey key = store.metadata.decorateKey(AsciiType.instance.fromString(keyspaceName)); SinglePartitionReadCommand command = SinglePartitionReadCommand.create(store.metadata, nowInSec, key, slices); try (ReadExecutionController controller = command.executionController(); RowIterator partition = UnfilteredRowIterators.filter(command.queryMemtableAndDisk(store, controller), nowInSec)) { return partition.next().primaryKeyLivenessInfo().timestamp(); } }
private static long readTypeTimestamp(String keyspaceName, String typeName) { ColumnFamilyStore store = org.apache.cassandra.db.Keyspace.open(SchemaConstants.SYSTEM_KEYSPACE_NAME) .getColumnFamilyStore(SystemKeyspace.LEGACY_USERTYPES); ClusteringComparator comparator = store.metadata.comparator; Slices slices = Slices.with(comparator, Slice.make(comparator, typeName)); int nowInSec = FBUtilities.nowInSeconds(); DecoratedKey key = store.metadata.decorateKey(AsciiType.instance.fromString(keyspaceName)); SinglePartitionReadCommand command = SinglePartitionReadCommand.create(store.metadata, nowInSec, key, slices); try (ReadExecutionController controller = command.executionController(); RowIterator partition = UnfilteredRowIterators.filter(command.queryMemtableAndDisk(store, controller), nowInSec)) { return partition.next().primaryKeyLivenessInfo().timestamp(); } }
private static long readTypeTimestamp(String keyspaceName, String typeName) { ColumnFamilyStore store = org.apache.cassandra.db.Keyspace.open(SchemaConstants.SYSTEM_KEYSPACE_NAME) .getColumnFamilyStore(SystemKeyspace.LEGACY_USERTYPES); ClusteringComparator comparator = store.metadata.comparator; Slices slices = Slices.with(comparator, Slice.make(comparator, typeName)); int nowInSec = FBUtilities.nowInSeconds(); DecoratedKey key = store.metadata.decorateKey(AsciiType.instance.fromString(keyspaceName)); SinglePartitionReadCommand command = SinglePartitionReadCommand.create(store.metadata, nowInSec, key, slices); try (ReadExecutionController controller = command.executionController(); RowIterator partition = UnfilteredRowIterators.filter(command.queryMemtableAndDisk(store, controller), nowInSec)) { return partition.next().primaryKeyLivenessInfo().timestamp(); } }
private void updateWithCurrentValuesFromCFS(List<PartitionUpdate.CounterMark> marks, ColumnFamilyStore cfs) { ColumnFilter.Builder builder = ColumnFilter.selectionBuilder(); BTreeSet.Builder<Clustering> names = BTreeSet.builder(cfs.metadata.comparator); for (PartitionUpdate.CounterMark mark : marks) { if (mark.clustering() != Clustering.STATIC_CLUSTERING) names.add(mark.clustering()); if (mark.path() == null) builder.add(mark.column()); else builder.select(mark.column(), mark.path()); } int nowInSec = FBUtilities.nowInSeconds(); ClusteringIndexNamesFilter filter = new ClusteringIndexNamesFilter(names.build(), false); SinglePartitionReadCommand cmd = SinglePartitionReadCommand.create(cfs.metadata, nowInSec, key(), builder.build(), filter); PeekingIterator<PartitionUpdate.CounterMark> markIter = Iterators.peekingIterator(marks.iterator()); try (ReadExecutionController controller = cmd.executionController(); RowIterator partition = UnfilteredRowIterators.filter(cmd.queryMemtableAndDisk(cfs, controller), nowInSec)) { updateForRow(markIter, partition.staticRow(), cfs); while (partition.hasNext()) { if (!markIter.hasNext()) return; updateForRow(markIter, partition.next(), cfs); } } }
private void updateWithCurrentValuesFromCFS(List<PartitionUpdate.CounterMark> marks, ColumnFamilyStore cfs) { ColumnFilter.Builder builder = ColumnFilter.selectionBuilder(); BTreeSet.Builder<Clustering> names = BTreeSet.builder(cfs.metadata.comparator); for (PartitionUpdate.CounterMark mark : marks) { if (mark.clustering() != Clustering.STATIC_CLUSTERING) names.add(mark.clustering()); if (mark.path() == null) builder.add(mark.column()); else builder.select(mark.column(), mark.path()); } int nowInSec = FBUtilities.nowInSeconds(); ClusteringIndexNamesFilter filter = new ClusteringIndexNamesFilter(names.build(), false); SinglePartitionReadCommand cmd = SinglePartitionReadCommand.create(cfs.metadata, nowInSec, key(), builder.build(), filter); PeekingIterator<PartitionUpdate.CounterMark> markIter = Iterators.peekingIterator(marks.iterator()); try (ReadExecutionController controller = cmd.executionController(); RowIterator partition = UnfilteredRowIterators.filter(cmd.queryMemtableAndDisk(cfs, controller), nowInSec)) { updateForRow(markIter, partition.staticRow(), cfs); while (partition.hasNext()) { if (!markIter.hasNext()) return; updateForRow(markIter, partition.next(), cfs); } } }
private void updateWithCurrentValuesFromCFS(List<PartitionUpdate.CounterMark> marks, ColumnFamilyStore cfs) { ColumnFilter.Builder builder = ColumnFilter.selectionBuilder(); BTreeSet.Builder<Clustering> names = BTreeSet.builder(cfs.metadata.comparator); for (PartitionUpdate.CounterMark mark : marks) { if (mark.clustering() != Clustering.STATIC_CLUSTERING) names.add(mark.clustering()); if (mark.path() == null) builder.add(mark.column()); else builder.select(mark.column(), mark.path()); } int nowInSec = FBUtilities.nowInSeconds(); ClusteringIndexNamesFilter filter = new ClusteringIndexNamesFilter(names.build(), false); SinglePartitionReadCommand cmd = SinglePartitionReadCommand.create(cfs.metadata, nowInSec, key(), builder.build(), filter); PeekingIterator<PartitionUpdate.CounterMark> markIter = Iterators.peekingIterator(marks.iterator()); try (ReadExecutionController controller = cmd.executionController(); RowIterator partition = UnfilteredRowIterators.filter(cmd.queryMemtableAndDisk(cfs, controller), nowInSec)) { updateForRow(markIter, partition.staticRow(), cfs); while (partition.hasNext()) { if (!markIter.hasNext()) return; updateForRow(markIter, partition.next(), cfs); } } }
SinglePartitionReadCommand cmd = SinglePartitionReadCommand.create(cfs.metadata, nowInSec, key, builder.build(), filter); try (ReadExecutionController controller = cmd.executionController(); RowIterator iter = UnfilteredRowIterators.filter(cmd.queryMemtableAndDisk(cfs, controller), nowInSec))
SinglePartitionReadCommand cmd = SinglePartitionReadCommand.create(cfs.metadata, nowInSec, key, builder.build(), filter); try (ReadExecutionController controller = cmd.executionController(); RowIterator iter = UnfilteredRowIterators.filter(cmd.queryMemtableAndDisk(cfs, controller), nowInSec))
SinglePartitionReadCommand cmd = SinglePartitionReadCommand.create(cfs.metadata, nowInSec, key, builder.build(), filter); try (ReadExecutionController controller = cmd.executionController(); RowIterator iter = UnfilteredRowIterators.filter(cmd.queryMemtableAndDisk(cfs, controller), nowInSec))