Class Chunk

  • All Implemented Interfaces:
    java.io.Externalizable , java.io.Serializable , java.lang.Comparable , org.apache.avro.generic.GenericContainer , org.apache.avro.generic.GenericRecord , org.apache.avro.generic.IndexedRecord , org.apache.avro.specific.SpecificRecord

    
    public class Chunk
    extends SpecificRecordBase implements SpecificRecord
                        

    Binary chunk of a larger binary artifact

    • Constructor Detail

      • Chunk

        Chunk()
        Default constructor.
      • Chunk

        Chunk(String requestId, SecureHash checksum, Integer partNumber, Long offset, ByteBuffer data, KeyValuePairList properties)
        All-args constructor.
        Parameters:
        requestId - some unique identifier that indicates the group this chunk belongs with
        checksum - checksum of assembled chunks
        partNumber - number of chunk
        offset - offset of this chunk from beginning of complete binary artifact
        data - the binary data fop the chunk.
        properties - Optional list of chunk properties.
    • Method Detail

      • setRequestId

         void setRequestId(String value)

        Sets the value of the 'requestId' field. some unique identifier that indicates the group this chunk belongs with

        Parameters:
        value - the value to set.
      • setChecksum

         void setChecksum(SecureHash value)

        Sets the value of the 'checksum' field. checksum of assembled chunks

        Parameters:
        value - the value to set.
      • getPartNumber

         int getPartNumber()

        Gets the value of the 'partNumber' field.

      • setPartNumber

         void setPartNumber(int value)

        Sets the value of the 'partNumber' field. number of chunk

        Parameters:
        value - the value to set.
      • getOffset

         long getOffset()

        Gets the value of the 'offset' field.

      • setOffset

         void setOffset(long value)

        Sets the value of the 'offset' field. offset of this chunk from beginning of complete binary artifact

        Parameters:
        value - the value to set.
      • setData

         void setData(ByteBuffer value)

        Sets the value of the 'data' field. the binary data fop the chunk. Zero data has a special meaning, signaling the last chunk in the sequence

        Parameters:
        value - the value to set.
      • setProperties

         void setProperties(KeyValuePairList value)

        Sets the value of the 'properties' field. Optional list of chunk properties.

        Parameters:
        value - the value to set.
      • getEncoder

         static BinaryMessageEncoder<Chunk> getEncoder()

        Return the BinaryMessageEncoder instance used by this class.

      • getDecoder

         static BinaryMessageDecoder<Chunk> getDecoder()

        Return the BinaryMessageDecoder instance used by this class.

      • createDecoder

         static BinaryMessageDecoder<Chunk> createDecoder(SchemaStore resolver)

        Create a new BinaryMessageDecoder instance for this class that uses the specified SchemaStore.

        Parameters:
        resolver - a SchemaStore used to find schemas by fingerprint
      • fromByteBuffer

         static Chunk fromByteBuffer(ByteBuffer b)

        Deserializes a Chunk from a ByteBuffer.

        Parameters:
        b - a byte buffer holding serialized data for an instance of this class
      • newBuilder

         static Chunk.Builder newBuilder(Chunk.Builder other)

        Creates a new Chunk RecordBuilder by copying an existing Builder.

        Parameters:
        other - The existing builder to copy.
      • newBuilder

         static Chunk.Builder newBuilder(Chunk other)

        Creates a new Chunk RecordBuilder by copying an existing Chunk instance.

        Parameters:
        other - The existing instance to copy.