gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-24 01:51:05 32 4
gpt4 key购买 nike

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

WorkflowConfig.getTargetState介绍

暂无

代码示例

代码示例来源:origin: apache/incubator-gobblin

private void cleanUpJobs(HelixManager helixManager) {
 // Clean up existing jobs
 TaskDriver taskDriver = new TaskDriver(helixManager);
 Map<String, WorkflowConfig> workflows = taskDriver.getWorkflows();
 boolean cleanupDistJobs = ConfigUtils.getBoolean(this.config,
   GobblinClusterConfigurationKeys.CLEAN_ALL_DIST_JOBS,
   GobblinClusterConfigurationKeys.DEFAULT_CLEAN_ALL_DIST_JOBS);
 for (Map.Entry<String, WorkflowConfig> entry : workflows.entrySet()) {
  String workflowName = entry.getKey();
  if (workflowName.contains(GobblinClusterConfigurationKeys.PLANNING_CONF_PREFIX)
    || workflowName.contains(GobblinClusterConfigurationKeys.ACTUAL_JOB_NAME_PREFIX)) {
   if (!cleanupDistJobs) {
    log.info("Distributed job {} won't be deleted.", workflowName);
    continue;
   }
  }
  WorkflowConfig workflowConfig = entry.getValue();
  // request delete if not already requested
  if (workflowConfig.getTargetState() != TargetState.DELETE) {
   taskDriver.delete(workflowName);
   log.info("Requested delete of workflowName {}", workflowName);
  }
 }
}

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

if (!workflowCfg.getTargetState().equals(TargetState.START)) {
 LOG.debug(
   "Skip scheduling since the workflow has not been started " + workflowResource);

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

/**
 * Clean up a workflow. This removes the workflow config, idealstate, externalview and workflow
 * contexts associated with this workflow, and all jobs information, including their configs,
 * context, IS and EV.
 */
private void cleanupWorkflow(String workflow, WorkflowConfig workflowcfg) {
 LOG.info("Cleaning up workflow: " + workflow);
 if (workflowcfg.isTerminable() || workflowcfg.getTargetState() == TargetState.DELETE) {
  Set<String> jobs = workflowcfg.getJobDag().getAllNodes();
  // Remove all pending timer tasks for this workflow if exists
  _rebalanceScheduler.removeScheduledRebalance(workflow);
  for (String job : jobs) {
   _rebalanceScheduler.removeScheduledRebalance(job);
  }
  if (!TaskUtil.removeWorkflow(_manager.getHelixDataAccessor(),
    _manager.getHelixPropertyStore(), workflow, jobs)) {
   LOG.warn("Failed to clean up workflow " + workflow);
  }
 } else {
  LOG.info("Did not clean up workflow " + workflow
    + " because neither the workflow is non-terminable nor is set to DELETE.");
 }
}

代码示例来源:origin: org.apache.gobblin/gobblin-cluster

if (workflowConfig.getTargetState() != TargetState.DELETE) {
 taskDriver.delete(queueName);

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

if (!workflowCfg.getTargetState().equals(TargetState.START)) {
 LOG.debug(
   "Skip scheduling since the workflow has not been started " + workflowResource);

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

if (!workflowCfg.getTargetState().equals(TargetState.START)) {
 if (LOG.isDebugEnabled()) {
  LOG.debug("Skip scheduling since the workflow has not been started " + workflow);

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

if (!workflowCfg.getTargetState().equals(TargetState.START)) {
 if (LOG.isDebugEnabled()) {
  LOG.debug("Skip scheduling since the workflow has not been started " + workflow);

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

/**
 * Clean up a workflow. This removes the workflow config, idealstate, externalview and workflow
 * contexts associated with this workflow, and all jobs information, including their configs,
 * context, IS and EV.
 */
private void cleanupWorkflow(String workflow) {
 LOG.info("Cleaning up workflow: " + workflow);
 WorkflowConfig workflowcfg = _taskDataCache.getWorkflowConfig(workflow);
 if (workflowcfg.isTerminable() || workflowcfg.getTargetState() == TargetState.DELETE) {
  Set<String> jobs = workflowcfg.getJobDag().getAllNodes();
  // Remove all pending timer tasks for this workflow if exists
  _rebalanceScheduler.removeScheduledRebalance(workflow);
  for (String job : jobs) {
   _rebalanceScheduler.removeScheduledRebalance(job);
  }
  if (!TaskUtil.removeWorkflow(_manager.getHelixDataAccessor(),
    _manager.getHelixPropertyStore(), workflow, jobs)) {
   LOG.warn("Failed to clean up workflow " + workflow);
  } else {
   // Only remove from cache when remove all workflow success. Otherwise, batch write will
   // clean all the contexts even if Configs and IdealStates are exists. Then all the workflows
   // and jobs will rescheduled again.
   removeContexts(workflow, jobs, _taskDataCache);
  }
  } else {
  LOG.info("Did not clean up workflow " + workflow
    + " because neither the workflow is non-terminable nor is set to DELETE.");
 }
}

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

Assert.assertEquals(workflowConfig.getTargetState(), TargetState.STOP);
Assert.assertEquals(workflowConfig.getTargetState(), TargetState.STOP);

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

TargetState targetState = workflowCfg.getTargetState();
if (targetState != TargetState.START && targetState != TargetState.STOP) {
 LOG.info("Target state is " + targetState.name() + " for workflow " + workflowResource

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

if (lastInWorkflow && (cfg.isTerminable() || cfg.getTargetState() == TargetState.DELETE)) {

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

@Test
public void testCreateStoppedQueue() throws InterruptedException {
 String queueName = TestHelper.getTestMethodName();
 // Create a queue
 LOG.info("Starting job-queue: " + queueName);
 JobQueue.Builder queueBuild = TaskTestUtil.buildRecurrentJobQueue(queueName, 0, 600000,
   TargetState.STOP);
 createAndEnqueueJob(queueBuild, 2);
 _driver.createQueue(queueBuild.build());
 WorkflowConfig workflowConfig = _driver.getWorkflowConfig(queueName);
 Assert.assertEquals(workflowConfig.getTargetState(), TargetState.STOP);
 _driver.resume(queueName);
 //TaskTestUtil.pollForWorkflowState(_driver, queueName, );
 WorkflowContext wCtx = TaskTestUtil.pollForWorkflowContext(_driver, queueName);
 // ensure current schedule is started
 String scheduledQueue = wCtx.getLastScheduledSingleWorkflow();
 _driver.pollForWorkflowState(scheduledQueue, TaskState.COMPLETED);
}

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

if (lastInWorkflow && (cfg.isTerminable() || cfg.getTargetState() == TargetState.DELETE)) {

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

TargetState targetState = workflowCfg.getTargetState();
if (targetState == TargetState.DELETE) {
 LOG.info("Workflow is marked as deleted " + workflow + " cleaning up the workflow context.");

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

public WorkflowConfig(WorkflowConfig cfg, String workflowId) {
 this(workflowId, cfg.getJobDag(), cfg.getParallelJobs(), cfg.getTargetState(), cfg.getExpiry(),
   cfg.getFailureThreshold(), cfg.isTerminable(), cfg.getScheduleConfig(), cfg.getCapacity(),
   cfg.getWorkflowType(), cfg.isJobQueue(), cfg.getJobTypes(), cfg.getJobPurgeInterval(),
   cfg.isAllowOverlapJobAssignment(), cfg.getTimeout());
}

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

public WorkflowConfig(WorkflowConfig cfg, String workflowId) {
 this(workflowId, cfg.getJobDag(), cfg.getParallelJobs(), cfg.getTargetState(), cfg.getExpiry(),
   cfg.getFailureThreshold(), cfg.isTerminable(), cfg.getScheduleConfig(), cfg.getCapacity(),
   cfg.getWorkflowType(), cfg.isJobQueue(), cfg.getJobTypes(), cfg.getJobPurgeInterval(),
   cfg.isAllowOverlapJobAssignment(), cfg.getTimeout());
}

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

Assert.assertEquals(workflowConfig.getTargetState(), TargetState.STOP);

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

public Builder(WorkflowConfig workflowConfig) {
 _workflowId = workflowConfig.getWorkflowId();
 _taskDag = workflowConfig.getJobDag();
 _parallelJobs = workflowConfig.getParallelJobs();
 _targetState = workflowConfig.getTargetState();
 _expiry = workflowConfig.getExpiry();
 _isTerminable = workflowConfig.isTerminable();
 _scheduleConfig = workflowConfig.getScheduleConfig();
 _capacity = workflowConfig.getCapacity();
 _failureThreshold = workflowConfig.getFailureThreshold();
 _workflowType = workflowConfig.getWorkflowType();
 _isJobQueue = workflowConfig.isJobQueue();
 _jobTypes = workflowConfig.getJobTypes();
 _jobPurgeInterval = workflowConfig.getJobPurgeInterval();
 _allowOverlapJobAssignment = workflowConfig.isAllowOverlapJobAssignment();
 _timeout = workflowConfig.getTimeout();
}

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

public Builder(WorkflowConfig workflowConfig) {
 _workflowId = workflowConfig.getWorkflowId();
 _taskDag = workflowConfig.getJobDag();
 _parallelJobs = workflowConfig.getParallelJobs();
 _targetState = workflowConfig.getTargetState();
 _expiry = workflowConfig.getExpiry();
 _isTerminable = workflowConfig.isTerminable();
 _scheduleConfig = workflowConfig.getScheduleConfig();
 _capacity = workflowConfig.getCapacity();
 _failureThreshold = workflowConfig.getFailureThreshold();
 _workflowType = workflowConfig.getWorkflowType();
 _isJobQueue = workflowConfig.isJobQueue();
 _jobTypes = workflowConfig.getJobTypes();
 _jobPurgeInterval = workflowConfig.getJobPurgeInterval();
 _allowOverlapJobAssignment = workflowConfig.isAllowOverlapJobAssignment();
 _timeout = workflowConfig.getTimeout();
}

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

TargetState targetState = workflowCfg.getTargetState();
if (targetState == TargetState.DELETE) {
 LOG.info("Workflow is marked as deleted " + workflow + " cleaning up the workflow context.");

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