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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public class
Chunk.Builder
RecordBuilder for Chunk instances.
-
Field Summary
Fields Modifier and Type Field Description public final static Schema
SCHEMA$
public String
requestId
public SecureHash
checksum
public int
partNumber
public long
offset
public ByteBuffer
data
public KeyValuePairList
properties
-
Constructor Summary
Constructors Constructor Description Chunk()
Default constructor. Chunk(String requestId, SecureHash checksum, Integer partNumber, Long offset, ByteBuffer data, KeyValuePairList properties)
All-args constructor.
-
Method Summary
Modifier and Type Method Description String
getRequestId()
Gets the value of the 'requestId' field. void
setRequestId(String value)
Sets the value of the 'requestId' field. SecureHash
getChecksum()
Gets the value of the 'checksum' field. void
setChecksum(SecureHash value)
Sets the value of the 'checksum' field. int
getPartNumber()
Gets the value of the 'partNumber' field. void
setPartNumber(int value)
Sets the value of the 'partNumber' field. long
getOffset()
Gets the value of the 'offset' field. void
setOffset(long value)
Sets the value of the 'offset' field. ByteBuffer
getData()
Gets the value of the 'data' field. void
setData(ByteBuffer value)
Sets the value of the 'data' field. KeyValuePairList
getProperties()
Gets the value of the 'properties' field. void
setProperties(KeyValuePairList value)
Sets the value of the 'properties' field. static Schema
getClassSchema()
static BinaryMessageEncoder<Chunk>
getEncoder()
Return the BinaryMessageEncoder instance used by this class. static BinaryMessageDecoder<Chunk>
getDecoder()
Return the BinaryMessageDecoder instance used by this class. static BinaryMessageDecoder<Chunk>
createDecoder(SchemaStore resolver)
Create a new BinaryMessageDecoder instance for this class that uses the specified SchemaStore. ByteBuffer
toByteBuffer()
Serializes this Chunk to a ByteBuffer. static Chunk
fromByteBuffer(ByteBuffer b)
Deserializes a Chunk from a ByteBuffer. SpecificData
getSpecificData()
Schema
getSchema()
Object
get(int field$)
void
put(int field$, Object value$)
static Chunk.Builder
newBuilder()
Creates a new Chunk RecordBuilder. static Chunk.Builder
newBuilder(Chunk.Builder other)
Creates a new Chunk RecordBuilder by copying an existing Builder. static Chunk.Builder
newBuilder(Chunk other)
Creates a new Chunk RecordBuilder by copying an existing Chunk instance. void
writeExternal(ObjectOutput out)
void
readExternal(ObjectInput in)
void
customEncode(Encoder out)
void
customDecode(ResolvingDecoder in)
-
Methods inherited from class org.apache.avro.specific.SpecificRecordBase
compareTo, equals, getConversion, hashCode, toString
-
Methods inherited from class org.apache.avro.generic.GenericRecord
hasField
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
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 withchecksum
- checksum of assembled chunkspartNumber
- number of chunkoffset
- offset of this chunk from beginning of complete binary artifactdata
- the binary data fop the chunk.properties
- Optional list of chunk properties.
-
-
Method Detail
-
getRequestId
String getRequestId()
Gets the value of the 'requestId' field.
-
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.
-
getChecksum
SecureHash getChecksum()
Gets the value of the 'checksum' field.
-
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.
-
getData
ByteBuffer getData()
Gets the value of the 'data' field.
-
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.
-
getProperties
KeyValuePairList getProperties()
Gets the value of the 'properties' field.
-
setProperties
void setProperties(KeyValuePairList value)
Sets the value of the 'properties' field. Optional list of chunk properties.
- Parameters:
value
- the value to set.
-
getClassSchema
static Schema getClassSchema()
-
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
-
toByteBuffer
ByteBuffer toByteBuffer()
Serializes this Chunk to a ByteBuffer.
-
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
-
getSpecificData
SpecificData getSpecificData()
-
getSchema
Schema getSchema()
-
newBuilder
static Chunk.Builder newBuilder()
Creates a new Chunk RecordBuilder.
-
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.
-
writeExternal
void writeExternal(ObjectOutput out)
-
readExternal
void readExternal(ObjectInput in)
-
customEncode
void customEncode(Encoder out)
-
customDecode
void customDecode(ResolvingDecoder in)
-
-
-
-