org.apache.hadoop.hive.ql.io
Class HiveKey

java.lang.Object
  extended by org.apache.hadoop.io.BinaryComparable
      extended by org.apache.hadoop.io.BytesWritable
          extended by org.apache.hadoop.hive.ql.io.HiveKey
All Implemented Interfaces:
Comparable<org.apache.hadoop.io.BinaryComparable>, org.apache.hadoop.io.Writable, org.apache.hadoop.io.WritableComparable<org.apache.hadoop.io.BinaryComparable>

public class HiveKey
extends org.apache.hadoop.io.BytesWritable

HiveKey is a simple wrapper on Text which allows us to set the hashCode easily. hashCode is used for hadoop partitioner.


Nested Class Summary
static class HiveKey.Comparator
          A Comparator optimized for HiveKey.
 
Constructor Summary
HiveKey()
           
HiveKey(byte[] bytes, int hashcode)
           
 
Method Summary
 int getDistKeyLength()
           
 int hashCode()
           
 void setDistKeyLength(int distKeyLength)
           
 void setHashCode(int myHashCode)
           
 
Methods inherited from class org.apache.hadoop.io.BytesWritable
copyBytes, equals, get, getBytes, getCapacity, getLength, getSize, readFields, set, set, setCapacity, setSize, toString, write
 
Methods inherited from class org.apache.hadoop.io.BinaryComparable
compareTo, compareTo
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Constructor Detail

HiveKey

public HiveKey()

HiveKey

public HiveKey(byte[] bytes,
               int hashcode)
Method Detail

setHashCode

public void setHashCode(int myHashCode)

hashCode

public int hashCode()
Overrides:
hashCode in class org.apache.hadoop.io.BytesWritable

setDistKeyLength

public void setDistKeyLength(int distKeyLength)

getDistKeyLength

public int getDistKeyLength()


Copyright © 2014 The Apache Software Foundation. All rights reserved.