@InterfaceAudience.Private public class Replication extends Object implements ReplicationSourceService, PropagatingConfigurationObserver
HRegionServer
.
Implement PropagatingConfigurationObserver
mainly for registering
ReplicationPeers
, so we can recreating the replication peer storage.
Modifier and Type | Class and Description |
---|---|
private class |
Replication.ReplicationStatisticsChore
Statistics task.
|
Modifier and Type | Field and Description |
---|---|
private org.apache.hadoop.conf.Configuration |
conf |
private MetricsReplicationGlobalSourceSource |
globalMetricsSource |
private boolean |
isReplicationForBulkLoadDataEnabled |
private static org.slf4j.Logger |
LOG |
private PeerProcedureHandler |
peerProcedureHandler |
private ReplicationQueueStorage |
queueStorage |
private ReplicationLoad |
replicationLoad |
private ReplicationSourceManager |
replicationManager |
private ReplicationPeers |
replicationPeers |
private Server |
server |
private int |
statsPeriodInSecond |
private SyncReplicationPeerInfoProvider |
syncReplicationPeerInfoProvider |
Constructor and Description |
---|
Replication()
Empty constructor
|
Modifier and Type | Method and Description |
---|---|
(package private) void |
addHFileRefsToQueue(TableName tableName,
byte[] family,
List<Pair<org.apache.hadoop.fs.Path,org.apache.hadoop.fs.Path>> pairs) |
void |
deregisterChildren(ConfigurationManager manager)
Needs to be called to deregister the children from the manager.
|
PeerProcedureHandler |
getPeerProcedureHandler()
Returns a Handler to handle peer procedures.
|
ReplicationSourceManager |
getReplicationManager()
Get the replication sources manager
|
ReplicationPeers |
getReplicationPeers()
Return the replication peers.
|
SyncReplicationPeerInfoProvider |
getSyncReplicationPeerInfoProvider()
Returns an info provider for sync replication peer.
|
void |
initialize(Server server,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path logDir,
org.apache.hadoop.fs.Path oldLogDir,
WALFactory walFactory)
Initializes the replication service object.
|
void |
onConfigurationChange(org.apache.hadoop.conf.Configuration conf)
This method would be called by the
ConfigurationManager object when the
Configuration object is reloaded from disk. |
ReplicationLoad |
refreshAndGetReplicationLoad()
Refresh and Get ReplicationLoad
|
void |
registerChildren(ConfigurationManager manager)
Needs to be called to register the children to the manager.
|
void |
startReplicationService()
If replication is enabled and this cluster is a master, it starts
|
void |
stopReplicationService()
Stops replication service.
|
private static final org.slf4j.Logger LOG
private boolean isReplicationForBulkLoadDataEnabled
private ReplicationSourceManager replicationManager
private ReplicationQueueStorage queueStorage
private ReplicationPeers replicationPeers
private volatile org.apache.hadoop.conf.Configuration conf
private SyncReplicationPeerInfoProvider syncReplicationPeerInfoProvider
private int statsPeriodInSecond
private ReplicationLoad replicationLoad
private MetricsReplicationGlobalSourceSource globalMetricsSource
private PeerProcedureHandler peerProcedureHandler
public Replication()
public void initialize(Server server, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path logDir, org.apache.hadoop.fs.Path oldLogDir, WALFactory walFactory) throws IOException
ReplicationService
initialize
in interface ReplicationService
IOException
public PeerProcedureHandler getPeerProcedureHandler()
ReplicationSourceService
getPeerProcedureHandler
in interface ReplicationSourceService
public void stopReplicationService()
stopReplicationService
in interface ReplicationService
public void startReplicationService() throws IOException
startReplicationService
in interface ReplicationService
IOException
public ReplicationSourceManager getReplicationManager()
getReplicationManager
in interface ReplicationSourceService
void addHFileRefsToQueue(TableName tableName, byte[] family, List<Pair<org.apache.hadoop.fs.Path,org.apache.hadoop.fs.Path>> pairs) throws IOException
IOException
public ReplicationLoad refreshAndGetReplicationLoad()
ReplicationService
refreshAndGetReplicationLoad
in interface ReplicationService
public SyncReplicationPeerInfoProvider getSyncReplicationPeerInfoProvider()
ReplicationSourceService
getSyncReplicationPeerInfoProvider
in interface ReplicationSourceService
public ReplicationPeers getReplicationPeers()
ReplicationSourceService
getReplicationPeers
in interface ReplicationSourceService
public void onConfigurationChange(org.apache.hadoop.conf.Configuration conf)
ConfigurationObserver
ConfigurationManager
object when the
Configuration
object is reloaded from disk.onConfigurationChange
in interface ConfigurationObserver
public void registerChildren(ConfigurationManager manager)
PropagatingConfigurationObserver
registerChildren
in interface PropagatingConfigurationObserver
manager
- : to register topublic void deregisterChildren(ConfigurationManager manager)
PropagatingConfigurationObserver
deregisterChildren
in interface PropagatingConfigurationObserver
manager
- : to deregister fromCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.