Class Replication
java.lang.Object
org.apache.hadoop.hbase.replication.regionserver.Replication
- All Implemented Interfaces:
ConfigurationObserver
,PropagatingConfigurationObserver
,ReplicationService
,ReplicationSourceService
@Private
public class Replication
extends Object
implements ReplicationSourceService, PropagatingConfigurationObserver
Gateway to Replication. Used by
HRegionServer
.
Implement PropagatingConfigurationObserver
mainly for registering
ReplicationPeers
, so we can recreating the replication peer storage.
-
Nested Class Summary
Modifier and TypeClassDescriptionprivate final class
Statistics task. -
Field Summary
Modifier and TypeFieldDescriptionprivate org.apache.hadoop.conf.Configuration
private boolean
private static final org.slf4j.Logger
private PeerProcedureHandler
private ReplicationQueueStorage
private ReplicationLoad
private ReplicationSourceManager
private ReplicationPeers
private Server
private int
private SyncReplicationPeerInfoProvider
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription(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.Returns a Handler to handle peer procedures.Get the replication sources managerReturn the replication peers.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 theConfigurationManager
object when theConfiguration
object is reloaded from disk.Refresh and Get ReplicationLoadvoid
registerChildren
(ConfigurationManager manager) Needs to be called to register the children to the manager.void
If replication is enabled and this cluster is a master, it startsvoid
Stops replication service.
-
Field Details
-
LOG
-
isReplicationForBulkLoadDataEnabled
-
replicationManager
-
queueStorage
-
replicationPeers
-
conf
-
syncReplicationPeerInfoProvider
-
server
-
statsPeriodInSecond
-
replicationLoad
-
globalMetricsSource
-
peerProcedureHandler
-
-
Constructor Details
-
Replication
public Replication()Empty constructor
-
-
Method Details
-
initialize
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 Description copied from interface:ReplicationService
Initializes the replication service object.- Specified by:
initialize
in interfaceReplicationService
- Throws:
IOException
-
getPeerProcedureHandler
Description copied from interface:ReplicationSourceService
Returns a Handler to handle peer procedures.- Specified by:
getPeerProcedureHandler
in interfaceReplicationSourceService
-
stopReplicationService
Stops replication service.- Specified by:
stopReplicationService
in interfaceReplicationService
-
startReplicationService
If replication is enabled and this cluster is a master, it starts- Specified by:
startReplicationService
in interfaceReplicationService
- Throws:
IOException
-
getReplicationManager
Get the replication sources manager- Specified by:
getReplicationManager
in interfaceReplicationSourceService
- Returns:
- the manager if replication is enabled, else returns false
-
addHFileRefsToQueue
void addHFileRefsToQueue(TableName tableName, byte[] family, List<Pair<org.apache.hadoop.fs.Path, org.apache.hadoop.fs.Path>> pairs) throws IOException- Throws:
IOException
-
refreshAndGetReplicationLoad
Description copied from interface:ReplicationService
Refresh and Get ReplicationLoad- Specified by:
refreshAndGetReplicationLoad
in interfaceReplicationService
-
getSyncReplicationPeerInfoProvider
Description copied from interface:ReplicationSourceService
Returns an info provider for sync replication peer.- Specified by:
getSyncReplicationPeerInfoProvider
in interfaceReplicationSourceService
-
getReplicationPeers
Description copied from interface:ReplicationSourceService
Return the replication peers.- Specified by:
getReplicationPeers
in interfaceReplicationSourceService
-
onConfigurationChange
Description copied from interface:ConfigurationObserver
This method would be called by theConfigurationManager
object when theConfiguration
object is reloaded from disk.- Specified by:
onConfigurationChange
in interfaceConfigurationObserver
-
registerChildren
Description copied from interface:PropagatingConfigurationObserver
Needs to be called to register the children to the manager.- Specified by:
registerChildren
in interfacePropagatingConfigurationObserver
- Parameters:
manager
- : to register to
-
deregisterChildren
Description copied from interface:PropagatingConfigurationObserver
Needs to be called to deregister the children from the manager.- Specified by:
deregisterChildren
in interfacePropagatingConfigurationObserver
- Parameters:
manager
- : to deregister from
-