/** * Returns a "fake" ColumnDefinition corresponding to the dropped column {@code name} * of {@code null} if there is no such dropped column. * * @param name - the column name * @param isStatic - whether the column was a static column, if known */ public ColumnDefinition getDroppedColumnDefinition(ByteBuffer name, boolean isStatic) { DroppedColumn dropped = droppedColumns.get(name); if (dropped == null) return null; // We need the type for deserialization purpose. If we don't have the type however, // it means that it's a dropped column from before 3.0, and in that case using // BytesType is fine for what we'll be using it for, even if that's a hack. AbstractType<?> type = dropped.type == null ? BytesType.instance : dropped.type; return isStatic ? ColumnDefinition.staticDef(this, name, type) : ColumnDefinition.regularDef(this, name, type); }
/** * Returns a "fake" ColumnDefinition corresponding to the dropped column {@code name} * of {@code null} if there is no such dropped column. * * @param name - the column name * @param isStatic - whether the column was a static column, if known */ public ColumnDefinition getDroppedColumnDefinition(ByteBuffer name, boolean isStatic) { DroppedColumn dropped = droppedColumns.get(name); if (dropped == null) return null; // We need the type for deserialization purpose. If we don't have the type however, // it means that it's a dropped column from before 3.0, and in that case using // BytesType is fine for what we'll be using it for, even if that's a hack. AbstractType<?> type = dropped.type == null ? BytesType.instance : dropped.type; return isStatic ? ColumnDefinition.staticDef(this, name, type) : ColumnDefinition.regularDef(this, name, type); }
private List<ColumnDefinition> getColumns(CFMetaData cfm) { List<ColumnDefinition> columnDefs = new ArrayList<>(columns.size()); Integer componentIndex = comparator.isCompound() ? comparator.clusteringPrefixSize() : null; for (Map.Entry<ColumnIdentifier, AbstractType> col : columns.entrySet()) { ColumnIdentifier id = col.getKey(); columnDefs.add(staticColumns.contains(id) ? ColumnDefinition.staticDef(cfm, col.getKey().bytes, col.getValue(), componentIndex) : ColumnDefinition.regularDef(cfm, col.getKey().bytes, col.getValue(), componentIndex)); } return columnDefs; }
/** * Returns a "fake" ColumnDefinition corresponding to the dropped column {@code name} * of {@code null} if there is no such dropped column. * * @param name - the column name * @param isStatic - whether the column was a static column, if known */ public ColumnDefinition getDroppedColumnDefinition(ByteBuffer name, boolean isStatic) { DroppedColumn dropped = droppedColumns.get(name); if (dropped == null) return null; // We need the type for deserialization purpose. If we don't have the type however, // it means that it's a dropped column from before 3.0, and in that case using // BytesType is fine for what we'll be using it for, even if that's a hack. AbstractType<?> type = dropped.type == null ? BytesType.instance : dropped.type; return isStatic ? ColumnDefinition.staticDef(this, name, type) : ColumnDefinition.regularDef(this, name, type); }
/** * Returns a "fake" ColumnDefinition corresponding to the dropped column {@code name} * of {@code null} if there is no such dropped column. * * @param name - the column name * @param isStatic - whether the column was a static column, if known */ public ColumnDefinition getDroppedColumnDefinition(ByteBuffer name, boolean isStatic) { DroppedColumn dropped = droppedColumns.get(name); if (dropped == null) return null; // We need the type for deserialization purpose. If we don't have the type however, // it means that it's a dropped column from before 3.0, and in that case using // BytesType is fine for what we'll be using it for, even if that's a hack. AbstractType<?> type = dropped.type == null ? BytesType.instance : dropped.type; return isStatic ? ColumnDefinition.staticDef(this, name, type) : ColumnDefinition.regularDef(this, name, type); }
? ColumnDefinition.staticDef(cfm, columnName.bytes, type) : ColumnDefinition.regularDef(cfm, columnName.bytes, type));
? ColumnDefinition.staticDef(cfm, columnName.bytes, type) : ColumnDefinition.regularDef(cfm, columnName.bytes, type));
? ColumnDefinition.staticDef(cfm, columnName.bytes, type) : ColumnDefinition.regularDef(cfm, columnName.bytes, type));
? ColumnDefinition.staticDef(cfm, columnName.bytes, type, componentIndex) : ColumnDefinition.regularDef(cfm, columnName.bytes, type, componentIndex)); break;