org.elasticsearch.hadoop.hive
Class HiveBytesArrayWritable
java.lang.Object
org.apache.hadoop.io.BinaryComparable
org.elasticsearch.hadoop.hive.HiveBytesArrayWritable
- All Implemented Interfaces:
- Comparable<BinaryComparable>, Writable, WritableComparable<BinaryComparable>
public class HiveBytesArrayWritable
- extends BinaryComparable
- implements WritableComparable<BinaryComparable>
Replacement of BytesWritable
that allows direct access to the underlying byte array without copying.
Used to wrap already json serialized hive entities.
HiveBytesArrayWritable
public HiveBytesArrayWritable()
getLength
public int getLength()
- Specified by:
getLength
in class BinaryComparable
getBytes
public byte[] getBytes()
- Specified by:
getBytes
in class BinaryComparable
setContent
public void setContent(org.elasticsearch.hadoop.util.BytesArray ba)
getContent
public org.elasticsearch.hadoop.util.BytesArray getContent()
readFields
public void readFields(DataInput in)
throws IOException
- Specified by:
readFields
in interface Writable
- Throws:
IOException
write
public void write(DataOutput out)
throws IOException
- Specified by:
write
in interface Writable
- Throws:
IOException
equals
public boolean equals(Object right_obj)
- Are the two byte sequences equal?
- Overrides:
equals
in class BinaryComparable
hashCode
public int hashCode()
- Overrides:
hashCode
in class BinaryComparable
toString
public String toString()
- Generate the stream of bytes as hex pairs separated by ' '.
- Overrides:
toString
in class Object