@InterfaceAudience.Private public abstract class HBaseReplicationEndpoint extends BaseReplicationEndpoint implements Abortable
BaseReplicationEndpoint for replication endpoints whose target cluster is an HBase
cluster.| Modifier and Type | Class and Description |
|---|---|
static class |
HBaseReplicationEndpoint.PeerRegionServerListener
Tracks changes to the list of region servers in a peer's cluster.
|
static class |
HBaseReplicationEndpoint.SinkPeer
Wraps a replication region server sink to provide the ability to identify it.
|
ReplicationEndpoint.Context, ReplicationEndpoint.ReplicateContext| Modifier and Type | Field and Description |
|---|---|
protected org.apache.hadoop.conf.Configuration |
conf |
static int |
DEFAULT_BAD_SINK_THRESHOLD
Default maximum number of times a replication sink can be reported as bad before it will no
longer be provided as a sink for replication without the pool of replication sinks being
refreshed.
|
static float |
DEFAULT_REPLICATION_SOURCE_RATIO
Default ratio of the total number of peer cluster region servers to consider replicating to.
|
ctx, REPLICATION_WALENTRYFILTER_CONFIG_KEY| Constructor and Description |
|---|
HBaseReplicationEndpoint() |
| Modifier and Type | Method and Description |
|---|---|
void |
abort(String why,
Throwable e) |
protected void |
chooseSinks() |
protected AsyncClusterConnection |
createConnection(org.apache.hadoop.conf.Configuration conf) |
protected void |
disconnect() |
protected void |
doStart() |
protected void |
doStop() |
protected List<ServerName> |
fetchSlavesAddresses()
Get the list of all the region servers from the specified peer
|
protected int |
getNumSinks() |
UUID |
getPeerUUID()
Returns a UUID of the provided peer id.
|
protected HBaseReplicationEndpoint.SinkPeer |
getReplicationSink()
Get a randomly-chosen replication sink to replicate to.
|
void |
init(ReplicationEndpoint.Context context)
Initialize the replication endpoint with the given context.
|
boolean |
isAborted() |
protected void |
reportBadSink(HBaseReplicationEndpoint.SinkPeer sinkPeer)
Report a
SinkPeer as being bad (i.e. |
protected void |
reportSinkSuccess(HBaseReplicationEndpoint.SinkPeer sinkPeer)
Report that a
SinkPeer successfully replicated a chunk of data. |
void |
start()
Initiates service startup and returns immediately.
|
void |
stop()
If the service is starting or running, this initiates service shutdown and returns immediately.
|
canReplicateToSameCluster, getNamespaceTableCfWALEntryFilter, getScopeWALEntryFilter, getWALEntryfilter, isStarting, peerConfigUpdatedaddListener, awaitRunning, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, awaitTerminated, doCancelStart, failureCause, isRunning, notifyFailed, notifyStarted, notifyStopped, startAsync, state, stopAsync, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitawaitRunning, awaitRunning, awaitTerminated, awaitTerminated, failureCause, isRunning, replicateprotected org.apache.hadoop.conf.Configuration conf
public static final int DEFAULT_BAD_SINK_THRESHOLD
public static final float DEFAULT_REPLICATION_SOURCE_RATIO
protected AsyncClusterConnection createConnection(org.apache.hadoop.conf.Configuration conf) throws IOException
IOExceptionpublic void init(ReplicationEndpoint.Context context) throws IOException
ReplicationEndpointinit in interface ReplicationEndpointinit in class BaseReplicationEndpointcontext - replication contextIOException - error occur when initialize the endpoint.protected void disconnect()
public void start()
ReplicationEndpointstart in interface ReplicationEndpointpublic void stop()
ReplicationEndpointstop in interface ReplicationEndpointprotected void doStart()
doStart in class org.apache.hbase.thirdparty.com.google.common.util.concurrent.AbstractServiceprotected void doStop()
doStop in class org.apache.hbase.thirdparty.com.google.common.util.concurrent.AbstractServicepublic UUID getPeerUUID()
ReplicationEndpointgetPeerUUID in interface ReplicationEndpointprotected List<ServerName> fetchSlavesAddresses()
protected void chooseSinks()
protected int getNumSinks()
protected HBaseReplicationEndpoint.SinkPeer getReplicationSink() throws IOException
IOExceptionprotected void reportBadSink(HBaseReplicationEndpoint.SinkPeer sinkPeer)
SinkPeer as being bad (i.e. an attempt to replicate to it failed). If a single
SinkPeer is reported as bad more than replication.bad.sink.threshold times, it will be removed
from the pool of potential replication targets.sinkPeer - The SinkPeer that had a failed replication attempt on itprotected void reportSinkSuccess(HBaseReplicationEndpoint.SinkPeer sinkPeer)
SinkPeer successfully replicated a chunk of data. n * The SinkPeer that
had a failed replication attempt on itCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.