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
Nested ClassesModifier and TypeClassDescription(package private) static classUsed to identify a cell that will be incremented. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intprivate final ConcurrentMap<IncrementCoalescer.FullyQualifiedRow,Long> private final LongAdderprivate final ThriftHBaseServiceHandlerprivate static final org.slf4j.Loggerprivate intprivate final ThreadPoolExecutorprivate final LongAdderprivate final LongAdder -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanQueue()private voiddynamicallySetCoreSize(int countersMapSize) This method samples the incoming requests and, if selected, will check if the corePoolSize should be changed.intlonglongintintlongintlongintlonglongprivate booleaninternalQueueIncrement(byte[] tableName, byte[] rowKey, byte[] fam, byte[] qual, long ammount) private booleaninternalQueueTincrement(org.apache.hadoop.hbase.thrift.generated.TIncrement inc) booleanqueueIncrement(org.apache.hadoop.hbase.thrift.generated.TIncrement inc) booleanqueueIncrements(List<org.apache.hadoop.hbase.thrift.generated.TIncrement> incs) voidsetCorePoolSize(int newCoreSize) voidsetMaxPoolSize(int newMaxSize) voidsetMaxQueueSize(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:
getQueueSizein interfaceIncrementCoalescerMBean
-
getMaxQueueSize
- Specified by:
getMaxQueueSizein interfaceIncrementCoalescerMBean
-
setMaxQueueSize
- Specified by:
setMaxQueueSizein interfaceIncrementCoalescerMBean
-
getPoolCompletedTaskCount
- Specified by:
getPoolCompletedTaskCountin interfaceIncrementCoalescerMBean
-
getPoolTaskCount
- Specified by:
getPoolTaskCountin interfaceIncrementCoalescerMBean
-
getPoolLargestPoolSize
- Specified by:
getPoolLargestPoolSizein interfaceIncrementCoalescerMBean
-
getCorePoolSize
- Specified by:
getCorePoolSizein interfaceIncrementCoalescerMBean
-
setCorePoolSize
- Specified by:
setCorePoolSizein interfaceIncrementCoalescerMBean
-
getMaxPoolSize
- Specified by:
getMaxPoolSizein interfaceIncrementCoalescerMBean
-
setMaxPoolSize
- Specified by:
setMaxPoolSizein interfaceIncrementCoalescerMBean
-
getFailedIncrements
- Specified by:
getFailedIncrementsin interfaceIncrementCoalescerMBean
-
getSuccessfulCoalescings
- Specified by:
getSuccessfulCoalescingsin interfaceIncrementCoalescerMBean
-
getTotalIncrements
- Specified by:
getTotalIncrementsin interfaceIncrementCoalescerMBean
-
getCountersMapSize
- Specified by:
getCountersMapSizein interfaceIncrementCoalescerMBean
-