Package org.apache.hadoop.hbase.thrift
Class IncrementCoalescer
java.lang.Object
org.apache.hadoop.hbase.thrift.IncrementCoalescer
- All Implemented Interfaces:
IncrementCoalescerMBean
This class will coalesce increments from a thift server if
hbase.regionserver.thrift.coalesceIncrement is set to true. Turning this config to true will
cause the thrift server to queue increments into an instance of this class. The thread pool
associated with this class will drain the coalesced increments as the thread is able. This can
cause data loss if the thrift server dies or is shut down before everything in the queue is
drained.
-
Nested Class Summary
Modifier and TypeClassDescription(package private) static class
Used to identify a cell that will be incremented. -
Field Summary
Modifier and TypeFieldDescriptionprivate static final int
private final ConcurrentMap<IncrementCoalescer.FullyQualifiedRow,
Long> private final LongAdder
private final ThriftHBaseServiceHandler
private static final org.slf4j.Logger
private int
private final ThreadPoolExecutor
private final LongAdder
private final LongAdder
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canQueue()
private void
dynamicallySetCoreSize
(int countersMapSize) This method samples the incoming requests and, if selected, will check if the corePoolSize should be changed.int
long
long
int
int
long
int
long
int
long
long
private boolean
internalQueueIncrement
(byte[] tableName, byte[] rowKey, byte[] fam, byte[] qual, long ammount) private boolean
internalQueueTincrement
(org.apache.hadoop.hbase.thrift.generated.TIncrement inc) boolean
queueIncrement
(org.apache.hadoop.hbase.thrift.generated.TIncrement inc) boolean
queueIncrements
(List<org.apache.hadoop.hbase.thrift.generated.TIncrement> incs) void
setCorePoolSize
(int newCoreSize) void
setMaxPoolSize
(int newMaxSize) void
setMaxQueueSize
(int newSize)
-
Field Details
-
failedIncrements
-
successfulCoalescings
-
totalIncrements
-
countersMap
-
pool
-
handler
-
maxQueueSize
-
CORE_POOL_SIZE
- See Also:
-
LOG
-
-
Constructor Details
-
IncrementCoalescer
-
-
Method Details
-
queueIncrement
-
queueIncrements
-
internalQueueTincrement
-
internalQueueIncrement
private boolean internalQueueIncrement(byte[] tableName, byte[] rowKey, byte[] fam, byte[] qual, long ammount) -
canQueue
-
createIncCallable
-
dynamicallySetCoreSize
This method samples the incoming requests and, if selected, will check if the corePoolSize should be changed.- Parameters:
countersMapSize
- the size of the counters map
-
getQueueSize
- Specified by:
getQueueSize
in interfaceIncrementCoalescerMBean
-
getMaxQueueSize
- Specified by:
getMaxQueueSize
in interfaceIncrementCoalescerMBean
-
setMaxQueueSize
- Specified by:
setMaxQueueSize
in interfaceIncrementCoalescerMBean
-
getPoolCompletedTaskCount
- Specified by:
getPoolCompletedTaskCount
in interfaceIncrementCoalescerMBean
-
getPoolTaskCount
- Specified by:
getPoolTaskCount
in interfaceIncrementCoalescerMBean
-
getPoolLargestPoolSize
- Specified by:
getPoolLargestPoolSize
in interfaceIncrementCoalescerMBean
-
getCorePoolSize
- Specified by:
getCorePoolSize
in interfaceIncrementCoalescerMBean
-
setCorePoolSize
- Specified by:
setCorePoolSize
in interfaceIncrementCoalescerMBean
-
getMaxPoolSize
- Specified by:
getMaxPoolSize
in interfaceIncrementCoalescerMBean
-
setMaxPoolSize
- Specified by:
setMaxPoolSize
in interfaceIncrementCoalescerMBean
-
getFailedIncrements
- Specified by:
getFailedIncrements
in interfaceIncrementCoalescerMBean
-
getSuccessfulCoalescings
- Specified by:
getSuccessfulCoalescings
in interfaceIncrementCoalescerMBean
-
getTotalIncrements
- Specified by:
getTotalIncrements
in interfaceIncrementCoalescerMBean
-
getCountersMapSize
- Specified by:
getCountersMapSize
in interfaceIncrementCoalescerMBean
-