public ReadCommand deserialize(DataInputPlus in, int version) throws IOException { assert version < MessagingService.VERSION_30; LegacyType msgType = LegacyType.fromSerializedValue(in.readByte()); boolean isDigest = in.readBoolean(); String keyspaceName = in.readUTF(); ByteBuffer key = ByteBufferUtil.readWithShortLength(in); String cfName = in.readUTF(); long nowInMillis = in.readLong(); int nowInSeconds = (int) (nowInMillis / 1000); // convert from millis to seconds CFMetaData metadata = Schema.instance.getCFMetaData(keyspaceName, cfName); DecoratedKey dk = metadata.partitioner.decorateKey(key); switch (msgType) { case GET_BY_NAMES: return deserializeNamesCommand(in, isDigest, metadata, dk, nowInSeconds, version); case GET_SLICES: return deserializeSliceCommand(in, isDigest, metadata, dk, nowInSeconds, version); default: throw new AssertionError(); } }
public ReadCommand deserialize(DataInputPlus in, int version) throws IOException { assert version < MessagingService.VERSION_30; LegacyType msgType = LegacyType.fromSerializedValue(in.readByte()); boolean isDigest = in.readBoolean(); String keyspaceName = in.readUTF(); ByteBuffer key = ByteBufferUtil.readWithShortLength(in); String cfName = in.readUTF(); long nowInMillis = in.readLong(); int nowInSeconds = (int) (nowInMillis / 1000); // convert from millis to seconds CFMetaData metadata = Schema.instance.getCFMetaData(keyspaceName, cfName); DecoratedKey dk = metadata.partitioner.decorateKey(key); switch (msgType) { case GET_BY_NAMES: return deserializeNamesCommand(in, isDigest, metadata, dk, nowInSeconds, version); case GET_SLICES: return deserializeSliceCommand(in, isDigest, metadata, dk, nowInSeconds, version); default: throw new AssertionError(); } }
public ReadCommand deserialize(DataInputPlus in, int version) throws IOException { assert version < MessagingService.VERSION_30; LegacyType msgType = LegacyType.fromSerializedValue(in.readByte()); boolean isDigest = in.readBoolean(); String keyspaceName = in.readUTF(); ByteBuffer key = ByteBufferUtil.readWithShortLength(in); String cfName = in.readUTF(); long nowInMillis = in.readLong(); int nowInSeconds = (int) (nowInMillis / 1000); // convert from millis to seconds CFMetaData metadata = Schema.instance.getCFMetaData(keyspaceName, cfName); DecoratedKey dk = metadata.partitioner.decorateKey(key); switch (msgType) { case GET_BY_NAMES: return deserializeNamesCommand(in, isDigest, metadata, dk, nowInSeconds, version); case GET_SLICES: return deserializeSliceCommand(in, isDigest, metadata, dk, nowInSeconds, version); default: throw new AssertionError(); } }