org.apache.hadoop.hbase.client
Class Operation

java.lang.Object
  extended by org.apache.hadoop.hbase.client.Operation
Direct Known Subclasses:
OperationWithAttributes

@InterfaceAudience.Public
@InterfaceStability.Evolving
public abstract class Operation
extends Object

Superclass for any type that maps to a potentially application-level query. (e.g. Put, Get, Delete, Scan, Next, etc.) Contains methods for exposure to logging and debugging tools.


Constructor Summary
Operation()
           
 
Method Summary
abstract  Map<String,Object> getFingerprint()
          Produces a Map containing a fingerprint which identifies the type and the static schema components of a query (i.e.
 String toJSON()
          Produces a JSON object sufficient for description of a query in a debugging or logging context.
 String toJSON(int maxCols)
          Produces a JSON object for fingerprint and details exposure in a parseable format.
 Map<String,Object> toMap()
          Produces a Map containing a full summary of a query.
abstract  Map<String,Object> toMap(int maxCols)
          Produces a Map containing a summary of the details of a query beyond the scope of the fingerprint (i.e.
 String toString()
          Produces a string representation of this Operation.
 String toString(int maxCols)
          Produces a string representation of this Operation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Operation

public Operation()
Method Detail

getFingerprint

public abstract Map<String,Object> getFingerprint()
Produces a Map containing a fingerprint which identifies the type and the static schema components of a query (i.e. column families)

Returns:
a map containing fingerprint information (i.e. column families)

toMap

public abstract Map<String,Object> toMap(int maxCols)
Produces a Map containing a summary of the details of a query beyond the scope of the fingerprint (i.e. columns, rows...)

Parameters:
maxCols - a limit on the number of columns output prior to truncation
Returns:
a map containing parameters of a query (i.e. rows, columns...)

toMap

public Map<String,Object> toMap()
Produces a Map containing a full summary of a query.

Returns:
a map containing parameters of a query (i.e. rows, columns...)

toJSON

public String toJSON(int maxCols)
              throws IOException
Produces a JSON object for fingerprint and details exposure in a parseable format.

Parameters:
maxCols - a limit on the number of columns to include in the JSON
Returns:
a JSONObject containing this Operation's information, as a string
Throws:
IOException

toJSON

public String toJSON()
              throws IOException
Produces a JSON object sufficient for description of a query in a debugging or logging context.

Returns:
the produced JSON object, as a string
Throws:
IOException

toString

public String toString(int maxCols)
Produces a string representation of this Operation. It defaults to a JSON representation, but falls back to a string representation of the fingerprint and details in the case of a JSON encoding failure.

Parameters:
maxCols - a limit on the number of columns output in the summary prior to truncation
Returns:
a JSON-parseable String

toString

public String toString()
Produces a string representation of this Operation. It defaults to a JSON representation, but falls back to a string representation of the fingerprint and details in the case of a JSON encoding failure.

Overrides:
toString in class Object
Returns:
String


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