org.apache.accumulo.core.data
Class Key

java.lang.Object
  extended by org.apache.accumulo.core.data.Key
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable<Key>, org.apache.hadoop.io.Writable, org.apache.hadoop.io.WritableComparable<Key>

public class Key
extends java.lang.Object
implements org.apache.hadoop.io.WritableComparable<Key>, java.lang.Cloneable


Field Summary
protected  byte[] colFamily
           
protected  byte[] colQualifier
           
protected  byte[] colVisibility
           
protected  boolean deleted
           
protected  byte[] row
           
protected  long timestamp
           
 
Constructor Summary
Key()
           
Key(byte[] row, byte[] colFamily, byte[] colQualifier, byte[] colVisibility, long timestamp)
           
Key(byte[] row, byte[] cf, byte[] cq, byte[] cv, long ts, boolean deleted)
           
Key(byte[] row, byte[] cf, byte[] cq, byte[] cv, long ts, boolean deleted, boolean copy)
           
Key(byte[] row, int rOff, int rLen, byte[] cf, int cfOff, int cfLen, byte[] cq, int cqOff, int cqLen, byte[] cv, int cvOff, int cvLen, long ts)
           
Key(java.lang.CharSequence row)
           
Key(java.lang.CharSequence row, java.lang.CharSequence cf)
           
Key(java.lang.CharSequence row, java.lang.CharSequence cf, java.lang.CharSequence cq)
           
Key(java.lang.CharSequence row, java.lang.CharSequence cf, java.lang.CharSequence cq, java.lang.CharSequence cv)
           
Key(java.lang.CharSequence row, java.lang.CharSequence cf, java.lang.CharSequence cq, java.lang.CharSequence cv, long ts)
           
Key(java.lang.CharSequence row, java.lang.CharSequence cf, java.lang.CharSequence cq, long ts)
           
Key(Key other)
           
Key(org.apache.hadoop.io.Text row)
           
Key(org.apache.hadoop.io.Text row, long ts)
           
Key(org.apache.hadoop.io.Text row, org.apache.hadoop.io.Text cf)
           
Key(org.apache.hadoop.io.Text row, org.apache.hadoop.io.Text cf, org.apache.hadoop.io.Text cq)
           
Key(org.apache.hadoop.io.Text row, org.apache.hadoop.io.Text cf, org.apache.hadoop.io.Text cq, long ts)
           
Key(org.apache.hadoop.io.Text row, org.apache.hadoop.io.Text cf, org.apache.hadoop.io.Text cq, org.apache.hadoop.io.Text cv)
           
Key(org.apache.hadoop.io.Text row, org.apache.hadoop.io.Text cf, org.apache.hadoop.io.Text cq, org.apache.hadoop.io.Text cv, long ts)
           
Key(TKey tkey)
           
 
Method Summary
 java.lang.Object clone()
           
 int compareColumnFamily(org.apache.hadoop.io.Text cf)
           
 int compareColumnQualifier(org.apache.hadoop.io.Text cq)
           
 int compareRow(org.apache.hadoop.io.Text r)
           
 int compareTo(Key other)
          determines the order of keys in the MapFiles we must then just make sure that *'s are not ever stored
 int compareTo(Key other, PartialKey part)
           
static java.util.List<TKeyValue> compress(java.util.List<? extends KeyValue> param)
          Use this to compress a list of keys before sending them via thrift.
static void decompress(java.util.List<TKeyValue> param)
          Use this to decompress a list of keys received from thrift.
 boolean equals(Key other, PartialKey part)
           
 boolean equals(java.lang.Object o)
           
 Key followingKey(PartialKey part)
          Returns a key that will sort immediately after this key.
 org.apache.hadoop.io.Text getColumnFamily()
           
 org.apache.hadoop.io.Text getColumnFamily(org.apache.hadoop.io.Text cf)
           
 ByteSequence getColumnFamilyData()
           
 org.apache.hadoop.io.Text getColumnQualifier()
           
 org.apache.hadoop.io.Text getColumnQualifier(org.apache.hadoop.io.Text cq)
           
 ByteSequence getColumnQualifierData()
           
 org.apache.hadoop.io.Text getColumnVisibility()
           
 org.apache.hadoop.io.Text getColumnVisibility(org.apache.hadoop.io.Text cv)
           
 ByteSequence getColumnVisibilityData()
           
 int getLength()
           
 org.apache.hadoop.io.Text getRow()
           
 org.apache.hadoop.io.Text getRow(org.apache.hadoop.io.Text r)
           
 ByteSequence getRowData()
           
 int getSize()
           
 long getTimestamp()
           
 int hashCode()
           
 boolean isDeleted()
           
 void readFields(java.io.DataInput in)
           
 void set(Key k)
           
 void setDeleted(boolean deleted)
           
 void setTimestamp(long ts)
           
static java.lang.String toPrintableString(byte[] ba, int offset, int len, int maxLen)
           
 java.lang.String toString()
           
 java.lang.String toStringNoTime()
           
 TKey toThrift()
           
 void write(java.io.DataOutput out)
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

row

protected byte[] row

colFamily

protected byte[] colFamily

colQualifier

protected byte[] colQualifier

colVisibility

protected byte[] colVisibility

timestamp

protected long timestamp

deleted

protected boolean deleted
Constructor Detail

Key

public Key()

Key

public Key(org.apache.hadoop.io.Text row)

Key

public Key(org.apache.hadoop.io.Text row,
           long ts)

Key

public Key(byte[] row,
           int rOff,
           int rLen,
           byte[] cf,
           int cfOff,
           int cfLen,
           byte[] cq,
           int cqOff,
           int cqLen,
           byte[] cv,
           int cvOff,
           int cvLen,
           long ts)

Key

public Key(byte[] row,
           byte[] colFamily,
           byte[] colQualifier,
           byte[] colVisibility,
           long timestamp)

Key

public Key(byte[] row,
           byte[] cf,
           byte[] cq,
           byte[] cv,
           long ts,
           boolean deleted)

Key

public Key(byte[] row,
           byte[] cf,
           byte[] cq,
           byte[] cv,
           long ts,
           boolean deleted,
           boolean copy)

Key

public Key(org.apache.hadoop.io.Text row,
           org.apache.hadoop.io.Text cf)

Key

public Key(org.apache.hadoop.io.Text row,
           org.apache.hadoop.io.Text cf,
           org.apache.hadoop.io.Text cq)

Key

public Key(org.apache.hadoop.io.Text row,
           org.apache.hadoop.io.Text cf,
           org.apache.hadoop.io.Text cq,
           org.apache.hadoop.io.Text cv)

Key

public Key(org.apache.hadoop.io.Text row,
           org.apache.hadoop.io.Text cf,
           org.apache.hadoop.io.Text cq,
           long ts)

Key

public Key(org.apache.hadoop.io.Text row,
           org.apache.hadoop.io.Text cf,
           org.apache.hadoop.io.Text cq,
           org.apache.hadoop.io.Text cv,
           long ts)

Key

public Key(java.lang.CharSequence row)

Key

public Key(java.lang.CharSequence row,
           java.lang.CharSequence cf)

Key

public Key(java.lang.CharSequence row,
           java.lang.CharSequence cf,
           java.lang.CharSequence cq)

Key

public Key(java.lang.CharSequence row,
           java.lang.CharSequence cf,
           java.lang.CharSequence cq,
           java.lang.CharSequence cv)

Key

public Key(java.lang.CharSequence row,
           java.lang.CharSequence cf,
           java.lang.CharSequence cq,
           long ts)

Key

public Key(java.lang.CharSequence row,
           java.lang.CharSequence cf,
           java.lang.CharSequence cq,
           java.lang.CharSequence cv,
           long ts)

Key

public Key(Key other)

Key

public Key(TKey tkey)
Method Detail

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

followingKey

public Key followingKey(PartialKey part)
Returns a key that will sort immediately after this key.

Parameters:
part - PartialKey except PartialKey.ROW_COLFAM_COLQUAL_COLVIS_TIME_DEL

getRow

public org.apache.hadoop.io.Text getRow(org.apache.hadoop.io.Text r)

getRowData

public ByteSequence getRowData()

getRow

public org.apache.hadoop.io.Text getRow()

compareRow

public int compareRow(org.apache.hadoop.io.Text r)

getColumnFamilyData

public ByteSequence getColumnFamilyData()

getColumnFamily

public org.apache.hadoop.io.Text getColumnFamily(org.apache.hadoop.io.Text cf)

getColumnFamily

public org.apache.hadoop.io.Text getColumnFamily()

compareColumnFamily

public int compareColumnFamily(org.apache.hadoop.io.Text cf)

getColumnQualifierData

public ByteSequence getColumnQualifierData()

getColumnQualifier

public org.apache.hadoop.io.Text getColumnQualifier(org.apache.hadoop.io.Text cq)

getColumnQualifier

public org.apache.hadoop.io.Text getColumnQualifier()

compareColumnQualifier

public int compareColumnQualifier(org.apache.hadoop.io.Text cq)

setTimestamp

public void setTimestamp(long ts)

getTimestamp

public long getTimestamp()

isDeleted

public boolean isDeleted()

setDeleted

public void setDeleted(boolean deleted)

getColumnVisibilityData

public ByteSequence getColumnVisibilityData()

getColumnVisibility

public final org.apache.hadoop.io.Text getColumnVisibility()

getColumnVisibility

public final org.apache.hadoop.io.Text getColumnVisibility(org.apache.hadoop.io.Text cv)

set

public void set(Key k)

readFields

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

write

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

equals

public boolean equals(Key other,
                      PartialKey part)

compareTo

public int compareTo(Key other,
                     PartialKey part)

compareTo

public int compareTo(Key other)
determines the order of keys in the MapFiles we must then just make sure that *'s are not ever stored

Specified by:
compareTo in interface java.lang.Comparable<Key>

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toPrintableString

public static java.lang.String toPrintableString(byte[] ba,
                                                 int offset,
                                                 int len,
                                                 int maxLen)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toStringNoTime

public java.lang.String toStringNoTime()

getLength

public int getLength()

getSize

public int getSize()

compress

public static java.util.List<TKeyValue> compress(java.util.List<? extends KeyValue> param)
Use this to compress a list of keys before sending them via thrift.

Parameters:
param -

decompress

public static void decompress(java.util.List<TKeyValue> param)
Use this to decompress a list of keys received from thrift.

Parameters:
param -

toThrift

public TKey toThrift()

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object


Copyright © 2012 The Apache Software Foundation. All Rights Reserved.