org.apache.hadoop.hbase.replication.regionserver
Interface ReplicationSourceInterface

All Known Implementing Classes:
ReplicationSource

public interface ReplicationSourceInterface

Interface that defines a replication source


Method Summary
 void enqueueLog(org.apache.hadoop.fs.Path log)
          Add a log to the list of logs to replicate
 org.apache.hadoop.fs.Path getCurrentPath()
          Get the current log that's replicated
 String getPeerClusterId()
          Get the id that the source is replicating to.
 String getPeerClusterZnode()
          Get the id that the source is replicating to
 void init(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, ReplicationSourceManager manager, Stoppable stopper, AtomicBoolean replicating, String peerClusterId)
          Initializer for the source
 void setSourceEnabled(boolean status)
          Set if this source is enabled or disabled
 void startup()
          Start the replication
 void terminate(String reason)
          End the replication
 void terminate(String reason, Exception cause)
          End the replication
 

Method Detail

init

void init(org.apache.hadoop.conf.Configuration conf,
          org.apache.hadoop.fs.FileSystem fs,
          ReplicationSourceManager manager,
          Stoppable stopper,
          AtomicBoolean replicating,
          String peerClusterId)
          throws IOException
Initializer for the source

Parameters:
conf - the configuration to use
fs - the file system to use
manager - the manager to use
stopper - the stopper object for this region server
replicating - the status of the replication on this cluster
peerClusterId - the id of the peer cluster
Throws:
IOException

enqueueLog

void enqueueLog(org.apache.hadoop.fs.Path log)
Add a log to the list of logs to replicate

Parameters:
log - path to the log to replicate

getCurrentPath

org.apache.hadoop.fs.Path getCurrentPath()
Get the current log that's replicated

Returns:
the current log

startup

void startup()
Start the replication


terminate

void terminate(String reason)
End the replication

Parameters:
reason - why it's terminating

terminate

void terminate(String reason,
               Exception cause)
End the replication

Parameters:
reason - why it's terminating
cause - the error that's causing it

getPeerClusterZnode

String getPeerClusterZnode()
Get the id that the source is replicating to

Returns:
peer cluster id

getPeerClusterId

String getPeerClusterId()
Get the id that the source is replicating to.

Returns:
peer cluster id

setSourceEnabled

void setSourceEnabled(boolean status)
Set if this source is enabled or disabled

Parameters:
status - the new status


Copyright © 2011 The Apache Software Foundation. All Rights Reserved.