|
Spring for Apache Hadoop | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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(java.lang.String key,
org.apache.hadoop.hbase.client.HTableInterface value)
Binds the given resource for the given key to the current thread. |
static org.apache.hadoop.hbase.client.HTableInterface |
getResource(java.lang.Object key)
Returns the resource (table) associated with the given key. |
static java.util.Set<java.lang.String> |
getTableNames()
Returns the bound tables (by name). |
static boolean |
hasResource(java.lang.Object key)
Checks whether any resource is bound for the given key. |
static org.apache.hadoop.hbase.client.HTableInterface |
unbindResource(java.lang.String key)
Unbinds a resource for the given key from the current thread. |
static java.lang.Object |
unbindResourceIfPossible(java.lang.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(java.lang.Object key)
key
- key to check
public static org.apache.hadoop.hbase.client.HTableInterface getResource(java.lang.Object key)
key
- association key
public static void bindResource(java.lang.String key, org.apache.hadoop.hbase.client.HTableInterface value) throws java.lang.IllegalStateException
key
- the key to bind the value to (usually the resource factory)value
- the value to bind (usually the active resource object)
java.lang.IllegalStateException
- if there is already a value bound to the threadResourceTransactionManager.getResourceFactory()
public static org.apache.hadoop.hbase.client.HTableInterface unbindResource(java.lang.String key) throws java.lang.IllegalStateException
key
- the key to unbind (usually the resource factory)
java.lang.IllegalStateException
- if there is no value bound to the threadResourceTransactionManager.getResourceFactory()
public static java.lang.Object unbindResourceIfPossible(java.lang.Object key)
key
- the key to unbind (usually the resource factory)
null
if none boundpublic static java.util.Set<java.lang.String> getTableNames()
|
Spring for Apache Hadoop | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |