|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.data.hadoop.hbase.HbaseSynchronizationManager
public abstract class HbaseSynchronizationManager
Synchronization manager handling the tracking of Hbase resources (specifically tables). Used either manually or through 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 Summary | |
|---|---|
HbaseSynchronizationManager()
|
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HbaseSynchronizationManager()
| Method Detail |
|---|
public static boolean hasResource(Object key)
key - key to check
public static HTableInterface getResource(Object key)
key - association key
public 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 boundpublic static Set<String> getTableNames()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||