public interface ReplicationSourceInterface
| Modifier and Type | Method and Description |
|---|---|
void |
addHFileRefs(TableName tableName,
byte[] family,
java.util.List<<any>> pairs)
Add hfile names to the queue to be replicated.
|
void |
enqueueLog(Path log)
Add a log to the list of logs to replicate
|
Path |
getCurrentPath()
Get the current log that's replicated
|
java.lang.String |
getPeerClusterZnode()
Get the id that the source is replicating to
|
java.lang.String |
getPeerId()
Get the id that the source is replicating to.
|
ReplicationEndpoint |
getReplicationEndpoint() |
ServerName |
getServerWALsBelongTo()
The queue of WALs only belong to one region server.
|
ReplicationSourceManager |
getSourceManager() |
MetricsSource |
getSourceMetrics() |
java.lang.String |
getStats()
Get a string representation of the current statistics
for this source
|
WALFileLengthProvider |
getWALFileLengthProvider() |
void |
init(Configuration conf,
FileSystem fs,
ReplicationSourceManager manager,
ReplicationQueues replicationQueues,
ReplicationPeers replicationPeers,
Server server,
java.lang.String peerClusterZnode,
java.util.UUID clusterId,
ReplicationEndpoint replicationEndpoint,
WALFileLengthProvider walFileLengthProvider,
MetricsSource metrics)
Initializer for the source
|
boolean |
isPeerEnabled() |
boolean |
isSourceActive() |
void |
postShipEdits(java.util.List<Entry> entries,
int batchSize)
Call this after the shipper thread ship some entries to peer cluster.
|
void |
startup()
Start the replication
|
void |
terminate(java.lang.String reason)
End the replication
|
void |
terminate(java.lang.String reason,
java.lang.Exception cause)
End the replication
|
void |
tryThrottle(int batchSize)
Try to throttle when the peer config with a bandwidth
|
void init(Configuration conf,
FileSystem fs,
ReplicationSourceManager manager,
ReplicationQueues replicationQueues,
ReplicationPeers replicationPeers,
Server server,
java.lang.String peerClusterZnode,
java.util.UUID clusterId,
ReplicationEndpoint replicationEndpoint,
WALFileLengthProvider walFileLengthProvider,
MetricsSource metrics)
throws java.io.IOException
conf - the configuration to usefs - the file system to usemanager - the manager to usereplicationQueues - replicationPeers - server - the server for this region serverpeerClusterZnode - clusterId - java.io.IOExceptionvoid enqueueLog(Path log)
log - path to the log to replicatevoid addHFileRefs(TableName tableName,
byte[] family,
java.util.List<<any>> pairs)
throws ReplicationException
tableName - Name of the table these files belongs tofamily - Name of the family these files belong topairs - list of pairs of { HFile location in staging dir, HFile path in region dir which
will be added in the queue for replication}ReplicationException - If failed to add hfile referencesvoid startup()
void terminate(java.lang.String reason)
reason - why it's terminatingvoid terminate(java.lang.String reason,
java.lang.Exception cause)
reason - why it's terminatingcause - the error that's causing itPath getCurrentPath()
java.lang.String getPeerClusterZnode()
java.lang.String getPeerId()
java.lang.String getStats()
boolean isPeerEnabled()
boolean isSourceActive()
MetricsSource getSourceMetrics()
ReplicationEndpoint getReplicationEndpoint()
ReplicationSourceManager getSourceManager()
WALFileLengthProvider getWALFileLengthProvider()
void tryThrottle(int batchSize)
throws java.lang.InterruptedException
batchSize - entries size will be pushedjava.lang.InterruptedExceptionvoid postShipEdits(java.util.List<Entry> entries,
int batchSize)
entries - pushedbatchSize - entries size pushedServerName getServerWALsBelongTo()