Class 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  
    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • EMPTY_BYTE_BUFFER

        public static final java.nio.ByteBuffer EMPTY_BYTE_BUFFER
    • Constructor Detail

      • WriterChunkingHelper

        public WriterChunkingHelper()
    • 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 input
        payload - serialized payload could be value bytes or RMD bytes.
        schemaId - value schema ID
        isChunkAwareCallback - boolean flag indicating whether to create chunk
        sizeReport - supplier function for size report.
        maxSizeForUserPayloadPerMessageInBytes - maximum size for payload in a message
        keyWithChunkingSuffixSerializer - Chuncking suffix serializer for key
        sendMessageFunction - Pass in function for sending message
        Returns:
        Chunked payload arrays and manifest.