public class HbaseUtils
extends java.lang.Object
Constructor and Description |
---|
HbaseUtils() |
Modifier and Type | Method and Description |
---|---|
static org.springframework.dao.DataAccessException |
convertHbaseException(java.lang.Exception ex)
Converts the given (Hbase) exception to an appropriate exception from org.springframework.dao hierarchy.
|
static org.apache.hadoop.hbase.client.HTableInterface |
getHTable(java.lang.String tableName,
org.apache.hadoop.conf.Configuration configuration)
Retrieves an Hbase table instance identified by its name.
|
static org.apache.hadoop.hbase.client.HTableInterface |
getHTable(java.lang.String tableName,
org.apache.hadoop.conf.Configuration configuration,
java.nio.charset.Charset charset,
org.apache.hadoop.hbase.client.HTableInterfaceFactory tableFactory)
Retrieves an Hbase table instance identified by its name and charset using the given table factory.
|
static void |
releaseTable(java.lang.String tableName,
org.apache.hadoop.hbase.client.HTableInterface table)
Releases (or closes) the given table, created via the given configuration if it is not managed externally (or bound to the thread).
|
static void |
releaseTable(java.lang.String tableName,
org.apache.hadoop.hbase.client.HTableInterface table,
org.apache.hadoop.hbase.client.HTableInterfaceFactory tableFactory)
Releases (or closes) the given table, created via the given configuration if it is not managed externally (or bound to the thread).
|
public static org.springframework.dao.DataAccessException convertHbaseException(java.lang.Exception ex)
ex
- Hbase exception that occurredpublic static org.apache.hadoop.hbase.client.HTableInterface getHTable(java.lang.String tableName, org.apache.hadoop.conf.Configuration configuration)
configuration
- Hbase configuration objecttableName
- table namepublic static org.apache.hadoop.hbase.client.HTableInterface getHTable(java.lang.String tableName, org.apache.hadoop.conf.Configuration configuration, java.nio.charset.Charset charset, org.apache.hadoop.hbase.client.HTableInterfaceFactory tableFactory)
tableName
- table nameconfiguration
- Hbase configuration objectcharset
- name charset (may be null)tableFactory
- table factory (may be null)public static void releaseTable(java.lang.String tableName, org.apache.hadoop.hbase.client.HTableInterface table)
tableName
- table nametable
- tablepublic static void releaseTable(java.lang.String tableName, org.apache.hadoop.hbase.client.HTableInterface table, org.apache.hadoop.hbase.client.HTableInterfaceFactory tableFactory)
tableName
- table nametable
- tabletableFactory
- table factory