public ColumnSubselection deserialize(DataInputPlus in, int version, CFMetaData metadata) throws IOException { ByteBuffer name = ByteBufferUtil.readWithShortLength(in); ColumnDefinition column = metadata.getColumnDefinition(name); if (column == null) { // If we don't find the definition, it could be we have data for a dropped column, and we shouldn't // fail deserialization because of that. So we grab a "fake" ColumnDefinition that ensure proper // deserialization. The column will be ignore later on anyway. column = metadata.getDroppedColumnDefinition(name); if (column == null) throw new RuntimeException("Unknown column " + UTF8Type.instance.getString(name) + " during deserialization"); } Kind kind = Kind.values()[in.readUnsignedByte()]; switch (kind) { case SLICE: CellPath from = column.cellPathSerializer().deserialize(in); CellPath to = column.cellPathSerializer().deserialize(in); return new Slice(column, from, to); case ELEMENT: CellPath elt = column.cellPathSerializer().deserialize(in); return new Element(column, elt); } throw new AssertionError(); }
@Override public String toString() { // This assert we're dealing with a collection since that's the only thing it's used for so far. AbstractType<?> type = ((CollectionType<?>)column().type).nameComparator(); return String.format("[%s:%s]", from == CellPath.BOTTOM ? "" : type.getString(from.get(0)), to == CellPath.TOP ? "" : type.getString(to.get(0))); } }
public ColumnSubselection deserialize(DataInputPlus in, int version, CFMetaData metadata) throws IOException { ByteBuffer name = ByteBufferUtil.readWithShortLength(in); ColumnDefinition column = metadata.getColumnDefinition(name); if (column == null) { // If we don't find the definition, it could be we have data for a dropped column, and we shouldn't // fail deserialization because of that. So we grab a "fake" ColumnDefinition that ensure proper // deserialization. The column will be ignore later on anyway. column = metadata.getDroppedColumnDefinition(name); if (column == null) throw new RuntimeException("Unknown column " + UTF8Type.instance.getString(name) + " during deserialization"); } Kind kind = Kind.values()[in.readUnsignedByte()]; switch (kind) { case SLICE: CellPath from = column.cellPathSerializer().deserialize(in); CellPath to = column.cellPathSerializer().deserialize(in); return new Slice(column, from, to); case ELEMENT: CellPath elt = column.cellPathSerializer().deserialize(in); return new Element(column, elt); } throw new AssertionError(); }
public ColumnSubselection deserialize(DataInputPlus in, int version, CFMetaData metadata) throws IOException { ByteBuffer name = ByteBufferUtil.readWithShortLength(in); ColumnDefinition column = metadata.getColumnDefinition(name); if (column == null) { // If we don't find the definition, it could be we have data for a dropped column, and we shouldn't // fail deserialization because of that. So we grab a "fake" ColumnDefinition that ensure proper // deserialization. The column will be ignore later on anyway. column = metadata.getDroppedColumnDefinition(name); if (column == null) throw new RuntimeException("Unknown column " + UTF8Type.instance.getString(name) + " during deserialization"); } Kind kind = Kind.values()[in.readUnsignedByte()]; switch (kind) { case SLICE: CellPath from = column.cellPathSerializer().deserialize(in); CellPath to = column.cellPathSerializer().deserialize(in); return new Slice(column, from, to); case ELEMENT: CellPath elt = column.cellPathSerializer().deserialize(in); return new Element(column, elt); } throw new AssertionError(); }
public ColumnSubselection deserialize(DataInputPlus in, int version, CFMetaData metadata) throws IOException { ByteBuffer name = ByteBufferUtil.readWithShortLength(in); ColumnDefinition column = metadata.getColumnDefinition(name); if (column == null) { // If we don't find the definition, it could be we have data for a dropped column, and we shouldn't // fail deserialization because of that. So we grab a "fake" ColumnDefinition that ensure proper // deserialization. The column will be ignore later on anyway. column = metadata.getDroppedColumnDefinition(name); if (column == null) throw new RuntimeException("Unknown column " + UTF8Type.instance.getString(name) + " during deserialization"); } Kind kind = Kind.values()[in.readUnsignedByte()]; switch (kind) { case SLICE: CellPath from = column.cellPathSerializer().deserialize(in); CellPath to = column.cellPathSerializer().deserialize(in); return new Slice(column, from, to); case ELEMENT: CellPath elt = column.cellPathSerializer().deserialize(in); return new Element(column, elt); } throw new AssertionError(); }
public static ColumnSubselection slice(ColumnDefinition column, CellPath from, CellPath to) { assert column.isComplex() && column.type instanceof CollectionType; assert from.size() <= 1 && to.size() <= 1; return new Slice(column, from, to); }
public static ColumnSubselection slice(ColumnDefinition column, CellPath from, CellPath to) { assert column.isComplex() && column.type instanceof CollectionType; assert from.size() <= 1 && to.size() <= 1; return new Slice(column, from, to); }
public static ColumnSubselection slice(ColumnDefinition column, CellPath from, CellPath to) { assert column.isComplex() && column.type instanceof CollectionType; assert from.size() <= 1 && to.size() <= 1; return new Slice(column, from, to); }
public static ColumnSubselection slice(ColumnDefinition column, CellPath from, CellPath to) { assert column.isComplex() && column.type instanceof CollectionType; assert from.size() <= 1 && to.size() <= 1; return new Slice(column, from, to); }
@Override public String toString() { // This assert we're dealing with a collection since that's the only thing it's used for so far. AbstractType<?> type = ((CollectionType<?>)column().type).nameComparator(); return String.format("[%s:%s]", from == CellPath.BOTTOM ? "" : type.getString(from.get(0)), to == CellPath.TOP ? "" : type.getString(to.get(0))); } }
@Override public String toString() { // This assert we're dealing with a collection since that's the only thing it's used for so far. AbstractType<?> type = ((CollectionType<?>)column().type).nameComparator(); return String.format("[%s:%s]", from == CellPath.BOTTOM ? "" : type.getString(from.get(0)), to == CellPath.TOP ? "" : type.getString(to.get(0))); } }
@Override public String toString() { // This assert we're dealing with a collection since that's the only thing it's used for so far. AbstractType<?> type = ((CollectionType<?>)column().type).nameComparator(); return String.format("[%s:%s]", from == CellPath.BOTTOM ? "" : type.getString(from.get(0)), to == CellPath.TOP ? "" : type.getString(to.get(0))); } }