@Override public PartitionColumns columns() { return selectedColumns.fetchedColumns(); }
private boolean queriesMulticellType() { for (ColumnDefinition column : columnFilter().fetchedColumns()) { if (column.type.isMultiCell() || column.type.isCounter()) return true; } return false; }
private boolean queriesMulticellType() { for (ColumnDefinition column : columnFilter().fetchedColumns()) { if (column.type.isMultiCell() || column.type.isCounter()) return true; } return false; }
private boolean queriesMulticellType() { for (ColumnDefinition column : columnFilter().fetchedColumns()) { if (column.type.isMultiCell() || column.type.isCounter()) return true; } return false; }
private boolean shouldInclude(SSTableReader sstable) { // If some static columns are queried, we should always include the sstable: the clustering values stats of the sstable // don't tell us if the sstable contains static values in particular. // TODO: we could record if a sstable contains any static value at all. if (!columnFilter().fetchedColumns().statics.isEmpty()) return true; return clusteringIndexFilter().shouldInclude(sstable); }
private long serializedNamesCommandSize(SinglePartitionReadCommand command) { ClusteringIndexNamesFilter filter = (ClusteringIndexNamesFilter)command.clusteringIndexFilter(); PartitionColumns columns = command.columnFilter().fetchedColumns(); return serializedNamesFilterSize(filter, command.metadata(), columns); }
private boolean shouldInclude(SSTableReader sstable) { // If some static columns are queried, we should always include the sstable: the clustering values stats of the sstable // don't tell us if the sstable contains static values in particular. // TODO: we could record if a sstable contains any static value at all. if (!columnFilter().fetchedColumns().statics.isEmpty()) return true; return clusteringIndexFilter().shouldInclude(sstable); }
private Row staticRow(Holder current, ColumnFilter columns, boolean setActiveDeletionToRow) { DeletionTime partitionDeletion = current.deletionInfo.getPartitionDeletion(); if (columns.fetchedColumns().statics.isEmpty() || (current.staticRow.isEmpty() && partitionDeletion.isLive())) return Rows.EMPTY_STATIC_ROW; Row row = current.staticRow.filter(columns, partitionDeletion, setActiveDeletionToRow, metadata); return row == null ? Rows.EMPTY_STATIC_ROW : row; }
public boolean selectsClustering(DecoratedKey key, Clustering clustering) { if (clustering == Clustering.STATIC_CLUSTERING) return !columnFilter().fetchedColumns().statics.isEmpty(); if (!clusteringIndexFilter().selects(clustering)) return false; return rowFilter().clusteringKeyRestrictionsAreSatisfiedBy(clustering); }
public boolean selectsClustering(DecoratedKey key, Clustering clustering) { if (clustering == Clustering.STATIC_CLUSTERING) return !columnFilter().fetchedColumns().statics.isEmpty(); if (!dataRange().clusteringIndexFilter(key).selects(clustering)) return false; return rowFilter().clusteringKeyRestrictionsAreSatisfiedBy(clustering); }
private static SinglePartitionReadCommand maybeConvertNamesToSlice(SinglePartitionReadCommand command) { if (command.clusteringIndexFilter().kind() != ClusteringIndexFilter.Kind.NAMES) return command; CFMetaData metadata = command.metadata(); if (!shouldConvertNamesToSlice(metadata, command.columnFilter().fetchedColumns())) return command; ClusteringIndexNamesFilter filter = (ClusteringIndexNamesFilter)command.clusteringIndexFilter(); ClusteringIndexSliceFilter sliceFilter = convertNamesFilterToSliceFilter(filter, metadata); return command.withUpdatedClusteringIndexFilter(sliceFilter); }
private ColumnFilter getExtendedFilter(ColumnFilter initialFilter) { if (command.columnFilter().fetches(index.getIndexedColumn())) return initialFilter; ColumnFilter.Builder builder = ColumnFilter.selectionBuilder(); builder.addAll(initialFilter.fetchedColumns()); builder.add(index.getIndexedColumn()); return builder.build(); }
private static SinglePartitionReadCommand maybeConvertNamesToSlice(SinglePartitionReadCommand command) { if (command.clusteringIndexFilter().kind() != ClusteringIndexFilter.Kind.NAMES) return command; CFMetaData metadata = command.metadata(); if (!shouldConvertNamesToSlice(metadata, command.columnFilter().fetchedColumns())) return command; ClusteringIndexNamesFilter filter = (ClusteringIndexNamesFilter)command.clusteringIndexFilter(); ClusteringIndexSliceFilter sliceFilter = convertNamesFilterToSliceFilter(filter, metadata); return command.withUpdatedClusteringIndexFilter(sliceFilter); }
private static SinglePartitionReadCommand maybeConvertNamesToSlice(SinglePartitionReadCommand command) { if (command.clusteringIndexFilter().kind() != ClusteringIndexFilter.Kind.NAMES) return command; CFMetaData metadata = command.metadata(); if (!shouldConvertNamesToSlice(metadata, command.columnFilter().fetchedColumns())) return command; ClusteringIndexNamesFilter filter = (ClusteringIndexNamesFilter)command.clusteringIndexFilter(); ClusteringIndexSliceFilter sliceFilter = convertNamesFilterToSliceFilter(filter, metadata); return command.withUpdatedClusteringIndexFilter(sliceFilter); }
private ColumnFilter getExtendedFilter(ColumnFilter initialFilter) { if (command.columnFilter().fetches(index.getIndexedColumn())) return initialFilter; ColumnFilter.Builder builder = ColumnFilter.selectionBuilder(); builder.addAll(initialFilter.fetchedColumns()); builder.add(index.getIndexedColumn()); return builder.build(); }
static PartitionRangeReadCommand maybeConvertNamesToSlice(PartitionRangeReadCommand command) { if (!command.dataRange().isNamesQuery()) return command; CFMetaData metadata = command.metadata(); if (!LegacyReadCommandSerializer.shouldConvertNamesToSlice(metadata, command.columnFilter().fetchedColumns())) return command; ClusteringIndexNamesFilter filter = (ClusteringIndexNamesFilter) command.dataRange().clusteringIndexFilter; ClusteringIndexSliceFilter sliceFilter = LegacyReadCommandSerializer.convertNamesFilterToSliceFilter(filter, metadata); DataRange newRange = new DataRange(command.dataRange().keyRange(), sliceFilter); return command.withUpdatedDataRange(newRange); }
static PartitionRangeReadCommand maybeConvertNamesToSlice(PartitionRangeReadCommand command) { if (!command.dataRange().isNamesQuery()) return command; CFMetaData metadata = command.metadata(); if (!LegacyReadCommandSerializer.shouldConvertNamesToSlice(metadata, command.columnFilter().fetchedColumns())) return command; ClusteringIndexNamesFilter filter = (ClusteringIndexNamesFilter) command.dataRange().clusteringIndexFilter; ClusteringIndexSliceFilter sliceFilter = LegacyReadCommandSerializer.convertNamesFilterToSliceFilter(filter, metadata); DataRange newRange = new DataRange(command.dataRange().keyRange(), sliceFilter); return command.withUpdatedDataRange(newRange); }
static PartitionRangeReadCommand maybeConvertNamesToSlice(PartitionRangeReadCommand command) { if (!command.dataRange().isNamesQuery()) return command; CFMetaData metadata = command.metadata(); if (!LegacyReadCommandSerializer.shouldConvertNamesToSlice(metadata, command.columnFilter().fetchedColumns())) return command; ClusteringIndexNamesFilter filter = (ClusteringIndexNamesFilter) command.dataRange().clusteringIndexFilter; ClusteringIndexSliceFilter sliceFilter = LegacyReadCommandSerializer.convertNamesFilterToSliceFilter(filter, metadata); DataRange newRange = new DataRange(command.dataRange().keyRange(), sliceFilter); return command.withUpdatedDataRange(newRange); }
private long serializedSliceCommandSize(SinglePartitionReadCommand command) { CFMetaData metadata = command.metadata(); ClusteringIndexSliceFilter filter = (ClusteringIndexSliceFilter)command.clusteringIndexFilter(); Slices slices = filter.requestedSlices(); boolean makeStaticSlice = !command.columnFilter().fetchedColumns().statics.isEmpty() && !slices.selects(Clustering.STATIC_CLUSTERING); long size = serializedSlicesSize(slices, makeStaticSlice, metadata); size += TypeSizes.sizeof(command.clusteringIndexFilter().isReversed()); size += TypeSizes.sizeof(command.limits().count()); return size + TypeSizes.sizeof(0); // compositesToGroup }
private long serializedSliceCommandSize(SinglePartitionReadCommand command) { CFMetaData metadata = command.metadata(); ClusteringIndexSliceFilter filter = (ClusteringIndexSliceFilter)command.clusteringIndexFilter(); Slices slices = filter.requestedSlices(); boolean makeStaticSlice = !command.columnFilter().fetchedColumns().statics.isEmpty() && !slices.selects(Clustering.STATIC_CLUSTERING); long size = serializedSlicesSize(slices, makeStaticSlice, metadata); size += TypeSizes.sizeof(command.clusteringIndexFilter().isReversed()); size += TypeSizes.sizeof(command.limits().count()); return size + TypeSizes.sizeof(0); // compositesToGroup }