org.kiji.schema
Class EntityId

java.lang.Object
  extended by org.kiji.schema.EntityId
Direct Known Subclasses:
HBaseEntityId, RawEntityId

@ApiAudience.Public
@ApiStability.Stable
@Inheritance.Sealed
public abstract class EntityId
extends Object

EntityId is used to identify a particular row under the key format of a Kiji table. There are two name-spaces for rows:

The translation between Kiji row keys and HBase row keys depends on the layout of the table the row belongs to. The same Kiji row key may translate to two different EntityIds on two different tables, based on their key format. For a representation of row keys which is agnostic to row key formats, see KijiRowKeyComponents. There are multiple translation schemes:


Method Summary
 boolean equals(Object obj)
          
abstract
<T> T
getComponentByIndex(int idx)
          Get the individual components of the kiji Row Key representation.
abstract  List<Object> getComponents()
          Get the components of the row key as a List of Objects.
abstract  byte[] getHBaseRowKey()
          Translates this Kiji row key into an HBase row key.
 int hashCode()
          
abstract  String toShellString()
          A String which can be copied into CLI and parsed to the same EntityId.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getHBaseRowKey

public abstract byte[] getHBaseRowKey()
Translates this Kiji row key into an HBase row key.

Returns:
the HBase row key.

getComponentByIndex

public abstract <T> T getComponentByIndex(int idx)
Get the individual components of the kiji Row Key representation. This excludes hash prefixes and only includes user-addressible components. E.g. If the key is composed of a String followed by an Int, getComponentByIndex(0) returns the String component. Zero based indexing.

Type Parameters:
T - The type of the row key component.
Parameters:
idx - The index of the component. An integer between 0 and numComponents - 1.
Returns:
The specific component of the row key.

getComponents

public abstract List<Object> getComponents()
Get the components of the row key as a List of Objects. This excludes hash prefixes and only includes user-addressible components.

Returns:
List of Objects representing the individual components of a row key.

hashCode

public int hashCode()

Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)

Overrides:
equals in class Object

toShellString

public abstract String toShellString()
A String which can be copied into CLI and parsed to the same EntityId. Characters interpreted by the JSON parser for formatted entity ids as part of the JSON structure are automatically escaped with '\'. Other characters which may be interpreted by your shell environment must be escaped manually.

Returns:
A copyable string.


Copyright © 2012-2014 WibiData, Inc.. All Rights Reserved.