@InterfaceAudience.Private public class HBaseInterClusterReplicationEndpoint extends HBaseReplicationEndpoint
ReplicationEndpoint implementation for replicating
to another HBase cluster. For the slave cluster it selects a random number of peers using a
replication ratio. For example, if replication ration = 0.1 and slave cluster has 100 region
servers, 10 will be selected.
A stream is considered down when we cannot contact a region server on the peer cluster for more than 55 seconds by default.
HBaseReplicationEndpoint.PeerRegionServerListenerReplicationEndpoint.Context, ReplicationEndpoint.ReplicateContext| Modifier and Type | Field and Description |
|---|---|
static String |
REPLICATION_DROP_ON_DELETED_COLUMN_FAMILY_KEY
Drop edits for CFs that been deleted from the replication source and target
|
static String |
REPLICATION_DROP_ON_DELETED_TABLE_KEY
Drop edits for tables that been deleted from the replication source and target
|
ctx, REPLICATION_WALENTRYFILTER_CONFIG_KEY| Constructor and Description |
|---|
HBaseInterClusterReplicationEndpoint() |
| Modifier and Type | Method and Description |
|---|---|
protected Connection |
createConnection(org.apache.hadoop.conf.Configuration conf) |
protected ReplicationSinkManager |
createReplicationSinkManager(Connection conn) |
protected Callable<Integer> |
createReplicator(List<WAL.Entry> entries,
int batchIndex,
int timeout) |
protected void |
doStop() |
void |
init(ReplicationEndpoint.Context context)
Initialize the replication endpoint with the given context.
|
static boolean |
isNoSuchColumnFamilyException(Throwable io)
Check if there's an
NoSuchColumnFamilyException in the caused by stacktrace. |
protected boolean |
isPeerEnabled() |
static boolean |
isTableNotFoundException(Throwable io)
Check if there's an
TableNotFoundException in the caused by stacktrace. |
boolean |
replicate(ReplicationEndpoint.ReplicateContext replicateContext)
Do the shipping logic
|
protected int |
replicateEntries(List<WAL.Entry> entries,
int batchIndex,
int timeout) |
abort, disconnect, doStart, fetchSlavesAddresses, getLastRegionServerUpdate, getPeerUUID, getRegionServers, getZkw, isAborted, reconnect, setRegionServers, start, stopcanReplicateToSameCluster, 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, isRunningpublic static final String REPLICATION_DROP_ON_DELETED_TABLE_KEY
public static final String REPLICATION_DROP_ON_DELETED_COLUMN_FAMILY_KEY
public HBaseInterClusterReplicationEndpoint()
protected Connection createConnection(org.apache.hadoop.conf.Configuration conf) throws IOException
IOExceptionprotected ReplicationSinkManager createReplicationSinkManager(Connection conn)
public void init(ReplicationEndpoint.Context context) throws IOException
ReplicationEndpointinit in interface ReplicationEndpointinit in class BaseReplicationEndpointcontext - replication contextIOException - error occur when initialize the endpoint.public static boolean isTableNotFoundException(Throwable io)
TableNotFoundException in the caused by stacktrace.public static boolean isNoSuchColumnFamilyException(Throwable io)
NoSuchColumnFamilyException in the caused by stacktrace.public boolean replicate(ReplicationEndpoint.ReplicateContext replicateContext)
replicateContext - a context where WAL entries and other parameters can be obtained.protected boolean isPeerEnabled()
protected void doStop()
doStop in class HBaseReplicationEndpointprotected int replicateEntries(List<WAL.Entry> entries, int batchIndex, int timeout) throws IOException
IOExceptionCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.