org.apache.james.system.hbase
Class TablePool

java.lang.Object
  extended by org.apache.james.system.hbase.TablePool

public class TablePool
extends Object

Table Pool singleton to get the DomainList, RecipientRewriteTable and UserRepository HBase tables. TODO Two getInstance methods are public, one for the impl, one for the tests. This is not good.


Constructor Summary
TablePool()
           
 
Method Summary
 org.apache.hadoop.hbase.client.HTable getDomainlistTable()
          Get an instance of the HDomainList table.
static TablePool getInstance()
          Use getInstance to get an instance of the HTablePool.
static TablePool getInstance(org.apache.hadoop.conf.Configuration configuration)
          Use getInstance to get an instance of the HTablePool.
 org.apache.hadoop.hbase.client.HTable getRecipientRewriteTable()
          Get an instance of the RecipientRewriteTable table.
 org.apache.hadoop.hbase.client.HTable getUsersRepositoryTable()
          Get an instance of the UsersRepository table.
 void putTable(org.apache.hadoop.hbase.client.HTable table)
          Put back the table in the pool after usage.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TablePool

public TablePool()
Method Detail

getInstance

public static TablePool getInstance()
                             throws IOException
Use getInstance to get an instance of the HTablePool. Don't give any configuration, the default one will be used via HBaseConfiguration.create(Configuration). If you want to create the instance with a specific HBaseConfiguration, use getInstance(Configuration)

Returns:
An instance using a default configuration
Throws:
IOException

getInstance

public static TablePool getInstance(org.apache.hadoop.conf.Configuration configuration)
                             throws IOException
Use getInstance to get an instance of the HTablePool. You can give at first call a specific HBaseConfiguration to suit your needs.

Parameters:
configuration -
Returns:
An instance of HTablePool
Throws:
IOException

getDomainlistTable

public org.apache.hadoop.hbase.client.HTable getDomainlistTable()
Get an instance of the HDomainList table.

Returns:
An instance of HDomainList

getRecipientRewriteTable

public org.apache.hadoop.hbase.client.HTable getRecipientRewriteTable()
Get an instance of the RecipientRewriteTable table.

Returns:
An instance of RecipientRewriteTable

getUsersRepositoryTable

public org.apache.hadoop.hbase.client.HTable getUsersRepositoryTable()
Get an instance of the UsersRepository table.

Returns:
An instance of UsersRepository

putTable

public void putTable(org.apache.hadoop.hbase.client.HTable table)
Put back the table in the pool after usage. With later HBase versions, we won't have to put back the table in the pool. See https://issues.apache.org/jira/browse/HBASE-4054

Parameters:
table -


Copyright © 2002-2012 The Apache Software Foundation. All Rights Reserved.