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

x33g5p2x  于2022-02-03 转载在 其他  
字(7.2k)|赞(0)|评价(0)|浏览(132)

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

WorkflowContext.getLastScheduledSingleWorkflow介绍

暂无

代码示例

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

/**
 * Helper function to change target state for a given workflow
 */
private void setWorkflowTargetState(String workflow, TargetState state) {
 setSingleWorkflowTargetState(workflow, state);
 // For recurring schedules, last scheduled incomplete workflow must also be handled
 WorkflowContext wCtx = TaskUtil.getWorkflowContext(_propertyStore, workflow);
 if (wCtx != null) {
  String lastScheduledWorkflow = wCtx.getLastScheduledSingleWorkflow();
  if (lastScheduledWorkflow != null) {
   setSingleWorkflowTargetState(lastScheduledWorkflow, state);
  }
 }
}

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

/**
 * Helper function to change target state for a given workflow
 */
private void setWorkflowTargetState(String workflow, TargetState state) {
 setSingleWorkflowTargetState(workflow, state);
 // For recurring schedules, last scheduled incomplete workflow must also be handled
 WorkflowContext wCtx = TaskUtil.getWorkflowContext(_propertyStore, workflow);
 if (wCtx != null) {
  String lastScheduledWorkflow = wCtx.getLastScheduledSingleWorkflow();
  if (lastScheduledWorkflow != null) {
   setSingleWorkflowTargetState(lastScheduledWorkflow, state);
  }
 }
}

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

Thread.sleep(timeToSleep);
 ctx = getWorkflowContext(workflowName);
} while ((ctx == null || ctx.getLastScheduledSingleWorkflow() == null));
workflowName = ctx.getLastScheduledSingleWorkflow();

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

Thread.sleep(timeToSleep);
 ctx = getWorkflowContext(workflowName);
} while ((ctx == null || ctx.getLastScheduledSingleWorkflow() == null));
workflowName = ctx.getLastScheduledSingleWorkflow();

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

String lastScheduled = workflowCtx.getLastScheduledSingleWorkflow();
if (lastScheduled != null) {
 WorkflowContext lastWorkflowCtx = cache.getWorkflowContext(lastScheduled);

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

String lastScheduled = workflowCtx.getLastScheduledSingleWorkflow();
if (lastScheduled != null) {
 WorkflowContext lastWorkflowCtx = cache.getWorkflowContext(lastScheduled);

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

WorkflowContext wCtx = _taskDriver.getWorkflowContext(queueName);
String lastScheduledQueue = wCtx.getLastScheduledSingleWorkflow();

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

String lastScheduledQueue = null;
if (wCtx != null) {
 lastScheduledQueue = wCtx.getLastScheduledSingleWorkflow();

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

String lastScheduledQueue = null;
if (wCtx != null) {
 lastScheduledQueue = wCtx.getLastScheduledSingleWorkflow();

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

String scheduledQueue = wCtx.getLastScheduledSingleWorkflow();
_driver.pollForWorkflowState(scheduledQueue, TaskState.IN_PROGRESS);
scheduledQueue = wCtx.getLastScheduledSingleWorkflow();
WorkflowConfig wCfg = _driver.getWorkflowConfig(scheduledQueue);

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

@Test
public void testLostZkConnection() throws Exception {
 System.setProperty(SystemPropertyKeys.ZK_WAIT_CONNECTED_TIMEOUT, "1000");
 System.setProperty(SystemPropertyKeys.ZK_SESSION_TIMEOUT, "1000");
 try {
  String queueName = TestHelper.getTestMethodName();
  startParticipants(_zkAddr);
  // Create a queue
  LOG.info("Starting job-queue: " + queueName);
  JobQueue.Builder queueBuild = TaskTestUtil.buildRecurrentJobQueue(queueName, 0, 6000);
  createAndEnqueueJob(queueBuild, 3);
  _driver.start(queueBuild.build());
  restartZkServer();
  WorkflowContext wCtx = TaskTestUtil.pollForWorkflowContext(_driver, queueName);
  String scheduledQueue = wCtx.getLastScheduledSingleWorkflow();
  _driver.pollForWorkflowState(scheduledQueue, 30000, TaskState.COMPLETED);
 } finally {
  System.clearProperty(SystemPropertyKeys.ZK_WAIT_CONNECTED_TIMEOUT);
  System.clearProperty(SystemPropertyKeys.ZK_SESSION_TIMEOUT);
 }
}

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

String scheduledQueue = wCtx.getLastScheduledSingleWorkflow();

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

String scheduledQueue = wCtx.getLastScheduledSingleWorkflow();

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

String scheduledQueue = wCtx.getLastScheduledSingleWorkflow();
String namedSpaceJob1 = String.format("%s_%s", scheduledQueue, currentJobNames.get(0));
_driver.pollForJobState(scheduledQueue, namedSpaceJob1, TaskState.IN_PROGRESS);
while (scheduledQueue == null) {
 wCtx = TaskTestUtil.pollForWorkflowContext(_driver, queueName);
 scheduledQueue = wCtx.getLastScheduledSingleWorkflow();
_driver.pollForJobState(scheduledQueue, namedSpaceJob1, TaskState.COMPLETED);
scheduledQueue = wCtx.getLastScheduledSingleWorkflow();
String namedSpaceJob2 = String.format("%s_%s", scheduledQueue, currentJobNames.get(1));
_driver.pollForJobState(scheduledQueue, namedSpaceJob2, TaskState.COMPLETED);

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

@Test(dependsOnMethods = { "testLostZkConnection" }, enabled = false)
public void testLostZkConnectionNegative() throws Exception {
 System.setProperty(SystemPropertyKeys.ZK_WAIT_CONNECTED_TIMEOUT, "10");
 System.setProperty(SystemPropertyKeys.ZK_SESSION_TIMEOUT, "1000");
 try {
  String queueName = TestHelper.getTestMethodName();
  stopParticipants();
  startParticipants(_zkAddr);
  LOG.info("Starting job-queue: " + queueName);
  JobQueue.Builder queueBuild = TaskTestUtil.buildRecurrentJobQueue(queueName, 0, 6000);
  createAndEnqueueJob(queueBuild, 3);
  _driver.start(queueBuild.build());
  restartZkServer();
  WorkflowContext wCtx = TaskTestUtil.pollForWorkflowContext(_driver, queueName);
  // ensure job 1 is started before stop it
  String scheduledQueue = wCtx.getLastScheduledSingleWorkflow();
  try {
   _driver.pollForWorkflowState(scheduledQueue, 30000, TaskState.COMPLETED);
   Assert.fail("Test failure!");
  } catch (HelixException ex) {
   // test succeed
  }
 } finally {
  System.clearProperty(SystemPropertyKeys.ZK_WAIT_CONNECTED_TIMEOUT);
  System.clearProperty(SystemPropertyKeys.ZK_SESSION_TIMEOUT);
 }
}

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

String scheduledQueue = wCtx.getLastScheduledSingleWorkflow();
_driver.pollForWorkflowState(scheduledQueue, TaskState.IN_PROGRESS);
scheduledQueue = wCtx.getLastScheduledSingleWorkflow();
WorkflowConfig wCfg = _driver.getWorkflowConfig(scheduledQueue);

代码示例来源: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

scheduledQueue = wCtx.getLastScheduledSingleWorkflow();

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

String scheduledQueue = wCtx.getLastScheduledSingleWorkflow();

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

final String lastScheduledWorkflow = wCtx.getLastScheduledSingleWorkflow();

相关文章