public final class JobZNodeManager
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.util.logging.Logger |
LOG |
Modifier and Type | Method and Description |
---|---|
static boolean |
checkJstZNodeWaitIfNeeded(CuratorFramework client,
java.lang.String rootPath,
java.lang.String jobID,
long jsTime)
Job master creates job submission time znode under job znode,
as the last action to create job related znodes at ZK server
workers wait for the job master to create this znode.
|
static void |
createJobEndTimeZNode(CuratorFramework client,
java.lang.String rootPath,
java.lang.String jobID)
Create job end time znode
|
static void |
createJobZNode(CuratorFramework client,
java.lang.String rootPath,
JobAPI.Job job)
Create job znode
Assumes that there is no znode exists in the ZooKeeper
Add job object as its body
|
static void |
createJstZNode(CuratorFramework client,
java.lang.String rootPath,
java.lang.String jobID,
long jsTime)
Create job submission time znode
|
static void |
deleteJobZNode(CuratorFramework client,
java.lang.String rootPath,
java.lang.String jobID)
delete job znode from zk server
|
static java.util.List<JobWithState> |
getJobs(CuratorFramework client,
java.lang.String rootPath)
return all jobs
|
static boolean |
isThereJobZNode(CuratorFramework clnt,
java.lang.String rootPath,
java.lang.String jobID)
check whether there is an active job
|
static JobWithState |
readJobZNode(CuratorFramework client,
java.lang.String rootPath,
java.lang.String jobID)
read the body of job directory znode
decode and return
|
static boolean |
updateJob(CuratorFramework client,
java.lang.String rootPath,
JobAPI.Job job,
JobAPI.JobState state) |
static boolean |
updateJobState(CuratorFramework client,
java.lang.String rootPath,
java.lang.String jobID,
JobAPI.JobState state) |
static void |
updateJobWorkers(CuratorFramework client,
java.lang.String rootPath,
java.lang.String jobID,
int workerChange)
Update number of workers in the job object
this is called in case of scaling up/down
|
public static void createJobZNode(CuratorFramework client, java.lang.String rootPath, JobAPI.Job job)
public static JobWithState readJobZNode(CuratorFramework client, java.lang.String rootPath, java.lang.String jobID)
public static boolean isThereJobZNode(CuratorFramework clnt, java.lang.String rootPath, java.lang.String jobID)
public static boolean updateJob(CuratorFramework client, java.lang.String rootPath, JobAPI.Job job, JobAPI.JobState state) throws Twister2Exception
Twister2Exception
public static boolean updateJobState(CuratorFramework client, java.lang.String rootPath, java.lang.String jobID, JobAPI.JobState state) throws Twister2Exception
Twister2Exception
public static void deleteJobZNode(CuratorFramework client, java.lang.String rootPath, java.lang.String jobID)
public static void updateJobWorkers(CuratorFramework client, java.lang.String rootPath, java.lang.String jobID, int workerChange) throws Twister2Exception
Twister2Exception
public static java.util.List<JobWithState> getJobs(CuratorFramework client, java.lang.String rootPath) throws Twister2Exception
Twister2Exception
public static void createJstZNode(CuratorFramework client, java.lang.String rootPath, java.lang.String jobID, long jsTime)
public static void createJobEndTimeZNode(CuratorFramework client, java.lang.String rootPath, java.lang.String jobID)
public static boolean checkJstZNodeWaitIfNeeded(CuratorFramework client, java.lang.String rootPath, java.lang.String jobID, long jsTime) throws Twister2Exception
this jst znode may exist from previous runs in the case of restarting from a checkpoint because of this, its value has to be compared
Twister2Exception