Modifier and Type | Field and Description |
---|---|
protected DataFactory |
dataFactory |
static int |
PROTOCOL_VERSION |
Constructor and Description |
---|
ChunkImpl(String dataType,
String streamName,
long seq,
byte[] data,
Adaptor source) |
Modifier and Type | Method and Description |
---|---|
void |
addTag(String tags)
Add tag.
|
static ChunkImpl |
getBlankChunk() |
byte[] |
getData() |
String |
getDataType() |
String |
getDebugInfo() |
Adaptor |
getInitiator()
Retrieve a reference to the adaptor that sent this event.
|
int |
getLength() |
int |
getProtocolVersion() |
int[] |
getRecordOffsets()
get/set the end offsets of records in the buffer.
|
long |
getSeqID() |
int |
getSerializedSizeEstimate()
Estimate the size of this Chunk on the wire, assuming each char of metadata
takes two bytes to serialize.
|
String |
getSource() |
String |
getStreamName()
Get the name of the stream that this Chunk is a chunk of
|
String |
getTag(String tagName)
Returns the value of a single tag, assuming tags are of the form
tagname="val"
|
String |
getTags() |
static ChunkImpl |
read(DataInput in) |
void |
readFields(DataInput in) |
void |
setData(byte[] logEvent) |
void |
setDataType(String t) |
void |
setDebugInfo(String a) |
static void |
setHostAddress(String host) |
void |
setInitiator(Adaptor a) |
void |
setLogSource() |
void |
setProtocolVersion(int pv) |
void |
setRecordOffsets(Collection<Integer> carriageReturns) |
void |
setRecordOffsets(int[] offsets) |
void |
setSeqID(long l) |
void |
setSource(String logSource) |
void |
setStreamName(String logApplication) |
String |
toString() |
void |
write(DataOutput out) |
public static int PROTOCOL_VERSION
protected DataFactory dataFactory
public static void setHostAddress(String host)
public static ChunkImpl getBlankChunk()
public byte[] getData()
getData
in interface Chunk
Chunk.getData()
public void setData(byte[] logEvent)
setData
in interface Chunk
logEvent
- the user data in the chunkChunk.setData(byte[])
public String getStreamName()
Chunk
getStreamName
in interface Chunk
Chunk.getStreamName()
public void setStreamName(String logApplication)
setStreamName
in interface Chunk
public String getDebugInfo()
public void setDebugInfo(String a)
public long getSeqID()
getSeqID
in interface Chunk
Chunk.getSeqID()
public int getProtocolVersion()
public void setProtocolVersion(int pv)
public Adaptor getInitiator()
Chunk
getInitiator
in interface Chunk
public void setInitiator(Adaptor a)
public void setLogSource()
public int[] getRecordOffsets()
Chunk
getRecordOffsets
in interface Chunk
public void setRecordOffsets(int[] offsets)
setRecordOffsets
in interface Chunk
public String getDataType()
getDataType
in interface Chunk
public void setDataType(String t)
setDataType
in interface Chunk
public String getTags()
getTags
in interface Chunk
Chunk.getTags()
public String getTag(String tagName)
Chunk
getTag
in interface Chunk
tagName
- the tag to returnChunk.getTag(java.lang.String)
public void readFields(DataInput in) throws IOException
readFields
in interface org.apache.hadoop.io.Writable
IOException
Writable.readFields(java.io.DataInput)
public void write(DataOutput out) throws IOException
write
in interface Chunk
write
in interface org.apache.hadoop.io.Writable
IOException
Writable.write(java.io.DataOutput)
public static ChunkImpl read(DataInput in) throws IOException
IOException
public int getSerializedSizeEstimate()
Chunk
getSerializedSizeEstimate
in interface Chunk
Chunk.getSerializedSizeEstimate()
public void setRecordOffsets(Collection<Integer> carriageReturns)
public int getLength()
Copyright © 2014 Apache Software Foundation. All Rights Reserved.