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

java.lang.Object
  extended by org.apache.hadoop.hbase.replication.regionserver.ReplicationSinkManager

public class ReplicationSinkManager
extends Object

Maintains a collection of peers to replicate to, and randomly selects a single peer to replicate to per set of data to replicate. Also handles keeping track of peer availability.


Nested Class Summary
static class ReplicationSinkManager.SinkPeer
          Wraps a replication region server sink to provide the ability to identify it.
 
Constructor Summary
ReplicationSinkManager(HConnection conn, String peerClusterId, HBaseReplicationEndpoint endpoint, org.apache.hadoop.conf.Configuration conf)
          Instantiate for a single replication peer cluster.
 
Method Summary
 ReplicationSinkManager.SinkPeer getReplicationSink()
          Get a randomly-chosen replication sink to replicate to.
 void reportBadSink(ReplicationSinkManager.SinkPeer sinkPeer)
          Report a SinkPeer as being bad (i.e.
 void reportSinkSuccess(ReplicationSinkManager.SinkPeer sinkPeer)
          Report that a SinkPeer successfully replicated a chunk of data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReplicationSinkManager

public ReplicationSinkManager(HConnection conn,
                              String peerClusterId,
                              HBaseReplicationEndpoint endpoint,
                              org.apache.hadoop.conf.Configuration conf)
Instantiate for a single replication peer cluster.

Parameters:
conn - connection to the peer cluster
peerClusterId - identifier of the peer cluster
endpoint - replication endpoint for inter cluster replication
conf - HBase configuration, used for determining replication source ratio and bad peer threshold
Method Detail

getReplicationSink

public ReplicationSinkManager.SinkPeer getReplicationSink()
                                                   throws IOException
Get a randomly-chosen replication sink to replicate to.

Returns:
a replication sink to replicate to
Throws:
IOException

reportBadSink

public void reportBadSink(ReplicationSinkManager.SinkPeer sinkPeer)
Report a 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.

Parameters:
sinkPeer - The SinkPeer that had a failed replication attempt on it

reportSinkSuccess

public void reportSinkSuccess(ReplicationSinkManager.SinkPeer sinkPeer)
Report that a SinkPeer successfully replicated a chunk of data.

Parameters:
sinkPeer - The SinkPeer that had a failed replication attempt on it


Copyright © 2015 The Apache Software Foundation. All rights reserved.