org.apache.hadoop.hbase.replication
Interface ReplicationEndpoint

All Superinterfaces:
ReplicationPeerConfigListener, com.google.common.util.concurrent.Service
All Known Implementing Classes:
BaseReplicationEndpoint, HBaseInterClusterReplicationEndpoint, HBaseReplicationEndpoint, VisibilityReplicationEndpoint

@InterfaceAudience.LimitedPrivate(value="Replication")
public interface ReplicationEndpoint
extends com.google.common.util.concurrent.Service, ReplicationPeerConfigListener

ReplicationEndpoint is a plugin which implements replication to other HBase clusters, or other systems. ReplicationEndpoint implementation can be specified at the peer creation time by specifying it in the ReplicationPeerConfig. A ReplicationEndpoint is run in a thread in each region server in the same process.

ReplicationEndpoint is closely tied to ReplicationSource in a producer-consumer relation. ReplicationSource is an HBase-private class which tails the logs and manages the queue of logs plus management and persistence of all the state for replication. ReplicationEndpoint on the other hand is responsible for doing the actual shipping and persisting of the WAL entries in the other cluster.


Nested Class Summary
static class ReplicationEndpoint.Context
           
static class ReplicationEndpoint.ReplicateContext
          A context for replicate(ReplicateContext) method.
 
Nested classes/interfaces inherited from interface com.google.common.util.concurrent.Service
com.google.common.util.concurrent.Service.State
 
Method Summary
 boolean canReplicateToSameCluster()
          Whether or not, the replication endpoint can replicate to it's source cluster with the same UUID
 UUID getPeerUUID()
          Returns a UUID of the provided peer id.
 WALEntryFilter getWALEntryfilter()
          Returns a WALEntryFilter to use for filtering out WALEntries from the log.
 void init(ReplicationEndpoint.Context context)
          Initialize the replication endpoint with the given context.
 boolean replicate(ReplicationEndpoint.ReplicateContext replicateContext)
          Replicate the given set of entries (in the context) to the other cluster.
 
Methods inherited from interface com.google.common.util.concurrent.Service
isRunning, start, startAndWait, state, stop, stopAndWait
 
Methods inherited from interface org.apache.hadoop.hbase.replication.ReplicationPeerConfigListener
peerConfigUpdated
 

Method Detail

init

void init(ReplicationEndpoint.Context context)
          throws IOException
Initialize the replication endpoint with the given context.

Parameters:
context - replication context
Throws:
IOException

canReplicateToSameCluster

boolean canReplicateToSameCluster()
Whether or not, the replication endpoint can replicate to it's source cluster with the same UUID


getPeerUUID

UUID getPeerUUID()
Returns a UUID of the provided peer id. Every HBase cluster instance has a persisted associated UUID. If the replication is not performed to an actual HBase cluster (but some other system), the UUID returned has to uniquely identify the connected target system.

Returns:
a UUID or null if the peer cluster does not exist or is not connected.

getWALEntryfilter

WALEntryFilter getWALEntryfilter()
Returns a WALEntryFilter to use for filtering out WALEntries from the log. Replication infrastructure will call this filter before sending the edits to shipEdits().

Returns:
a WALEntryFilter or null.

replicate

boolean replicate(ReplicationEndpoint.ReplicateContext replicateContext)
Replicate the given set of entries (in the context) to the other cluster. Can block until all the given entries are replicated. Upon this method is returned, all entries that were passed in the context are assumed to be persisted in the target cluster.

Parameters:
replicateContext - a context where WAL entries and other parameters can be obtained.


Copyright © 2007–2016 The Apache Software Foundation. All rights reserved.