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 void serialize(ColumnSubselection subSel, DataOutputPlus out, int version) throws IOException { ColumnDefinition column = subSel.column(); ByteBufferUtil.writeWithShortLength(column.name.bytes, out); out.writeByte(subSel.kind().ordinal()); switch (subSel.kind()) { case SLICE: Slice slice = (Slice)subSel; column.cellPathSerializer().serialize(slice.from, out); column.cellPathSerializer().serialize(slice.to, out); break; case ELEMENT: Element eltSelection = (Element)subSel; column.cellPathSerializer().serialize(eltSelection.element, out); break; default: 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 void serialize(ColumnSubselection subSel, DataOutputPlus out, int version) throws IOException { ColumnDefinition column = subSel.column(); ByteBufferUtil.writeWithShortLength(column.name.bytes, out); out.writeByte(subSel.kind().ordinal()); switch (subSel.kind()) { case SLICE: Slice slice = (Slice)subSel; column.cellPathSerializer().serialize(slice.from, out); column.cellPathSerializer().serialize(slice.to, out); break; case ELEMENT: Element eltSelection = (Element)subSel; column.cellPathSerializer().serialize(eltSelection.element, out); break; default: throw new AssertionError(); } }
public void serialize(ColumnSubselection subSel, DataOutputPlus out, int version) throws IOException { ColumnDefinition column = subSel.column(); ByteBufferUtil.writeWithShortLength(column.name.bytes, out); out.writeByte(subSel.kind().ordinal()); switch (subSel.kind()) { case SLICE: Slice slice = (Slice)subSel; column.cellPathSerializer().serialize(slice.from, out); column.cellPathSerializer().serialize(slice.to, out); break; case ELEMENT: Element eltSelection = (Element)subSel; column.cellPathSerializer().serialize(eltSelection.element, out); break; default: throw new AssertionError(); } }
public void serialize(ColumnSubselection subSel, DataOutputPlus out, int version) throws IOException { ColumnDefinition column = subSel.column(); ByteBufferUtil.writeWithShortLength(column.name.bytes, out); out.writeByte(subSel.kind().ordinal()); switch (subSel.kind()) { case SLICE: Slice slice = (Slice)subSel; column.cellPathSerializer().serialize(slice.from, out); column.cellPathSerializer().serialize(slice.to, out); break; case ELEMENT: Element eltSelection = (Element)subSel; column.cellPathSerializer().serialize(eltSelection.element, out); break; default: throw new AssertionError(); } }