public final class ZKBarrierManager
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.util.logging.Logger |
LOG |
Modifier and Type | Method and Description |
---|---|
static void |
createBarrierDir(CuratorFramework client,
java.lang.String barrierDirPath)
create parent directory for barrier
|
static void |
createDefaultBarrierDir(CuratorFramework client,
java.lang.String rootPath,
java.lang.String jobID)
create parent directory for default barrier
|
static void |
createInitBarrierDir(CuratorFramework client,
java.lang.String rootPath,
java.lang.String jobID)
create parent directory for init barrier
|
static void |
createWorkerZNode(CuratorFramework client,
java.lang.String workerPath,
long timeout)
create a worker znode at the barrier directory
|
static void |
createWorkerZNodeAtDefault(CuratorFramework client,
java.lang.String rootPath,
java.lang.String jobID,
int workerID,
long timeout)
create a worker znode at the default barrier directory
|
static void |
createWorkerZNodeAtInit(CuratorFramework client,
java.lang.String rootPath,
java.lang.String jobID,
int workerID,
long timeout)
create a worker znode at the init barrier directory
|
static void |
deleteWorkerZNode(CuratorFramework client,
java.lang.String workerPath)
delete the worker znode at a barrier directory
|
static void |
deleteWorkerZNodeFromDefault(CuratorFramework client,
java.lang.String rootPath,
java.lang.String jobID,
int workerID)
delete the worker znode at the default barrier directory
|
static void |
deleteWorkerZNodeFromInit(CuratorFramework client,
java.lang.String rootPath,
java.lang.String jobID,
int workerID)
delete the worker znode at the init barrier directory
|
static boolean |
existWorkerZNode(CuratorFramework client,
java.lang.String workerPath)
check existence of a worker znode at a barrier directory
|
static boolean |
existWorkerZNodeAtDefault(CuratorFramework client,
java.lang.String rootPath,
java.lang.String jobID,
int workerID)
check existence of a worker znode at the default barrier directory
|
static boolean |
existWorkerZNodeAtInit(CuratorFramework client,
java.lang.String rootPath,
java.lang.String jobID,
int workerID)
check existence of a worker znode at the init barrier directory
|
static int |
getNumberOfWorkersAtBarrier(CuratorFramework client,
java.lang.String rootPath,
java.lang.String jobID) |
static long |
readWorkerTimeout(CuratorFramework client,
java.lang.String workerPath)
read a worker znode at the barrier directory
|
static void |
removeScaledDownZNodes(CuratorFramework client,
java.lang.String barrierDir,
int minID,
int maxID)
When a job is scaled down, we must delete the znodes of killed workers.
|
static void |
removeScaledDownZNodes(CuratorFramework client,
java.lang.String rootPath,
java.lang.String jobID,
int minID,
int maxID)
Remove barrier znodes from both default and init barriers
minID inclusive, maxID exclusive
|
public static void createBarrierDir(CuratorFramework client, java.lang.String barrierDirPath)
public static void createDefaultBarrierDir(CuratorFramework client, java.lang.String rootPath, java.lang.String jobID)
public static void createInitBarrierDir(CuratorFramework client, java.lang.String rootPath, java.lang.String jobID)
public static void createWorkerZNode(CuratorFramework client, java.lang.String workerPath, long timeout) throws Twister2Exception
Twister2Exception
public static long readWorkerTimeout(CuratorFramework client, java.lang.String workerPath) throws Twister2Exception
Twister2Exception
public static void createWorkerZNodeAtDefault(CuratorFramework client, java.lang.String rootPath, java.lang.String jobID, int workerID, long timeout) throws Twister2Exception
Twister2Exception
public static void createWorkerZNodeAtInit(CuratorFramework client, java.lang.String rootPath, java.lang.String jobID, int workerID, long timeout) throws Twister2Exception
Twister2Exception
public static void deleteWorkerZNode(CuratorFramework client, java.lang.String workerPath) throws Twister2Exception
Twister2Exception
public static void deleteWorkerZNodeFromDefault(CuratorFramework client, java.lang.String rootPath, java.lang.String jobID, int workerID) throws Twister2Exception
Twister2Exception
public static void deleteWorkerZNodeFromInit(CuratorFramework client, java.lang.String rootPath, java.lang.String jobID, int workerID) throws Twister2Exception
Twister2Exception
public static boolean existWorkerZNode(CuratorFramework client, java.lang.String workerPath) throws Twister2Exception
Twister2Exception
public static boolean existWorkerZNodeAtDefault(CuratorFramework client, java.lang.String rootPath, java.lang.String jobID, int workerID) throws Twister2Exception
Twister2Exception
public static boolean existWorkerZNodeAtInit(CuratorFramework client, java.lang.String rootPath, java.lang.String jobID, int workerID) throws Twister2Exception
Twister2Exception
public static void removeScaledDownZNodes(CuratorFramework client, java.lang.String barrierDir, int minID, int maxID) throws Twister2Exception
Twister2Exception
public static void removeScaledDownZNodes(CuratorFramework client, java.lang.String rootPath, java.lang.String jobID, int minID, int maxID) throws Twister2Exception
Twister2Exception
public static int getNumberOfWorkersAtBarrier(CuratorFramework client, java.lang.String rootPath, java.lang.String jobID) throws Twister2Exception
Twister2Exception