@InterfaceAudience.Private public class RegionReplicationBufferManager extends Object
RegionReplicationSink
.
If the buffer size exceeds the soft limit, we will find out the region with largest pending size
and trigger a flush, so it can drop all the pending entries and save memories.
If the buffer size exceeds the hard limit, we will return false
for
increase(long)
and let the RegionReplicationSink
to drop the edits immediately.Modifier and Type | Field and Description |
---|---|
private ThreadPoolExecutor |
executor |
private static org.slf4j.Logger |
LOG |
static String |
MAX_PENDING_SIZE
This is the total size of pending entries for all the sinks.
|
static long |
MAX_PENDING_SIZE_DEFAULT |
private long |
maxPendingSize |
private AtomicLong |
pendingSize |
private RegionServerServices |
rsServices |
static String |
SOFT_LIMIT_PERCENTAGE |
static float |
SOFT_LIMIT_PERCENTAGE_DEFAULT |
private long |
softMaxPendingSize |
Constructor and Description |
---|
RegionReplicationBufferManager(RegionServerServices rsServices) |
Modifier and Type | Method and Description |
---|---|
void |
decrease(long size)
Called after you ship the edits out.
|
private void |
flush() |
boolean |
increase(long size)
Return whether we should just drop all the edits, if we have reached the hard limit of max
pending size.
|
void |
stop() |
private static final org.slf4j.Logger LOG
public static final String MAX_PENDING_SIZE
public static final long MAX_PENDING_SIZE_DEFAULT
public static final String SOFT_LIMIT_PERCENTAGE
public static final float SOFT_LIMIT_PERCENTAGE_DEFAULT
private final RegionServerServices rsServices
private final long maxPendingSize
private final long softMaxPendingSize
private final AtomicLong pendingSize
private final ThreadPoolExecutor executor
public RegionReplicationBufferManager(RegionServerServices rsServices)
private void flush()
public boolean increase(long size)
true
means OK, false
means drop all the edits.public void decrease(long size)
public void stop()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.