|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.zookeeper.ZooKeeperListener
org.apache.hadoop.hbase.procedure.ZKProcedureUtil
@InterfaceAudience.Public @InterfaceStability.Evolving public abstract class ZKProcedureUtil
This is a shared ZooKeeper-based znode management utils for distributed procedure. All znode operations should go through the provided methods in coordinators and members. Layout of nodes in ZK is /hbase/[op name]/acquired/ [op instance] - op data/ /[nodes that have acquired] /reached/ [op instance]/ /[nodes that have completed] /abort/ [op instance] - failure data NOTE: while acquired and completed are znode dirs, abort is actually just a znode. Assumption here that procedure names are unique
Field Summary | |
---|---|
static String |
ABORT_ZNODE_DEFAULT
|
protected String |
abortZnode
|
static String |
ACQUIRED_BARRIER_ZNODE_DEFAULT
|
protected String |
acquiredZnode
|
String |
baseZNode
|
protected String |
memberName
|
static String |
REACHED_BARRIER_ZNODE_DEFAULT
|
protected String |
reachedZnode
|
Fields inherited from class org.apache.hadoop.hbase.zookeeper.ZooKeeperListener |
---|
watcher |
Constructor Summary | |
---|---|
ZKProcedureUtil(ZooKeeperWatcher watcher,
String procDescription,
String memberName)
Top-level watcher/controller for procedures across the cluster. |
Method Summary | |
---|---|
void |
clearChildZNodes()
|
void |
clearZNodes(String procedureName)
|
void |
close()
|
static String |
getAbortNode(ZKProcedureUtil controller,
String opInstanceName)
Get the full znode path for the node used by the coordinator or member to trigger an abort of the global barrier acquisition or execution in subprocedures. |
String |
getAbortZnode()
|
String |
getAbortZNode(String opInstanceName)
|
static String |
getAcquireBarrierNode(ZKProcedureUtil controller,
String opInstanceName)
Get the full znode path for the node used by the coordinator to trigger a global barrier acquire on each subprocedure. |
String |
getAcquiredBarrier()
|
String |
getAcquiredBarrierNode(String opInstanceName)
|
String |
getBaseZnode()
|
String |
getMemberName()
|
String |
getReachedBarrierNode(String opInstanceName)
|
static String |
getReachedBarrierNode(ZKProcedureUtil controller,
String opInstanceName)
Get the full znode path for the node used by the coordinator to trigger a global barrier execution and release on each subprocedure. |
ZooKeeperWatcher |
getWatcher()
|
boolean |
isAbortPathNode(String path)
Is this in the procedure barrier abort znode path |
protected void |
logZKTree(String root,
String prefix)
Helper method to print the current state of the ZK tree. |
Methods inherited from class org.apache.hadoop.hbase.zookeeper.ZooKeeperListener |
---|
nodeChildrenChanged, nodeCreated, nodeDataChanged, nodeDeleted |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String ACQUIRED_BARRIER_ZNODE_DEFAULT
public static final String REACHED_BARRIER_ZNODE_DEFAULT
public static final String ABORT_ZNODE_DEFAULT
public final String baseZNode
protected final String acquiredZnode
protected final String reachedZnode
protected final String abortZnode
protected final String memberName
Constructor Detail |
---|
public ZKProcedureUtil(ZooKeeperWatcher watcher, String procDescription, String memberName) throws org.apache.zookeeper.KeeperException
On instantiation, this ensures the procedure znodes exist. This however requires the passed in watcher has been started.
watcher
- watcher for the cluster ZK. Owned by this and closed via
close()
procDescription
- name of the znode describing the procedure to runmemberName
- name of the member from which we are interacting with running procedures
org.apache.zookeeper.KeeperException
- when the procedure znodes cannot be createdMethod Detail |
---|
public void close() throws IOException
close
in interface Closeable
IOException
public String getAcquiredBarrierNode(String opInstanceName)
public String getReachedBarrierNode(String opInstanceName)
public String getAbortZNode(String opInstanceName)
public String getAbortZnode()
public String getBaseZnode()
public String getAcquiredBarrier()
public String getMemberName()
public static String getAcquireBarrierNode(ZKProcedureUtil controller, String opInstanceName)
controller
- controller running the procedureopInstanceName
- name of the running procedure instance (not the procedure description).
public static String getReachedBarrierNode(ZKProcedureUtil controller, String opInstanceName)
controller
- controller running the procedureopInstanceName
- name of the running procedure instance (not the procedure description).
public static String getAbortNode(ZKProcedureUtil controller, String opInstanceName)
controller
- controller running the procedureopInstanceName
- name of the running procedure instance (not the procedure description).
public ZooKeeperWatcher getWatcher()
public boolean isAbortPathNode(String path)
protected void logZKTree(String root, String prefix) throws org.apache.zookeeper.KeeperException
org.apache.zookeeper.KeeperException
- if an unexpected exception occurslogZKTree(String)
public void clearChildZNodes() throws org.apache.zookeeper.KeeperException
org.apache.zookeeper.KeeperException
public void clearZNodes(String procedureName) throws org.apache.zookeeper.KeeperException
org.apache.zookeeper.KeeperException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |