public class HbaseUtils extends Object
| Constructor and Description |
|---|
HbaseUtils() |
| Modifier and Type | Method and Description |
|---|---|
static DataAccessException |
convertHbaseException(Exception ex)
Converts the given (Hbase) exception to an appropriate exception from org.springframework.dao hierarchy.
|
static HTableInterface |
getHTable(String tableName,
Configuration configuration)
Retrieves an Hbase table instance identified by its name.
|
static HTableInterface |
getHTable(String tableName,
Configuration configuration,
Charset charset,
HTableInterfaceFactory tableFactory)
Retrieves an Hbase table instance identified by its name and charset using the given table factory.
|
static void |
releaseTable(String tableName,
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(String tableName,
HTableInterface table,
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 DataAccessException convertHbaseException(Exception ex)
ex - Hbase exception that occurredpublic static HTableInterface getHTable(String tableName, Configuration configuration)
configuration - Hbase configuration objecttableName - table namepublic static HTableInterface getHTable(String tableName, Configuration configuration, Charset charset, HTableInterfaceFactory tableFactory)
tableName - table nameconfiguration - Hbase configuration objectcharset - name charset (may be null)tableFactory - table factory (may be null)public static void releaseTable(String tableName, HTableInterface table)
tableName - table nametable - tablepublic static void releaseTable(String tableName, HTableInterface table, HTableInterfaceFactory tableFactory)
tableName - table nametable - tabletableFactory - table factory