org.apache.hadoop.hbase.client
Class OperationWithAttributes
java.lang.Object
org.apache.hadoop.hbase.client.Operation
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
ID_ATRIBUTE
public static final String ID_ATRIBUTE
- See Also:
- Constant Field Values
OperationWithAttributes
public OperationWithAttributes()
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 namevalue
- 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.