Package com.linkedin.venice.writer
Class WriterChunkingHelper
- java.lang.Object
-
- com.linkedin.venice.writer.WriterChunkingHelper
-
public class WriterChunkingHelper extends java.lang.Object
This class is a helper class that contains writer side chunking logics.
-
-
Field Summary
Fields Modifier and Type Field Description static java.nio.ByteBuffer
EMPTY_BYTE_BUFFER
-
Constructor Summary
Constructors Constructor Description WriterChunkingHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ChunkedPayloadAndManifest
chunkPayloadAndSend(byte[] serializedKey, byte[] payload, boolean isValuePayload, int schemaId, int chunkedKeySuffixStartingIndex, boolean isChunkAwareCallback, java.util.function.Supplier<java.lang.String> sizeReport, int maxSizeForUserPayloadPerMessageInBytes, KeyWithChunkingSuffixSerializer keyWithChunkingSuffixSerializer, java.util.function.BiConsumer<VeniceWriter.KeyProvider,Put> sendMessageFunction)
This method chunks payload and send each chunk out.
-
-
-
Method Detail
-
chunkPayloadAndSend
public static ChunkedPayloadAndManifest chunkPayloadAndSend(byte[] serializedKey, byte[] payload, boolean isValuePayload, int schemaId, int chunkedKeySuffixStartingIndex, boolean isChunkAwareCallback, java.util.function.Supplier<java.lang.String> sizeReport, int maxSizeForUserPayloadPerMessageInBytes, KeyWithChunkingSuffixSerializer keyWithChunkingSuffixSerializer, java.util.function.BiConsumer<VeniceWriter.KeyProvider,Put> sendMessageFunction)
This method chunks payload and send each chunk out.- Parameters:
serializedKey
- serialized key inputpayload
- serialized payload could be value bytes or RMD bytes.schemaId
- value schema IDisChunkAwareCallback
- boolean flag indicating whether to create chunksizeReport
- supplier function for size report.maxSizeForUserPayloadPerMessageInBytes
- maximum size for payload in a messagekeyWithChunkingSuffixSerializer
- Chunking suffix serializer for keysendMessageFunction
- Pass in function for sending message- Returns:
- Chunked payload arrays and manifest.
-
-