org.apache.hadoop.hbase.client
Class HTableMultiplexer

java.lang.Object
  extended by org.apache.hadoop.hbase.client.HTableMultiplexer

@InterfaceAudience.Public
@InterfaceStability.Evolving
public class HTableMultiplexer
extends Object

HTableMultiplexer provides a thread-safe non blocking PUT API across all the tables. Each put will be sharded into different buffer queues based on its destination region server. So each region server buffer queue will only have the puts which share the same destination. And each queue will have a flush worker thread to flush the puts request to the region server. If any queue is full, the HTableMultiplexer starts to drop the Put requests for that particular queue. Also all the puts will be retried as a configuration number before dropping. And the HTableMultiplexer can report the number of buffered requests and the number of the failed (dropped) requests in total or on per region server basis. This class is thread safe.


Nested Class Summary
static class HTableMultiplexer.HTableMultiplexerStatus
          HTableMultiplexerStatus keeps track of the current status of the HTableMultiplexer.
 
Field Summary
static String TABLE_MULTIPLEXER_FLUSH_PERIOD_MS
           
static String TABLE_MULTIPLEXER_INIT_THREADS
           
static String TABLE_MULTIPLEXER_MAX_RETRIES_IN_QUEUE
           
 
Constructor Summary
HTableMultiplexer(org.apache.hadoop.conf.Configuration conf, int perRegionServerBufferQueueSize)
           
 
Method Summary
 HTableMultiplexer.HTableMultiplexerStatus getHTableMultiplexerStatus()
           
 List<Put> put(byte[] tableName, List<Put> puts)
          Deprecated. 
 boolean put(byte[] tableName, Put put)
          Deprecated. 
 boolean put(byte[] tableName, Put put, int retry)
          Deprecated. 
 List<Put> put(TableName tableName, List<Put> puts)
          The puts request will be buffered by their corresponding buffer queue.
 boolean put(TableName tableName, Put put)
          The put request will be buffered by its corresponding buffer queue.
 boolean put(TableName tableName, Put put, int retry)
          The put request will be buffered by its corresponding buffer queue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TABLE_MULTIPLEXER_FLUSH_PERIOD_MS

public static final String TABLE_MULTIPLEXER_FLUSH_PERIOD_MS
See Also:
Constant Field Values

TABLE_MULTIPLEXER_INIT_THREADS

public static final String TABLE_MULTIPLEXER_INIT_THREADS
See Also:
Constant Field Values

TABLE_MULTIPLEXER_MAX_RETRIES_IN_QUEUE

public static final String TABLE_MULTIPLEXER_MAX_RETRIES_IN_QUEUE
See Also:
Constant Field Values
Constructor Detail

HTableMultiplexer

public HTableMultiplexer(org.apache.hadoop.conf.Configuration conf,
                         int perRegionServerBufferQueueSize)
                  throws IOException
Parameters:
conf - The HBaseConfiguration
perRegionServerBufferQueueSize - determines the max number of the buffered Put ops for each region server before dropping the request.
Throws:
IOException
Method Detail

put

public boolean put(TableName tableName,
                   Put put)
The put request will be buffered by its corresponding buffer queue. Return false if the queue is already full.

Parameters:
tableName -
put -
Returns:
true if the request can be accepted by its corresponding buffer queue.
Throws:
IOException

put

public List<Put> put(TableName tableName,
                     List<Put> puts)
The puts request will be buffered by their corresponding buffer queue. Return the list of puts which could not be queued.

Parameters:
tableName -
puts -
Returns:
the list of puts which could not be queued
Throws:
IOException

put

@Deprecated
public List<Put> put(byte[] tableName,
                                List<Put> puts)
Deprecated. 

Deprecated. Use put(TableName, List) instead.


put

public boolean put(TableName tableName,
                   Put put,
                   int retry)
The put request will be buffered by its corresponding buffer queue. And the put request will be retried before dropping the request. Return false if the queue is already full.

Returns:
true if the request can be accepted by its corresponding buffer queue.
Throws:
IOException

put

@Deprecated
public boolean put(byte[] tableName,
                              Put put,
                              int retry)
Deprecated. 

Deprecated. Use put(TableName, Put) instead.


put

@Deprecated
public boolean put(byte[] tableName,
                              Put put)
Deprecated. 

Deprecated. Use put(TableName, Put) instead.


getHTableMultiplexerStatus

public HTableMultiplexer.HTableMultiplexerStatus getHTableMultiplexerStatus()
Returns:
the current HTableMultiplexerStatus


Copyright © 2015 The Apache Software Foundation. All Rights Reserved.