org.apache.hadoop.hbase.replication.regionserver
Class HBaseInterClusterReplicationEndpoint
java.lang.Object
com.google.common.util.concurrent.AbstractService
org.apache.hadoop.hbase.replication.BaseReplicationEndpoint
org.apache.hadoop.hbase.replication.HBaseReplicationEndpoint
org.apache.hadoop.hbase.replication.regionserver.HBaseInterClusterReplicationEndpoint
- All Implemented Interfaces:
- com.google.common.util.concurrent.Service, Abortable, ReplicationEndpoint
@InterfaceAudience.Private
public class HBaseInterClusterReplicationEndpoint
- extends HBaseReplicationEndpoint
A 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.
Nested classes/interfaces inherited from interface com.google.common.util.concurrent.Service |
com.google.common.util.concurrent.Service.State |
Methods inherited from class org.apache.hadoop.hbase.replication.HBaseReplicationEndpoint |
abort, disconnect, doStart, fetchSlavesAddresses, getLastRegionServerUpdate, getPeerUUID, getRegionServers, getZkw, isAborted, reconnect, setRegionServers |
Methods inherited from class com.google.common.util.concurrent.AbstractService |
isRunning, notifyFailed, notifyStarted, notifyStopped, start, startAndWait, state, stop, stopAndWait, toString |
Methods inherited from interface com.google.common.util.concurrent.Service |
isRunning, start, startAndWait, state, stop, stopAndWait |
HBaseInterClusterReplicationEndpoint
public HBaseInterClusterReplicationEndpoint()
init
public void init(ReplicationEndpoint.Context context)
throws IOException
- Description copied from interface:
ReplicationEndpoint
- Initialize the replication endpoint with the given context.
- Specified by:
init
in interface ReplicationEndpoint
- Overrides:
init
in class BaseReplicationEndpoint
- Parameters:
context
- replication context
- Throws:
IOException
sleepForRetries
protected boolean sleepForRetries(String msg,
int sleepMultiplier)
- Do the sleeping logic
- Parameters:
msg
- Why we sleepsleepMultiplier
- by how many times the default sleeping time is augmented
- Returns:
- True if
sleepMultiplier
is < maxRetriesMultiplier
replicate
public boolean replicate(ReplicationEndpoint.ReplicateContext replicateContext)
- Do the shipping logic
- Parameters:
replicateContext
- a context where WAL entries and other
parameters can be obtained.
isPeerEnabled
protected boolean isPeerEnabled()
doStop
protected void doStop()
- Overrides:
doStop
in class HBaseReplicationEndpoint
Copyright © 2015 The Apache Software Foundation. All rights reserved.