@InterfaceAudience.Private public class ReplicationSink extends Object
This class is responsible for replicating the edits coming from another cluster.
This replication process is currently waiting for the edits to be applied before the method can return. This means that the replication of edits is synchronized (after reading from WALs in ReplicationSource) and that a single region server cannot receive edits from two sources at the same time
This class uses the native HBase client in order to replicate entries.
TODO make this class more like ReplicationSource wrt log handling| Constructor and Description |
|---|
ReplicationSink(org.apache.hadoop.conf.Configuration conf,
RegionServerCoprocessorHost rsServerHost)
Create a sink for replication
|
| Modifier and Type | Method and Description |
|---|---|
MetricsSink |
getSinkMetrics()
Get replication Sink Metrics
|
String |
getStats()
Get a string representation of this sink's metrics
|
void |
replicateEntries(List<org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.WALEntry> entries,
CellScanner cells,
String replicationClusterId,
String sourceBaseNamespaceDirPath,
String sourceHFileArchiveDirPath)
Replicate this array of entries directly into the local cluster using the native client.
|
void |
stopReplicationSinkServices()
stop the thread pool executor.
|
public ReplicationSink(org.apache.hadoop.conf.Configuration conf,
RegionServerCoprocessorHost rsServerHost)
throws IOException
conf - conf objectIOException - thrown when HDFS goes bad or bad file namepublic void replicateEntries(List<org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.WALEntry> entries, CellScanner cells, String replicationClusterId, String sourceBaseNamespaceDirPath, String sourceHFileArchiveDirPath) throws IOException
entries - WAL entries to be replicated.cells - cell scanner for iteration.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
directorysourceHFileArchiveDirPath - Path that point to the source cluster hfile archive directoryIOException - If failed to replicate the datapublic void stopReplicationSinkServices()
public String getStats()
public MetricsSink getSinkMetrics()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.