org.apache.hadoop.hbase.replication.regionserver
Class HBaseInterClusterReplicationEndpoint

java.lang.Object
  extended by com.google.common.util.concurrent.AbstractService
      extended by org.apache.hadoop.hbase.replication.BaseReplicationEndpoint
          extended by org.apache.hadoop.hbase.replication.HBaseReplicationEndpoint
              extended by 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 Class Summary
 
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.replication.HBaseReplicationEndpoint
HBaseReplicationEndpoint.PeerRegionServerListener
 
Nested classes/interfaces inherited from interface org.apache.hadoop.hbase.replication.ReplicationEndpoint
ReplicationEndpoint.Context, ReplicationEndpoint.ReplicateContext
 
Nested classes/interfaces inherited from interface com.google.common.util.concurrent.Service
com.google.common.util.concurrent.Service.State
 
Field Summary
 
Fields inherited from class org.apache.hadoop.hbase.replication.BaseReplicationEndpoint
ctx
 
Constructor Summary
HBaseInterClusterReplicationEndpoint()
           
 
Method Summary
protected  void doStop()
           
 void init(ReplicationEndpoint.Context context)
          Initialize the replication endpoint with the given context.
protected  boolean isPeerEnabled()
           
 boolean replicate(ReplicationEndpoint.ReplicateContext replicateContext)
          Do the shipping logic
protected  boolean sleepForRetries(String msg, int sleepMultiplier)
          Do the sleeping logic
 
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 org.apache.hadoop.hbase.replication.BaseReplicationEndpoint
canReplicateToSameCluster, getScopeWALEntryFilter, getTableCfWALEntryFilter, getWALEntryfilter
 
Methods inherited from class com.google.common.util.concurrent.AbstractService
isRunning, notifyFailed, notifyStarted, notifyStopped, start, startAndWait, state, stop, stopAndWait, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.google.common.util.concurrent.Service
isRunning, start, startAndWait, state, stop, stopAndWait
 

Constructor Detail

HBaseInterClusterReplicationEndpoint

public HBaseInterClusterReplicationEndpoint()
Method Detail

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 sleep
sleepMultiplier - 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.