gpt4 book ai didi

org.apache.helix.task.WorkflowContext.setJobState()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-27 03:43:05 27 4
gpt4 key购买 nike

本文整理了Java中org.apache.helix.task.WorkflowContext.setJobState()方法的一些代码示例,展示了WorkflowContext.setJobState()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WorkflowContext.setJobState()方法的具体详情如下:
包路径:org.apache.helix.task.WorkflowContext
类名称:WorkflowContext
方法名:setJobState

WorkflowContext.setJobState介绍

暂无

代码示例

代码示例来源:origin: com.linkedin.gobblin/gobblin-cluster

private void markJobComplete(String jobName, JobContext jobContext,
  WorkflowConfig workflowConfig, WorkflowContext workflowContext) {
 long currentTime = System.currentTimeMillis();
 workflowContext.setJobState(jobName, TaskState.COMPLETED);
 jobContext.setFinishTime(currentTime);
 if (isWorkflowFinished(workflowContext, workflowConfig)) {
  workflowContext.setFinishTime(currentTime);
 }
}

代码示例来源:origin: org.apache.helix/helix-core

protected void markJobComplete(String jobName, JobContext jobContext,
  WorkflowConfig workflowConfig, WorkflowContext workflowContext,
  Map<String, JobConfig> jobConfigMap, ClusterDataCache clusterDataCache) {
 long currentTime = System.currentTimeMillis();
 workflowContext.setJobState(jobName, TaskState.COMPLETED);
 jobContext.setFinishTime(currentTime);
 if (isWorkflowFinished(workflowContext, workflowConfig, jobConfigMap, clusterDataCache)) {
  workflowContext.setFinishTime(currentTime);
  updateWorkflowMonitor(workflowContext, workflowConfig);
 }
 scheduleJobCleanUp(jobConfigMap.get(jobName), workflowConfig, currentTime);
}

代码示例来源:origin: apache/helix

protected void markJobFailed(String jobName, JobContext jobContext, WorkflowConfig workflowConfig,
  WorkflowContext workflowContext, Map<String, JobConfig> jobConfigMap,
  TaskDataCache clusterDataCache) {
 long currentTime = System.currentTimeMillis();
 workflowContext.setJobState(jobName, TaskState.FAILED);
 if (jobContext != null) {
  jobContext.setFinishTime(currentTime);
 }
 if (isWorkflowFinished(workflowContext, workflowConfig, jobConfigMap, clusterDataCache)) {
  workflowContext.setFinishTime(currentTime);
  updateWorkflowMonitor(workflowContext, workflowConfig);
 }
 scheduleJobCleanUp(jobConfigMap.get(jobName), workflowConfig, currentTime);
}

代码示例来源:origin: org.apache.helix/helix-core

protected void markJobFailed(String jobName, JobContext jobContext, WorkflowConfig workflowConfig,
  WorkflowContext workflowContext, Map<String, JobConfig> jobConfigMap,
  ClusterDataCache clusterDataCache) {
 long currentTime = System.currentTimeMillis();
 workflowContext.setJobState(jobName, TaskState.FAILED);
 if (jobContext != null) {
  jobContext.setFinishTime(currentTime);
 }
 if (isWorkflowFinished(workflowContext, workflowConfig, jobConfigMap, clusterDataCache)) {
  workflowContext.setFinishTime(currentTime);
  updateWorkflowMonitor(workflowContext, workflowConfig);
 }
 scheduleJobCleanUp(jobConfigMap.get(jobName), workflowConfig, currentTime);
}

代码示例来源:origin: apache/helix

protected void markJobComplete(String jobName, JobContext jobContext,
  WorkflowConfig workflowConfig, WorkflowContext workflowContext,
  Map<String, JobConfig> jobConfigMap, ClusterDataCache clusterDataCache) {
 long currentTime = System.currentTimeMillis();
 workflowContext.setJobState(jobName, TaskState.COMPLETED);
 jobContext.setFinishTime(currentTime);
 if (isWorkflowFinished(workflowContext, workflowConfig, jobConfigMap, clusterDataCache.getTaskDataCache())) {
  workflowContext.setFinishTime(currentTime);
  updateWorkflowMonitor(workflowContext, workflowConfig);
 }
 scheduleJobCleanUp(jobConfigMap.get(jobName), workflowConfig, currentTime);
}

代码示例来源:origin: org.apache.helix/helix-core

protected void handleJobTimeout(JobContext jobCtx, WorkflowContext workflowCtx,
  String jobResource, JobConfig jobCfg) {
 jobCtx.setFinishTime(System.currentTimeMillis());
 workflowCtx.setJobState(jobResource, TaskState.TIMED_OUT);
 // Mark all INIT task to TASK_ABORTED
 for (int pId : jobCtx.getPartitionSet()) {
  if (jobCtx.getPartitionState(pId) == TaskPartitionState.INIT) {
   jobCtx.setPartitionState(pId, TaskPartitionState.TASK_ABORTED);
  }
 }
 _clusterStatusMonitor.updateJobCounters(jobCfg, TaskState.TIMED_OUT);
 _rebalanceScheduler.removeScheduledRebalance(jobResource);
 TaskUtil.cleanupJobIdealStateExtView(_manager.getHelixDataAccessor(), jobResource);
}

代码示例来源:origin: apache/helix

protected void handleJobTimeout(JobContext jobCtx, WorkflowContext workflowCtx,
  String jobResource, JobConfig jobCfg) {
 jobCtx.setFinishTime(System.currentTimeMillis());
 workflowCtx.setJobState(jobResource, TaskState.TIMED_OUT);
 // Mark all INIT task to TASK_ABORTED
 for (int pId : jobCtx.getPartitionSet()) {
  if (jobCtx.getPartitionState(pId) == TaskPartitionState.INIT) {
   jobCtx.setPartitionState(pId, TaskPartitionState.TASK_ABORTED);
  }
 }
 _clusterStatusMonitor.updateJobCounters(jobCfg, TaskState.TIMED_OUT);
 _rebalanceScheduler.removeScheduledRebalance(jobResource);
 TaskUtil.cleanupJobIdealStateExtView(_manager.getHelixDataAccessor(), jobResource);
}

代码示例来源:origin: org.apache.helix/helix-core

} else {
 scheduleSingleJob(job, jobConfig);
 workflowCtx.setJobState(job, TaskState.NOT_STARTED);
 scheduledJobs++;

代码示例来源:origin: apache/helix

} else {
 scheduleSingleJob(job, jobConfig);
 workflowCtx.setJobState(job, TaskState.NOT_STARTED);
 scheduledJobs++;

代码示例来源:origin: org.apache.helix/helix-core

workflowCtx.setJobState(jobResource, TaskState.STOPPED);
workflowCtx.setJobState(jobResource, TaskState.IN_PROGRESS);
    workflowCtx.setJobState(jobResource, TaskState.FAILED);
    if (workflowConfig.isTerminable()) {
     workflowCtx.setWorkflowState(TaskState.FAILED);
workflowCtx.setJobState(jobResource, TaskState.COMPLETED);
jobCtx.setFinishTime(currentTime);
if (isWorkflowComplete(workflowCtx, workflowConfig)) {

代码示例来源:origin: apache/helix

workflowCtx.setJobState(jobResource, TaskState.STOPPED);
workflowCtx.setJobState(jobResource, TaskState.IN_PROGRESS);
    workflowCtx.setJobState(jobResource, TaskState.FAILED);
    if (workflowConfig.isTerminable()) {
     workflowCtx.setWorkflowState(TaskState.FAILED);
workflowCtx.setJobState(jobResource, TaskState.COMPLETED);
jobCtx.setFinishTime(currentTime);
if (isWorkflowComplete(workflowCtx, workflowConfig)) {

代码示例来源:origin: com.linkedin.gobblin/gobblin-cluster

workflowCtx.setJobState(jobResource, TaskState.STOPPED);
workflowCtx.setJobState(jobResource, TaskState.IN_PROGRESS);

代码示例来源:origin: apache/helix

for (String jobToFail : cfg.getJobDag().getAllNodes()) {
 if (ctx.getJobState(jobToFail) == TaskState.IN_PROGRESS) {
  ctx.setJobState(jobToFail, TaskState.ABORTED);

代码示例来源:origin: org.apache.helix/helix-core

for (String jobToFail : cfg.getJobDag().getAllNodes()) {
 if (ctx.getJobState(jobToFail) == TaskState.IN_PROGRESS) {
  ctx.setJobState(jobToFail, TaskState.ABORTED);

代码示例来源:origin: apache/helix

public static WorkflowContext buildWorkflowContext(String workflowResource,
  TaskState workflowState, Long startTime, TaskState... jobStates) {
 WorkflowContext workflowContext =
   new WorkflowContext(new ZNRecord(TaskUtil.WORKFLOW_CONTEXT_KW));
 workflowContext.setName(workflowResource);
 workflowContext.setStartTime(startTime == null ? System.currentTimeMillis() : startTime);
 int jobId = 0;
 for (TaskState jobstate : jobStates) {
  workflowContext
    .setJobState(TaskUtil.getNamespacedJobName(workflowResource, JOB_KW) + jobId++, jobstate);
 }
 workflowContext.setWorkflowState(workflowState);
 return workflowContext;
}

代码示例来源:origin: apache/helix

jobCtx.setStartTime(System.currentTimeMillis());
 jobCtx.setName(jobName);
 workflowCtx.setJobState(jobName, TaskState.IN_PROGRESS);
  || TaskState.TIMED_OUT.equals(workflowState))) {
 jobState = TaskState.TIMING_OUT;
 workflowCtx.setJobState(jobName, TaskState.TIMING_OUT);
} else if (jobState != TaskState.TIMING_OUT && jobState != TaskState.FAILING) {
   workflowCtx.setJobState(jobName, TaskState.STOPPED);
  } else {
   workflowCtx.setJobState(jobName, TaskState.STOPPING);
  workflowCtx.setJobState(jobName, TaskState.IN_PROGRESS);

代码示例来源:origin: org.apache.helix/helix-core

jobCtx.setStartTime(System.currentTimeMillis());
 jobCtx.setName(jobName);
 workflowCtx.setJobState(jobName, TaskState.IN_PROGRESS);
  || TaskState.TIMED_OUT.equals(workflowState))) {
 jobState = TaskState.TIMING_OUT;
 workflowCtx.setJobState(jobName, TaskState.TIMING_OUT);
} else if (jobState != TaskState.TIMING_OUT && jobState != TaskState.FAILING) {
   workflowCtx.setJobState(jobName, TaskState.STOPPED);
  } else {
   workflowCtx.setJobState(jobName, TaskState.STOPPING);
  workflowCtx.setJobState(jobName, TaskState.IN_PROGRESS);

代码示例来源:origin: apache/helix

return buildEmptyAssignment(jobResource, currStateOutput);
workflowCtx.setJobState(jobResource, TaskState.FAILING);

代码示例来源:origin: org.apache.helix/helix-core

return buildEmptyAssignment(jobResource, currStateOutput);
workflowCtx.setJobState(jobResource, TaskState.FAILING);

代码示例来源:origin: apache/helix

wfCtx.setJobState(_testJobPrefix + "0", TaskState.COMPLETED);
wfCtx.setJobState(_testJobPrefix + "1", TaskState.COMPLETED);
wfCtx.setWorkflowState(TaskState.IN_PROGRESS);
wfCtx.setName(_testWorkflow);
wfCtx.setJobState(_testJobPrefix + "0", TaskState.FAILED);
taskDataCache.updateJobContext(_testJobPrefix + "0", jbCtx0);
jbCtx2.setName(_testJobPrefix + "2");
jbCtx2.setPartitionState(1, TaskPartitionState.INIT);
wfCtx.setJobState(_testJobPrefix + "2", TaskState.IN_PROGRESS);
taskDataCache.updateJobContext(_testJobPrefix + "2", jbCtx2);

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com