org.apache.hadoop.hbase.coprocessor
Class BaseEndpointCoprocessor
java.lang.Object
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.
Field Summary |
static long |
VERSION
This Interfaces' version. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
VERSION
public static final long VERSION
- This Interfaces' version. Version changes when the Interface changes.
- See Also:
- Constant Field Values
BaseEndpointCoprocessor
public BaseEndpointCoprocessor()
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 interfaceversion
- The version of the protocol that the client speaksclientMethodsHashCode
- 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 interfaceclientVersion
- 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.