Class RegionReplicationSink
java.lang.Object
org.apache.hadoop.hbase.regionserver.regionreplication.RegionReplicationSink
The class for replicating WAL edits to secondary replicas, one instance per region.
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final int
static final String
static final long
private final long
private final long
private final AsyncClusterConnection
private final Queue<RegionReplicationSink.SinkEntry>
private final org.agrona.collections.IntHashSet
private final RegionReplicationFlushRequester
private long
private static final org.slf4j.Logger
private final RegionReplicationBufferManager
static final String
static final long
static final String
static final long
private final long
private final long
static final String
static final long
private final long
private long
private final RegionInfo
private final int
private final int
static final String
static final int
static final String
static final long
private final long
private boolean
private boolean
private boolean
private final TableDescriptor
-
Constructor Summary
ConstructorDescriptionRegionReplicationSink
(org.apache.hadoop.conf.Configuration conf, RegionInfo primary, TableDescriptor td, RegionReplicationBufferManager manager, Runnable flushRequester, AsyncClusterConnection conn) -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(WALKeyImpl key, WALEdit edit, ServerCall<?> rpcCall) Add this edit to replication queue.private long
(package private) org.agrona.collections.IntHashSet
(package private) Optional<org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.FlushDescriptor>
getStartFlushAllDescriptor
(Cell metaCell) private boolean
isStartFlushAllStores
(org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.FlushDescriptor flushDesc) (package private) void
onComplete
(List<RegionReplicationSink.SinkEntry> sent, Map<Integer, org.apache.commons.lang3.mutable.MutableObject<Throwable>> replica2Error) (package private) long
private void
send()
void
stop()
Stop the replication sink.void
Make sure that we have finished all the replicating requests.
-
Field Details
-
LOG
-
RETRIES_NUMBER
- See Also:
-
RETRIES_NUMBER_DEFAULT
- See Also:
-
RPC_TIMEOUT_MS
- See Also:
-
RPC_TIMEOUT_MS_DEFAULT
- See Also:
-
OPERATION_TIMEOUT_MS
- See Also:
-
OPERATION_TIMEOUT_MS_DEFAULT
- See Also:
-
META_EDIT_RPC_TIMEOUT_MS
- See Also:
-
META_EDIT_RPC_TIMEOUT_MS_DEFAULT
- See Also:
-
META_EDIT_OPERATION_TIMEOUT_MS
- See Also:
-
META_EDIT_OPERATION_TIMEOUT_MS_DEFAULT
- See Also:
-
BATCH_SIZE_CAPACITY
- See Also:
-
BATCH_SIZE_CAPACITY_DEFAULT
- See Also:
-
BATCH_COUNT_CAPACITY
- See Also:
-
BATCH_COUNT_CAPACITY_DEFAULT
- See Also:
-
-
tableDesc
-
regionReplication
-
manager
-
flushRequester
-
conn
-
failedReplicas
-
entries
-
retries
-
rpcTimeoutNs
-
operationTimeoutNs
-
metaEditRpcTimeoutNs
-
metaEditOperationTimeoutNs
-
batchSizeCapacity
-
batchCountCapacity
-
pendingSize
-
lastFlushedSequenceId
-
sending
-
stopping
-
stopped
-
-
Constructor Details
-
RegionReplicationSink
public RegionReplicationSink(org.apache.hadoop.conf.Configuration conf, RegionInfo primary, TableDescriptor td, RegionReplicationBufferManager manager, Runnable flushRequester, AsyncClusterConnection conn)
-
-
Method Details
-
onComplete
void onComplete(List<RegionReplicationSink.SinkEntry> sent, Map<Integer, org.apache.commons.lang3.mutable.MutableObject<Throwable>> replica2Error) -
send
-
isStartFlushAllStores
private boolean isStartFlushAllStores(org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.FlushDescriptor flushDesc) -
getStartFlushAllDescriptor
Optional<org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.FlushDescriptor> getStartFlushAllDescriptor(Cell metaCell) -
clearAllEntries
-
add
Add this edit to replication queue. TherpcCall
is for retaining the cells if the edit is built within an rpc call and the rpc call has cell scanner, which is off heap. -
pendingSize
long pendingSize() -
stop
Stop the replication sink. Usually this should only be called when you want to close a region. -
waitUntilStopped
Make sure that we have finished all the replicating requests. After returning, we can make sure there will be no new replicating requests to secondary replicas. This is used to keep the replicating order the same with the WAL edit order when writing.- Throws:
InterruptedException
-
getFailedReplicas
org.agrona.collections.IntHashSet getFailedReplicas()
-