org.apache.hadoop.hbase.client
Class OperationWithAttributes

java.lang.Object
  extended by org.apache.hadoop.hbase.client.Operation
      extended by org.apache.hadoop.hbase.client.OperationWithAttributes
All Implemented Interfaces:
Attributes
Direct Known Subclasses:
Mutation, Query

@InterfaceAudience.Public
@InterfaceStability.Evolving
public abstract class OperationWithAttributes
extends Operation
implements Attributes


Field Summary
static String ID_ATRIBUTE
           
 
Constructor Summary
OperationWithAttributes()
           
 
Method Summary
 byte[] getAttribute(String name)
          Gets an attribute
protected  long getAttributeSize()
           
 Map<String,byte[]> getAttributesMap()
          Gets all attributes
 String getId()
          This method allows you to retrieve the identifier for the operation if one was set.
 void setAttribute(String name, byte[] value)
          Sets an attribute.
 void setId(String id)
          This method allows you to set an identifier on an operation.
 
Methods inherited from class org.apache.hadoop.hbase.client.Operation
getFingerprint, toJSON, toJSON, toMap, toMap, toString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ID_ATRIBUTE

public static final String ID_ATRIBUTE
See Also:
Constant Field Values
Constructor Detail

OperationWithAttributes

public OperationWithAttributes()
Method Detail

setAttribute

public void setAttribute(String name,
                         byte[] value)
Description copied from interface: Attributes
Sets an attribute. In case value = null attribute is removed from the attributes map. Attribute names starting with _ indicate system attributes.

Specified by:
setAttribute in interface Attributes
Parameters:
name - attribute name
value - attribute value

getAttribute

public byte[] getAttribute(String name)
Description copied from interface: Attributes
Gets an attribute

Specified by:
getAttribute in interface Attributes
Parameters:
name - attribute name
Returns:
attribute value if attribute is set, null otherwise

getAttributesMap

public Map<String,byte[]> getAttributesMap()
Description copied from interface: Attributes
Gets all attributes

Specified by:
getAttributesMap in interface Attributes
Returns:
unmodifiable map of all attributes

getAttributeSize

protected long getAttributeSize()

setId

public void setId(String id)
This method allows you to set an identifier on an operation. The original motivation for this was to allow the identifier to be used in slow query logging, but this could obviously be useful in other places. One use of this could be to put a class.method identifier in here to see where the slow query is coming from.

Parameters:
id - id to set for the scan

getId

public String getId()
This method allows you to retrieve the identifier for the operation if one was set.

Returns:
the id or null if not set


Copyright © 2007-2016 The Apache Software Foundation. All Rights Reserved.