org.apache.hadoop.hbase.migration.nineteen.onelab.filter
Class Key

java.lang.Object
  extended by org.apache.hadoop.hbase.migration.nineteen.onelab.filter.Key
All Implemented Interfaces:
Comparable, org.apache.hadoop.io.Writable, org.apache.hadoop.io.WritableComparable

public class Key
extends Object
implements org.apache.hadoop.io.WritableComparable

The general behavior of a key that must be stored in a filter.


Constructor Summary
Key()
          default constructor - use with readFields
Key(byte[] value)
          Constructor.
Key(byte[] value, double weight)
          Constructor.
 
Method Summary
 int compareTo(Object o)
           
 boolean equals(Object o)
           
 byte[] getBytes()
           
 double getWeight()
           
 int hashCode()
           
 void incrementWeight()
          Increments the weight of this key by one.
 void incrementWeight(double weight)
          Increments the weight of this key with a specified value.
 void readFields(DataInput in)
           
 void set(byte[] value, double weight)
           
 void write(DataOutput out)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Key

public Key()
default constructor - use with readFields


Key

public Key(byte[] value)
Constructor.

Builds a key with a default weight.

Parameters:
value - The byte value of this key.

Key

public Key(byte[] value,
           double weight)
Constructor.

Builds a key with a specified weight.

Parameters:
value - The value of this key.
weight - The weight associated to this key.
Method Detail

set

public void set(byte[] value,
                double weight)
Parameters:
value -
weight -

getBytes

public byte[] getBytes()
Returns:
byte[] The value of this key.

getWeight

public double getWeight()
Returns:
Returns the weight associated to this key.

incrementWeight

public void incrementWeight(double weight)
Increments the weight of this key with a specified value.

Parameters:
weight - The increment.

incrementWeight

public void incrementWeight()
Increments the weight of this key by one.


equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

write

public void write(DataOutput out)
           throws IOException
Specified by:
write in interface org.apache.hadoop.io.Writable
Throws:
IOException

readFields

public void readFields(DataInput in)
                throws IOException
Specified by:
readFields in interface org.apache.hadoop.io.Writable
Throws:
IOException

compareTo

public int compareTo(Object o)
Specified by:
compareTo in interface Comparable


Copyright © 2010 The Apache Software Foundation