public static boolean hasEmptyCompactValue(CFMetaData metadata) { return metadata.compactValueColumn().type instanceof EmptyType; }
private static ColumnDefinition makeDefinition(CFMetaData metadata, ByteBuffer name) { ColumnDefinition def = metadata.getColumnDefinition(name); if (def != null) return def; // In thrift, we actually allow expression on non-defined columns for the sake of filtering. To accomodate // this we create a "fake" definition. This is messy but it works so is probably good enough. return ColumnDefinition.regularDef(metadata, name, metadata.compactValueColumn().type); }
public AbstractType<?> makeLegacyDefaultValidator() { if (isCounter()) return CounterColumnType.instance; else if (isCompactTable()) return isSuper() ? ((MapType)compactValueColumn().type).valueComparator() : compactValueColumn().type; else return BytesType.instance; }
public AbstractType<?> makeLegacyDefaultValidator() { if (isCounter()) return CounterColumnType.instance; else if (isCompactTable()) return isSuper() ? ((MapType)compactValueColumn().type).valueComparator() : compactValueColumn().type; else return BytesType.instance; }
private static ColumnDefinition makeDefinition(CFMetaData metadata, ByteBuffer name) { ColumnDefinition def = metadata.getColumnDefinition(name); if (def != null) return def; // In thrift, we actually allow expression on non-defined columns for the sake of filtering. To accomodate // this we create a "fake" definition. This is messy but it works so is probably good enough. return ColumnDefinition.regularDef(metadata, name, metadata.compactValueColumn().type); }
public AbstractType<?> makeLegacyDefaultValidator() { return isCounter() ? CounterColumnType.instance : (isCompactTable() ? compactValueColumn().type : BytesType.instance); }
private static ColumnDefinition makeDefinition(CFMetaData metadata, ByteBuffer name) { ColumnDefinition def = metadata.getColumnDefinition(name); if (def != null) return def; // In thrift, we actually allow expression on non-defined columns for the sake of filtering. To accomodate // this we create a "fake" definition. This is messy but it works so is probably good enough. return ColumnDefinition.regularDef(metadata, name, metadata.compactValueColumn().type); }
public AbstractType<?> thriftColumnNameType() { if (isSuper()) { ColumnDefinition def = compactValueColumn(); assert def != null && def.type instanceof MapType; return ((MapType)def.type).nameComparator(); } assert isStaticCompactTable(); return clusteringColumns.get(0).type; }
public AbstractType<?> thriftColumnNameType() { if (isSuper()) { ColumnDefinition def = compactValueColumn(); assert def != null && def.type instanceof MapType; return ((MapType)def.type).nameComparator(); } assert isStaticCompactTable(); return clusteringColumns.get(0).type; }
private static LegacyCellName decodeForSuperColumn(CFMetaData metadata, Clustering clustering, ByteBuffer subcol) { ColumnDefinition def = metadata.getColumnDefinition(subcol); if (def != null) { // it's a statically defined subcolumn return new LegacyCellName(clustering, def, null); } def = metadata.compactValueColumn(); assert def != null && def.type instanceof MapType; return new LegacyCellName(clustering, def, subcol); }
public boolean isSatisfiedBy(CFMetaData metadata, DecoratedKey partitionKey, Row row) { assert value != null; // On thrift queries, even if the column expression is a "static" one, we'll have convert it as a "dynamic" // one in ThriftResultsMerger, so we always expect it to be a dynamic one. Further, we expect this is only // called when the row clustering does match the column (see ThriftFilter above). assert row.clustering().equals(makeCompactClustering(metadata, column.name.bytes)); Cell cell = row.getCell(metadata.compactValueColumn()); return cell != null && operator.isSatisfiedBy(column.type, cell.value(), value); }
public boolean isSatisfiedBy(CFMetaData metadata, DecoratedKey partitionKey, Row row) { assert value != null; // On thrift queries, even if the column expression is a "static" one, we'll have convert it as a "dynamic" // one in ThriftResultsMerger, so we always expect it to be a dynamic one. Further, we expect this is only // called when the row clustering does match the column (see ThriftFilter above). assert row.clustering().equals(makeCompactClustering(metadata, column.name.bytes)); Cell cell = row.getCell(metadata.compactValueColumn()); return cell != null && operator.isSatisfiedBy(column.type, cell.value(), value); }
private static LegacyCellName decodeForSuperColumn(CFMetaData metadata, Clustering clustering, ByteBuffer subcol) { ColumnDefinition def = metadata.getColumnDefinition(subcol); if (def != null) { // it's a statically defined subcolumn return new LegacyCellName(clustering, def, null); } def = metadata.compactValueColumn(); assert def != null && def.type instanceof MapType; return new LegacyCellName(clustering, def, subcol); }
public boolean isSatisfiedBy(CFMetaData metadata, DecoratedKey partitionKey, Row row) { assert value != null; // On thrift queries, even if the column expression is a "static" one, we'll have convert it as a "dynamic" // one in ThriftResultsMerger, so we always expect it to be a dynamic one. Further, we expect this is only // called when the row clustering does match the column (see ThriftFilter above). assert row.clustering().equals(makeCompactClustering(metadata, column.name.bytes)); Cell cell = row.getCell(metadata.compactValueColumn()); return cell != null && operator.isSatisfiedBy(column.type, cell.value(), value); }
private SuperColumnsPartitionMerger(UnfilteredRowIterator applyTo, int nowInSec) { assert applyTo.metadata().isSuper(); this.nowInSec = nowInSec; this.superColumnMapColumn = applyTo.metadata().compactValueColumn(); assert superColumnMapColumn != null && superColumnMapColumn.type instanceof MapType; this.builder = BTreeRow.sortedBuilder(); this.columnComparator = ((MapType)superColumnMapColumn.type).nameComparator(); }
public void addRowDeletion() { // For compact tables, at the exclusion of the static row (of static compact tables), each row ever has a single column, // the "compact" one. As such, deleting the row or deleting that single cell is equivalent. We favor the later however // because that makes it easier when translating back to the old format layout (for thrift and pre-3.0 backward // compatibility) as we don't have to special case for the row deletion. This is also in line with what we used to do pre-3.0. if (metadata.isCompactTable() && builder.clustering() != Clustering.STATIC_CLUSTERING) addTombstone(metadata.compactValueColumn()); else builder.addRowDeletion(Row.Deletion.regular(deletionTime)); }
private SuperColumnsPartitionMerger(UnfilteredRowIterator applyTo, int nowInSec) { assert applyTo.metadata().isSuper(); this.nowInSec = nowInSec; this.superColumnMapColumn = applyTo.metadata().compactValueColumn(); assert superColumnMapColumn != null && superColumnMapColumn.type instanceof MapType; this.builder = BTreeRow.sortedBuilder(); this.columnComparator = ((MapType)superColumnMapColumn.type).nameComparator(); }
public void addRowDeletion() { // For compact tables, at the exclusion of the static row (of static compact tables), each row ever has a single column, // the "compact" one. As such, deleting the row or deleting that single cell is equivalent. We favor the later however // because that makes it easier when translating back to the old format layout (for thrift and pre-3.0 backward // compatibility) as we don't have to special case for the row deletion. This is also in line with what we used to do pre-3.0. if (metadata.isCompactTable() && builder.clustering() != Clustering.STATIC_CLUSTERING && !metadata.isSuper()) addTombstone(metadata.compactValueColumn()); else builder.addRowDeletion(Row.Deletion.regular(deletionTime)); }
public void addRowDeletion() { // For compact tables, at the exclusion of the static row (of static compact tables), each row ever has a single column, // the "compact" one. As such, deleting the row or deleting that single cell is equivalent. We favor the later however // because that makes it easier when translating back to the old format layout (for thrift and pre-3.0 backward // compatibility) as we don't have to special case for the row deletion. This is also in line with what we used to do pre-3.0. if (metadata.isCompactTable() && builder.clustering() != Clustering.STATIC_CLUSTERING && !metadata.isSuper()) addTombstone(metadata.compactValueColumn()); else builder.addRowDeletion(Row.Deletion.regular(deletionTime)); }
public void addRowDeletion() { // For compact tables, at the exclusion of the static row (of static compact tables), each row ever has a single column, // the "compact" one. As such, deleting the row or deleting that single cell is equivalent. We favor the later however // because that makes it easier when translating back to the old format layout (for thrift and pre-3.0 backward // compatibility) as we don't have to special case for the row deletion. This is also in line with what we used to do pre-3.0. if (metadata.isCompactTable() && builder.clustering() != Clustering.STATIC_CLUSTERING && !metadata.isSuper()) addTombstone(metadata.compactValueColumn()); else builder.addRowDeletion(Row.Deletion.regular(deletionTime)); }