public abstract class HbaseSynchronizationManager extends Object
HbaseInterceptor to bind a table to the thread.
Each subsequent call made through HbaseTemplate is aware of the table bound and will use it instead of retrieving a new instance.| Constructor and Description |
|---|
HbaseSynchronizationManager() |
| Modifier and Type | Method and Description |
|---|---|
static void |
bindResource(String key,
HTableInterface value)
Binds the given resource for the given key to the current thread.
|
static HTableInterface |
getResource(Object key)
Returns the resource (table) associated with the given key.
|
static Set<String> |
getTableNames()
Returns the bound tables (by name).
|
static boolean |
hasResource(Object key)
Checks whether any resource is bound for the given key.
|
static HTableInterface |
unbindResource(String key)
Unbinds a resource for the given key from the current thread.
|
static Object |
unbindResourceIfPossible(Object key)
Unbinds a resource for the given key from the current thread.
|
public static boolean hasResource(Object key)
key - key to checkpublic static HTableInterface getResource(Object key)
key - association keypublic static void bindResource(String key, HTableInterface value) throws IllegalStateException
key - the key to bind the value to (usually the resource factory)value - the value to bind (usually the active resource object)IllegalStateException - if there is already a value bound to the threadResourceTransactionManager.getResourceFactory()public static HTableInterface unbindResource(String key) throws IllegalStateException
key - the key to unbind (usually the resource factory)IllegalStateException - if there is no value bound to the threadResourceTransactionManager.getResourceFactory()public static Object unbindResourceIfPossible(Object key)
key - the key to unbind (usually the resource factory)null if none bound