public static void writeWithLength(ByteBuffer bytes, DataOutputPlus out) throws IOException { out.writeInt(bytes.remaining()); out.write(bytes); }
public static void writeWithVIntLength(ByteBuffer bytes, DataOutputPlus out) throws IOException { out.writeUnsignedVInt(bytes.remaining()); out.write(bytes); }
public static void writeWithShortLength(ByteBuffer buffer, DataOutputPlus out) throws IOException { int length = buffer.remaining(); assert 0 <= length && length <= FBUtilities.MAX_UNSIGNED_SHORT : String.format("Attempted serializing to buffer exceeded maximum of %s bytes: %s", FBUtilities.MAX_UNSIGNED_SHORT, length); out.writeShort(length); out.write(buffer); }
public void serialize(ReadResponse response, DataOutputPlus out, int version) throws IOException { out.writeInt(response.isDigestQuery() ? response.digest().remaining() : 0); ByteBuffer buffer = response.isDigestQuery() ? response.digest() : ByteBufferUtil.EMPTY_BYTE_BUFFER; out.write(buffer); out.writeBoolean(response.isDigestQuery()); if (!response.isDigestQuery()) Row.serializer.serialize(response.row(), out, version); }
public void serialize(RepairMessage message, DataOutputPlus out, int version) throws IOException { out.write(message.messageType.type); message.messageType.serializer.serialize(message, out, version); }
@Override public void serialize(DataOutputPlus out, IndexInfo.Serializer idxInfoSerializer, ByteBuffer indexInfo) throws IOException { out.writeUnsignedVInt(position); out.writeUnsignedVInt(fieldsSerializedSize + indexInfo.limit()); out.writeUnsignedVInt(headerLength); DeletionTime.serializer.serialize(deletionTime, out); out.writeUnsignedVInt(columnsIndexCount); out.write(indexInfo); }
public static void writeWithShortLength(ByteBuffer buffer, DataOutputPlus out) throws IOException { int length = buffer.remaining(); assert 0 <= length && length <= FBUtilities.MAX_UNSIGNED_SHORT : String.format("Attempted serializing to buffer exceeded maximum of %s bytes: %s", FBUtilities.MAX_UNSIGNED_SHORT, length); out.writeShort(length); out.write(buffer); }
public void serialize(RepairMessage message, DataOutputPlus out, int version) throws IOException { out.write(message.messageType.type); message.messageType.serializer.serialize(message, out, version); }
public static void writeWithLength(ByteBuffer bytes, DataOutputPlus out) throws IOException { out.writeInt(bytes.remaining()); out.write(bytes); }
@Override public void serialize(DataOutputPlus out, IndexInfo.Serializer idxInfoSerializer, ByteBuffer indexInfo) throws IOException { out.writeUnsignedVInt(position); out.writeUnsignedVInt(fieldsSerializedSize + indexInfo.limit()); out.writeUnsignedVInt(headerLength); DeletionTime.serializer.serialize(deletionTime, out); out.writeUnsignedVInt(columnsIndexCount); out.write(indexInfo); }
public static void writeWithShortLength(ByteBuffer buffer, DataOutputPlus out) throws IOException { int length = buffer.remaining(); assert 0 <= length && length <= FBUtilities.MAX_UNSIGNED_SHORT : String.format("Attempted serializing to buffer exceeded maximum of %s bytes: %s", FBUtilities.MAX_UNSIGNED_SHORT, length); out.writeShort(length); out.write(buffer); }
protected void flushBuffer(ByteBuffer buffer, DataOutputPlus o, boolean align) throws IOException { // seek to end of last block before flushing if (align) alignBuffer(buffer, BLOCK_BYTES); buffer.flip(); o.write(buffer); buffer.clear(); }
@Override public void serialize(DataOutputPlus out, IndexInfo.Serializer idxInfoSerializer, ByteBuffer indexInfo) throws IOException { out.writeUnsignedVInt(position); out.writeUnsignedVInt(fieldsSerializedSize + indexInfo.limit()); out.writeUnsignedVInt(headerLength); DeletionTime.serializer.serialize(deletionTime, out); out.writeUnsignedVInt(columnsIndexCount); out.write(indexInfo); }
public void writeValue(ByteBuffer value, DataOutputPlus out) throws IOException { assert value.hasRemaining(); if (valueLengthIfFixed() >= 0) out.write(value); else ByteBufferUtil.writeWithVIntLength(value, out); }
@Override public void serialize(DataOutputPlus out, IndexInfo.Serializer idxInfoSerializer, ByteBuffer indexInfo) throws IOException { out.writeUnsignedVInt(position); out.writeUnsignedVInt(fieldsSerializedSize + indexInfo.limit()); out.writeUnsignedVInt(headerLength); DeletionTime.serializer.serialize(deletionTime, out); out.writeUnsignedVInt(columnsIndexCount); out.write(indexInfo); }
public void writeValue(ByteBuffer value, DataOutputPlus out) throws IOException { assert value.hasRemaining(); if (valueLengthIfFixed() >= 0) out.write(value); else ByteBufferUtil.writeWithVIntLength(value, out); }
public void serialize(EncodedHintMessage message, DataOutputPlus out, int version) throws IOException { if (version != message.version) throw new IllegalArgumentException("serialize() called with non-matching version " + version); UUIDSerializer.serializer.serialize(message.hostId, out, version); out.writeUnsignedVInt(message.hint.remaining()); out.write(message.hint); }
public void serialize(RowCacheKey key, DataOutputPlus out, ColumnFamilyStore cfs) throws IOException { assert(!cfs.isIndex());//Shouldn't have row cache entries for indexes out.write(cfs.metadata.ksAndCFBytes); ByteBufferUtil.writeWithLength(key.key, out); }
public void serialize(CounterCacheKey key, DataOutputPlus out, ColumnFamilyStore cfs) throws IOException { assert(cfs.metadata.isCounter()); out.write(cfs.metadata.ksAndCFBytes); ByteBufferUtil.writeWithLength(key.partitionKey, out); ByteBufferUtil.writeWithLength(key.cellName, out); }
public void serialize(CounterCacheKey key, DataOutputPlus out, ColumnFamilyStore cfs) throws IOException { assert(cfs.metadata.isCounter()); out.write(cfs.metadata.ksAndCFBytes); ByteBufferUtil.writeWithLength(key.partitionKey, out); ByteBufferUtil.writeWithLength(key.cellName, out); }