elasticsearch-hadoop

org.elasticsearch.hadoop.hive
Class HiveBytesArrayWritable

java.lang.Object
  extended by org.apache.hadoop.io.BinaryComparable
      extended by 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.


Nested Class Summary
static class HiveBytesArrayWritable.Comparator
           
 
Constructor Summary
HiveBytesArrayWritable()
           
 
Method Summary
 boolean equals(Object right_obj)
          Are the two byte sequences equal?
 byte[] getBytes()
           
 org.elasticsearch.hadoop.util.BytesArray getContent()
           
 int getLength()
           
 int hashCode()
           
 void readFields(DataInput in)
           
 void setContent(org.elasticsearch.hadoop.util.BytesArray ba)
           
 String toString()
          Generate the stream of bytes as hex pairs separated by ' '.
 void write(DataOutput out)
           
 
Methods inherited from class org.apache.hadoop.io.BinaryComparable
compareTo, compareTo
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Constructor Detail

HiveBytesArrayWritable

public HiveBytesArrayWritable()
Method Detail

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

elasticsearch-hadoop