@InterfaceAudience.Private public class Replication extends Object implements ReplicationSourceService, ReplicationSinkService
HRegionServer
.Modifier and Type | Class and Description |
---|---|
private static class |
Replication.ReplicationStatisticsTask
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 ReplicationSink |
replicationSink |
private ScheduledExecutorService |
scheduleThreadPool
Statistics thread schedule pool
|
private Server |
server |
private int |
statsThreadPeriod |
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) |
private void |
buildReplicationLoad() |
PeerProcedureHandler |
getPeerProcedureHandler()
Returns a Handler to handle peer procedures.
|
ReplicationSourceManager |
getReplicationManager()
Get the replication sources manager
|
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 |
join()
Join with the replication threads
|
ReplicationLoad |
refreshAndGetReplicationLoad()
Refresh and Get ReplicationLoad
|
void |
replicateLogEntries(List<org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.WALEntry> entries,
CellScanner cells,
String replicationClusterId,
String sourceBaseNamespaceDirPath,
String sourceHFileArchiveDirPath)
Carry on the list of log entries down to the sink
|
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 org.apache.hadoop.conf.Configuration conf
private ReplicationSink replicationSink
private ScheduledExecutorService scheduleThreadPool
private int statsThreadPeriod
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 join()
public void replicateLogEntries(List<org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.WALEntry> entries, CellScanner cells, String replicationClusterId, String sourceBaseNamespaceDirPath, String sourceHFileArchiveDirPath) throws IOException
replicateLogEntries
in interface ReplicationSinkService
entries
- list of entries to replicatecells
- The data -- the cells -- that entries
describes
(the entries do not contain the Cells we are replicating;
they are passed here on the side in this CellScanner).replicationClusterId
- Id which will uniquely identify source cluster FS client
configurations in the replication configuration directorysourceBaseNamespaceDirPath
- Path that point to the source cluster base namespace
directory required for replicating hfilessourceHFileArchiveDirPath
- Path that point to the source cluster hfile archive directory
nIOException
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
private void buildReplicationLoad()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.