|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.hbase.replication.regionserver.ReplicationSourceManager
public class ReplicationSourceManager
This class is responsible to manage all the replication sources. There are two classes of sources:
| Nested Class Summary | |
|---|---|
class |
ReplicationSourceManager.OtherRegionServerWatcher
Watcher used to be notified of the other region server's death in the local cluster. |
| Constructor Summary | |
|---|---|
ReplicationSourceManager(ReplicationZookeeperWrapper zkHelper,
org.apache.hadoop.conf.Configuration conf,
AtomicBoolean stopper,
org.apache.hadoop.fs.FileSystem fs,
AtomicBoolean replicating,
org.apache.hadoop.fs.Path logDir,
org.apache.hadoop.fs.Path oldLogDir)
Creates a replication manager and sets the watch on all the other registered region servers |
|
| Method Summary | |
|---|---|
ReplicationSourceInterface |
addSource(String id)
Add a new normal source to this region server |
void |
closeRecoveredQueue(ReplicationSourceInterface src)
Clear the references to the specified old source |
org.apache.hadoop.fs.FileSystem |
getFs()
Get the handle on the local file system |
protected SortedSet<String> |
getHLogs()
Get a copy of the hlogs of the first source on this rs |
org.apache.hadoop.fs.Path |
getLogDir()
Get the directory where hlogs are stored by their RSs |
org.apache.hadoop.fs.Path |
getOldLogDir()
Get the directory where hlogs are archived |
ReplicationSourceInterface |
getReplicationSource(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FileSystem fs,
ReplicationSourceManager manager,
AtomicBoolean stopper,
AtomicBoolean replicating,
String peerClusterId)
Factory method to create a replication source |
ReplicationZookeeperWrapper |
getRepZkWrapper()
Get the ZK help of this manager |
List<ReplicationSourceInterface> |
getSources()
Get a list of all the normal sources of this rs |
void |
init()
Adds a normal source per registered peer cluster and tries to process all old region server hlog queues |
void |
join()
Terminate the replication on this region server |
void |
logPositionAndCleanOldLogs(org.apache.hadoop.fs.Path log,
String id,
long position,
boolean queueRecovered)
Provide the id of the peer and a log key and this method will figure which hlog it belongs to and will log, for this region server, the current position. |
void |
logRolled(org.apache.hadoop.fs.Path newLog)
Notify the listener that a new file is available |
void |
transferQueues(String rsZnode)
Transfer all the queues of the specified to this region server. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ReplicationSourceManager(ReplicationZookeeperWrapper zkHelper,
org.apache.hadoop.conf.Configuration conf,
AtomicBoolean stopper,
org.apache.hadoop.fs.FileSystem fs,
AtomicBoolean replicating,
org.apache.hadoop.fs.Path logDir,
org.apache.hadoop.fs.Path oldLogDir)
zkHelper - the zk helper for replicationconf - the configuration to usestopper - the stopper object for this region serverfs - the file system to usereplicating - the status of the replication on this clusterlogDir - the directory that contains all hlog directories of live RSsoldLogDir - the directory where old logs are archived| Method Detail |
|---|
public void logPositionAndCleanOldLogs(org.apache.hadoop.fs.Path log,
String id,
long position,
boolean queueRecovered)
log - Path to the log currently being replicated from
replication status in zookeeper. It will also delete older entries.id - id of the peer clusterposition - current location in the logqueueRecovered - indicates if this queue comes from another region server
public void init()
throws IOException
IOException
public ReplicationSourceInterface addSource(String id)
throws IOException
id - the id of the peer cluster
IOExceptionpublic void join()
protected SortedSet<String> getHLogs()
public List<ReplicationSourceInterface> getSources()
public void logRolled(org.apache.hadoop.fs.Path newLog)
LogActionsListener
logRolled in interface LogActionsListenernewLog - the path to the new hlogpublic ReplicationZookeeperWrapper getRepZkWrapper()
public ReplicationSourceInterface getReplicationSource(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FileSystem fs,
ReplicationSourceManager manager,
AtomicBoolean stopper,
AtomicBoolean replicating,
String peerClusterId)
throws IOException
conf - the configuration to usefs - the file system to usemanager - the manager to usestopper - the stopper object for this region serverreplicating - the status of the replication on this clusterpeerClusterId - the id of the peer cluster
IOExceptionpublic void transferQueues(String rsZnode)
rsZnode - public void closeRecoveredQueue(ReplicationSourceInterface src)
src - source to clearpublic org.apache.hadoop.fs.Path getOldLogDir()
public org.apache.hadoop.fs.Path getLogDir()
public org.apache.hadoop.fs.FileSystem getFs()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||