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
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final intstatic final Stringstatic final longprivate final longprivate final longprivate final AsyncClusterConnectionprivate final Queue<RegionReplicationSink.SinkEntry>private final org.agrona.collections.IntHashSetprivate final RegionReplicationFlushRequesterprivate longprivate static final org.slf4j.Loggerprivate final RegionReplicationBufferManagerstatic final Stringstatic final longstatic final Stringstatic final longprivate final longprivate final longstatic final Stringstatic final longprivate final longprivate longprivate final RegionInfoprivate final intprivate final intstatic final Stringstatic final intstatic final Stringstatic final longprivate final longprivate booleanprivate booleanprivate booleanprivate final TableDescriptor -
Constructor Summary
ConstructorsConstructorDescriptionRegionReplicationSink(org.apache.hadoop.conf.Configuration conf, RegionInfo primary, TableDescriptor td, RegionReplicationBufferManager manager, Runnable flushRequester, AsyncClusterConnection conn) -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(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 booleanisStartFlushAllStores(org.apache.hadoop.hbase.shaded.protobuf.generated.WALProtos.FlushDescriptor flushDesc) (package private) voidonComplete(List<RegionReplicationSink.SinkEntry> sent, Map<Integer, org.apache.commons.lang3.mutable.MutableObject<Throwable>> replica2Error) (package private) longprivate voidsend()voidstop()Stop the replication sink.voidMake 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. TherpcCallis 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()
-