private static void addDroppedColumns(CFMetaData cfm, AbstractType<?> comparator, Map<String, Long> droppedTimes) { AbstractType<?> last = comparator.getComponents().get(comparator.componentsCount() - 1); Map<ByteBuffer, CollectionType> collections = last instanceof ColumnToCollectionType ? ((ColumnToCollectionType) last).defined : Collections.emptyMap(); for (Map.Entry<String, Long> entry : droppedTimes.entrySet()) { String name = entry.getKey(); ByteBuffer nameBytes = UTF8Type.instance.decompose(name); long time = entry.getValue(); AbstractType<?> type = collections.containsKey(nameBytes) ? collections.get(nameBytes) : BytesType.instance; cfm.getDroppedColumns().put(nameBytes, new CFMetaData.DroppedColumn(name, type, time)); } }
private static void addDroppedColumns(CFMetaData cfm, AbstractType<?> comparator, Map<String, Long> droppedTimes) { AbstractType<?> last = comparator.getComponents().get(comparator.componentsCount() - 1); Map<ByteBuffer, CollectionType> collections = last instanceof ColumnToCollectionType ? ((ColumnToCollectionType) last).defined : Collections.emptyMap(); for (Map.Entry<String, Long> entry : droppedTimes.entrySet()) { String name = entry.getKey(); ByteBuffer nameBytes = UTF8Type.instance.decompose(name); long time = entry.getValue(); AbstractType<?> type = collections.containsKey(nameBytes) ? collections.get(nameBytes) : BytesType.instance; cfm.getDroppedColumns().put(nameBytes, new CFMetaData.DroppedColumn(name, type, time)); } }
private static void addDroppedColumns(CFMetaData cfm, AbstractType<?> comparator, Map<String, Long> droppedTimes) { AbstractType<?> last = comparator.getComponents().get(comparator.componentsCount() - 1); Map<ByteBuffer, CollectionType> collections = last instanceof ColumnToCollectionType ? ((ColumnToCollectionType) last).defined : Collections.emptyMap(); for (Map.Entry<String, Long> entry : droppedTimes.entrySet()) { String name = entry.getKey(); ByteBuffer nameBytes = UTF8Type.instance.decompose(name); long time = entry.getValue(); AbstractType<?> type = collections.containsKey(nameBytes) ? collections.get(nameBytes) : BytesType.instance; cfm.getDroppedColumns().put(nameBytes, new CFMetaData.DroppedColumn(name, type, time)); } }
private static CFMetaData.DroppedColumn createDroppedColumnFromRow(UntypedResultSet.Row row) { String keyspace = row.getString("keyspace_name"); String name = row.getString("column_name"); /* * we never store actual UDT names in dropped column types (so that we can safely drop types if nothing refers to * them anymore), so before storing dropped columns in schema we expand UDTs to tuples. See expandUserTypes method. * Because of that, we can safely pass Types.none() to parse() */ AbstractType<?> type = parse(keyspace, row.getString("type"), org.apache.cassandra.schema.Types.none()); long droppedTime = TimeUnit.MILLISECONDS.toMicros(row.getLong("dropped_time")); return new CFMetaData.DroppedColumn(name, type, droppedTime); }
private static CFMetaData.DroppedColumn createDroppedColumnFromRow(UntypedResultSet.Row row) { String keyspace = row.getString("keyspace_name"); String name = row.getString("column_name"); /* * we never store actual UDT names in dropped column types (so that we can safely drop types if nothing refers to * them anymore), so before storing dropped columns in schema we expand UDTs to tuples. See expandUserTypes method. * Because of that, we can safely pass Types.none() to parse() */ AbstractType<?> type = parse(keyspace, row.getString("type"), org.apache.cassandra.schema.Types.none()); long droppedTime = TimeUnit.MILLISECONDS.toMicros(row.getLong("dropped_time")); return new CFMetaData.DroppedColumn(name, type, droppedTime); }
private static CFMetaData.DroppedColumn createDroppedColumnFromRow(UntypedResultSet.Row row) { String keyspace = row.getString("keyspace_name"); String name = row.getString("column_name"); /* * we never store actual UDT names in dropped column types (so that we can safely drop types if nothing refers to * them anymore), so before storing dropped columns in schema we expand UDTs to tuples. See expandUserTypes method. * Because of that, we can safely pass Types.none() to parse() */ AbstractType<?> type = parse(keyspace, row.getString("type"), org.apache.cassandra.schema.Types.none()); long droppedTime = TimeUnit.MILLISECONDS.toMicros(row.getLong("dropped_time")); return new CFMetaData.DroppedColumn(name, type, droppedTime); }
private static CFMetaData.DroppedColumn createDroppedColumnFromRow(Row row, String keyspace) { String name = row.getString("column_name"); AbstractType<?> type = CQLTypeParser.parse(keyspace, row.getString("type"), Types.none()); long droppedTime = TimeUnit.MILLISECONDS.toMicros(row.getTimestamp("dropped_time").getTime()); return new CFMetaData.DroppedColumn(name, type, droppedTime); } }
/** * Adds the column definition as a dropped column, recording the drop with the provided timestamp. */ public void recordColumnDrop(ColumnDefinition def, long timeMicros) { droppedColumns.put(def.name.bytes, new DroppedColumn(def.name.toString(), def.type, timeMicros)); }
private static CFMetaData.DroppedColumn createDroppedColumnFromRow(Row row, String keyspace) { String name = row.getString("column_name"); AbstractType<?> type = CQLTypeParser.parse(keyspace, row.getString("type"), Types.none()); long droppedTime = TimeUnit.MILLISECONDS.toMicros(row.getTimestamp("dropped_time").getTime()); return new CFMetaData.DroppedColumn(name, type, droppedTime); } }
private static CFMetaData.DroppedColumn createDroppedColumnFromRow(Row row, String keyspace) { String name = row.getString("column_name"); AbstractType<?> type = CQLTypeParser.parse(keyspace, row.getString("type"), Types.none()); long droppedTime = TimeUnit.MILLISECONDS.toMicros(row.getTimestamp("dropped_time").getTime()); return new CFMetaData.DroppedColumn(name, type, droppedTime); } }
/** * Adds the column definition as a dropped column, recording the drop with the provided timestamp. */ public void recordColumnDrop(ColumnDefinition def, long timeMicros) { droppedColumns.put(def.name.bytes, new DroppedColumn(def.name.toString(), def.type, timeMicros)); }
/** * Adds the column definition as a dropped column, recording the drop with the provided timestamp. */ public void recordColumnDrop(ColumnDefinition def, long timeMicros) { droppedColumns.put(def.name.bytes, new DroppedColumn(def.name.toString(), def.type, timeMicros)); }