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
Nested ClassesModifier and TypeClassDescriptionprivate final classStatistics task. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.apache.hadoop.conf.Configurationprivate booleanprivate static final org.slf4j.Loggerprivate PeerProcedureHandlerprivate ReplicationQueueStorageprivate ReplicationLoadprivate ReplicationSourceManagerprivate ReplicationPeersprivate Serverprivate intprivate SyncReplicationPeerInfoProvider -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) voidaddHFileRefsToQueue(TableName tableName, byte[] family, List<Pair<org.apache.hadoop.fs.Path, org.apache.hadoop.fs.Path>> pairs) voidderegisterChildren(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.voidinitialize(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.voidonConfigurationChange(org.apache.hadoop.conf.Configuration conf) This method would be called by theConfigurationManagerobject when theConfigurationobject is reloaded from disk.Refresh and Get ReplicationLoadvoidregisterChildren(ConfigurationManager manager) Needs to be called to register the children to the manager.voidIf replication is enabled and this cluster is a master, it startsvoidStops 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:ReplicationServiceInitializes the replication service object.- Specified by:
initializein interfaceReplicationService- Throws:
IOException
-
getPeerProcedureHandler
Description copied from interface:ReplicationSourceServiceReturns a Handler to handle peer procedures.- Specified by:
getPeerProcedureHandlerin interfaceReplicationSourceService
-
stopReplicationService
Stops replication service.- Specified by:
stopReplicationServicein interfaceReplicationService
-
startReplicationService
If replication is enabled and this cluster is a master, it starts- Specified by:
startReplicationServicein interfaceReplicationService- Throws:
IOException
-
getReplicationManager
Get the replication sources manager- Specified by:
getReplicationManagerin 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:ReplicationServiceRefresh and Get ReplicationLoad- Specified by:
refreshAndGetReplicationLoadin interfaceReplicationService
-
getSyncReplicationPeerInfoProvider
Description copied from interface:ReplicationSourceServiceReturns an info provider for sync replication peer.- Specified by:
getSyncReplicationPeerInfoProviderin interfaceReplicationSourceService
-
getReplicationPeers
Description copied from interface:ReplicationSourceServiceReturn the replication peers.- Specified by:
getReplicationPeersin interfaceReplicationSourceService
-
onConfigurationChange
Description copied from interface:ConfigurationObserverThis method would be called by theConfigurationManagerobject when theConfigurationobject is reloaded from disk.- Specified by:
onConfigurationChangein interfaceConfigurationObserver
-
registerChildren
Description copied from interface:PropagatingConfigurationObserverNeeds to be called to register the children to the manager.- Specified by:
registerChildrenin interfacePropagatingConfigurationObserver- Parameters:
manager- : to register to
-
deregisterChildren
Description copied from interface:PropagatingConfigurationObserverNeeds to be called to deregister the children from the manager.- Specified by:
deregisterChildrenin interfacePropagatingConfigurationObserver- Parameters:
manager- : to deregister from
-