org.apache.hadoop.hbase.thrift
Class IncrementCoalescer

java.lang.Object
  extended by org.apache.hadoop.hbase.thrift.IncrementCoalescer
All Implemented Interfaces:
IncrementCoalescerMBean

public class IncrementCoalescer
extends Object
implements 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.


Field Summary
protected  org.apache.commons.logging.Log LOG
           
 
Constructor Summary
IncrementCoalescer(ThriftServerRunner.HBaseHandler hand)
           
 
Method Summary
 boolean canQueue()
           
 int getCorePoolSize()
           
 long getCountersMapSize()
           
 long getFailedIncrements()
           
 int getMaxPoolSize()
           
 int getMaxQueueSize()
           
 long getPoolCompletedTaskCount()
           
 int getPoolLargestPoolSize()
           
 long getPoolTaskCount()
           
 int getQueueSize()
           
 long getSuccessfulCoalescings()
           
 long getTotalIncrements()
           
 boolean queueIncrement(TIncrement inc)
           
 boolean queueIncrements(List<TIncrement> incs)
           
 void setCorePoolSize(int newCoreSize)
           
 void setMaxPoolSize(int newMaxSize)
           
 void setMaxQueueSize(int newSize)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

protected final org.apache.commons.logging.Log LOG
Constructor Detail

IncrementCoalescer

public IncrementCoalescer(ThriftServerRunner.HBaseHandler hand)
Method Detail

queueIncrement

public boolean queueIncrement(TIncrement inc)
                       throws org.apache.thrift.TException
Throws:
org.apache.thrift.TException

queueIncrements

public boolean queueIncrements(List<TIncrement> incs)
                        throws org.apache.thrift.TException
Throws:
org.apache.thrift.TException

canQueue

public boolean canQueue()

getQueueSize

public int getQueueSize()
Specified by:
getQueueSize in interface IncrementCoalescerMBean

getMaxQueueSize

public int getMaxQueueSize()
Specified by:
getMaxQueueSize in interface IncrementCoalescerMBean

setMaxQueueSize

public void setMaxQueueSize(int newSize)
Specified by:
setMaxQueueSize in interface IncrementCoalescerMBean

getPoolCompletedTaskCount

public long getPoolCompletedTaskCount()
Specified by:
getPoolCompletedTaskCount in interface IncrementCoalescerMBean

getPoolTaskCount

public long getPoolTaskCount()
Specified by:
getPoolTaskCount in interface IncrementCoalescerMBean

getPoolLargestPoolSize

public int getPoolLargestPoolSize()
Specified by:
getPoolLargestPoolSize in interface IncrementCoalescerMBean

getCorePoolSize

public int getCorePoolSize()
Specified by:
getCorePoolSize in interface IncrementCoalescerMBean

setCorePoolSize

public void setCorePoolSize(int newCoreSize)
Specified by:
setCorePoolSize in interface IncrementCoalescerMBean

getMaxPoolSize

public int getMaxPoolSize()
Specified by:
getMaxPoolSize in interface IncrementCoalescerMBean

setMaxPoolSize

public void setMaxPoolSize(int newMaxSize)
Specified by:
setMaxPoolSize in interface IncrementCoalescerMBean

getFailedIncrements

public long getFailedIncrements()
Specified by:
getFailedIncrements in interface IncrementCoalescerMBean

getSuccessfulCoalescings

public long getSuccessfulCoalescings()
Specified by:
getSuccessfulCoalescings in interface IncrementCoalescerMBean

getTotalIncrements

public long getTotalIncrements()
Specified by:
getTotalIncrements in interface IncrementCoalescerMBean

getCountersMapSize

public long getCountersMapSize()
Specified by:
getCountersMapSize in interface IncrementCoalescerMBean


Copyright © 2015 The Apache Software Foundation. All rights reserved.