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

java.lang.Object
  extended by org.apache.hadoop.hbase.replication.regionserver.Replication
All Implemented Interfaces:
LogEntryVisitor

public class Replication
extends Object
implements LogEntryVisitor

Replication serves as an umbrella over the setup of replication and is used by HRS.


Constructor Summary
Replication(org.apache.hadoop.conf.Configuration conf, HServerInfo hsi, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path logDir, org.apache.hadoop.fs.Path oldLogDir, AtomicBoolean stopRequested)
          Instantiate the replication management (if rep is enabled).
 
Method Summary
 void addLogEntryVisitor(HLog hlog)
          Add this class as a log entry visitor for HLog if replication is enabled
 ReplicationSourceManager getReplicationManager()
          Get the replication sources manager
 void join()
          Join with the replication threads
 void replicateLogEntries(HLog.Entry[] entries)
          Carry on the list of log entries down to the sink
 void startReplicationServices()
          If replication is enabled and this cluster is a master, it starts
 void visitLogEntryBeforeWrite(HRegionInfo info, HLogKey logKey, WALEdit logEdit)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Replication

public Replication(org.apache.hadoop.conf.Configuration conf,
                   HServerInfo hsi,
                   org.apache.hadoop.fs.FileSystem fs,
                   org.apache.hadoop.fs.Path logDir,
                   org.apache.hadoop.fs.Path oldLogDir,
                   AtomicBoolean stopRequested)
            throws IOException
Instantiate the replication management (if rep is enabled).

Parameters:
conf - conf to use
hsi - the info if this region server
fs - handle to the filesystem
oldLogDir - directory where logs are archived
stopRequested - boolean that tells us if we are shutting down
Throws:
IOException
Method Detail

join

public void join()
Join with the replication threads


replicateLogEntries

public void replicateLogEntries(HLog.Entry[] entries)
                         throws IOException
Carry on the list of log entries down to the sink

Parameters:
entries - list of entries to replicate
Throws:
IOException

startReplicationServices

public void startReplicationServices()
                              throws IOException
If replication is enabled and this cluster is a master, it starts

Throws:
IOException

getReplicationManager

public ReplicationSourceManager getReplicationManager()
Get the replication sources manager

Returns:
the manager if replication is enabled, else returns false

visitLogEntryBeforeWrite

public void visitLogEntryBeforeWrite(HRegionInfo info,
                                     HLogKey logKey,
                                     WALEdit logEdit)
Specified by:
visitLogEntryBeforeWrite in interface LogEntryVisitor

addLogEntryVisitor

public void addLogEntryVisitor(HLog hlog)
Add this class as a log entry visitor for HLog if replication is enabled

Parameters:
hlog - log that was add ourselves on


Copyright © 2010 Apache Software Foundation. All Rights Reserved.