org.apache.hadoop.hbase.coprocessor
Class BaseEndpointCoprocessor

java.lang.Object
  extended by org.apache.hadoop.hbase.coprocessor.BaseEndpointCoprocessor
All Implemented Interfaces:
Coprocessor, CoprocessorProtocol, VersionedProtocol
Direct Known Subclasses:
AggregateImplementation, BulkDeleteEndpoint, MultiRowMutationEndpoint, SecureBulkLoadEndpoint, TokenProvider

public abstract class BaseEndpointCoprocessor
extends Object
implements Coprocessor, CoprocessorProtocol, VersionedProtocol

This abstract class provides default implementation of an Endpoint. It also maintains a CoprocessorEnvironment object which can be used to access region resource. It's recommended to use this abstract class to implement your Endpoint. However you still can just implement the interface CoprocessorProtocol and Coprocessor to develop an Endpoint. But you won't be able to access the region related resource, i.e., CoprocessorEnvironment.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.hadoop.hbase.Coprocessor
Coprocessor.State
 
Field Summary
static long VERSION
          This Interfaces' version.
 
Fields inherited from interface org.apache.hadoop.hbase.Coprocessor
PRIORITY_HIGHEST, PRIORITY_LOWEST, PRIORITY_SYSTEM, PRIORITY_USER
 
Constructor Summary
BaseEndpointCoprocessor()
           
 
Method Summary
 CoprocessorEnvironment getEnvironment()
           
 ProtocolSignature getProtocolSignature(String protocol, long version, int clientMethodsHashCode)
          Return protocol version corresponding to protocol interface.
 long getProtocolVersion(String protocol, long clientVersion)
          Return protocol version corresponding to protocol interface.
 void start(CoprocessorEnvironment env)
           
 void stop(CoprocessorEnvironment env)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION

public static final long VERSION
This Interfaces' version. Version changes when the Interface changes.

See Also:
Constant Field Values
Constructor Detail

BaseEndpointCoprocessor

public BaseEndpointCoprocessor()
Method Detail

getEnvironment

public CoprocessorEnvironment getEnvironment()
Returns:
env Coprocessor environment.

start

public void start(CoprocessorEnvironment env)
Specified by:
start in interface Coprocessor

stop

public void stop(CoprocessorEnvironment env)
Specified by:
stop in interface Coprocessor

getProtocolSignature

public ProtocolSignature getProtocolSignature(String protocol,
                                              long version,
                                              int clientMethodsHashCode)
                                       throws IOException
Description copied from interface: VersionedProtocol
Return protocol version corresponding to protocol interface.

Specified by:
getProtocolSignature in interface VersionedProtocol
Parameters:
protocol - The classname of the protocol interface
version - The version of the protocol that the client speaks
clientMethodsHashCode - the hashcode of client protocol methods
Returns:
the server protocol signature containing its version and a list of its supported methods
Throws:
IOException
See Also:
for a default implementation

getProtocolVersion

public long getProtocolVersion(String protocol,
                               long clientVersion)
                        throws IOException
Description copied from interface: VersionedProtocol
Return protocol version corresponding to protocol interface.

Specified by:
getProtocolVersion in interface VersionedProtocol
Parameters:
protocol - The classname of the protocol interface
clientVersion - The version of the protocol that the client speaks
Returns:
the version that the server will speak
Throws:
IOException - if any IO error occurs


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