com.netflix.conductor.common.metadata.tasks.Task.getTaskDefinition()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(3.6k)|赞(0)|评价(0)|浏览(132)

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

Task.getTaskDefinition介绍

暂无

代码示例

代码示例来源:origin: Netflix/conductor

Optional<TaskDef> taskDefinition = pendingTask.getTaskDefinition();

代码示例来源:origin: Netflix/conductor

private void updateTask(Connection connection, Task task) {
  task.setUpdateTime(System.currentTimeMillis());
  if (task.getStatus() != null && task.getStatus().isTerminal() && task.getEndTime() == 0) {
    task.setEndTime(System.currentTimeMillis());
  }
  Optional<TaskDef> taskDefinition = task.getTaskDefinition();
  if (taskDefinition.isPresent() && taskDefinition.get().concurrencyLimit() > 0) {
    boolean inProgress = task.getStatus() != null && task.getStatus().equals(Task.Status.IN_PROGRESS);
    updateInProgressStatus(connection, task, inProgress);
  }
  insertOrUpdateTaskData(connection, task);
  if (task.getStatus() != null && task.getStatus().isTerminal()) {
    removeTaskInProgress(connection, task);
  }
  addWorkflowToTaskMapping(connection, task);
}

代码示例来源:origin: Netflix/conductor

@Override
public boolean exceedsInProgressLimit(Task task) {
  Optional<TaskDef> taskDefinition = task.getTaskDefinition();
  if (!taskDefinition.isPresent()) {
    return false;
  }
  TaskDef taskDef = taskDefinition.get();
  int limit = taskDef.concurrencyLimit();
  if (limit <= 0) {
    return false;
  }
  long current = getInProgressTaskCount(task.getTaskDefName());
  if (current >= limit) {
    Monitors.recordTaskConcurrentExecutionLimited(task.getTaskDefName(), limit);
    return true;
  }
  logger.info("Task execution count for {}: limit={}, current={}", task.getTaskDefName(), limit,
      getInProgressTaskCount(task.getTaskDefName()));
  String taskId = task.getTaskId();
  List<String> tasksInProgressInOrderOfArrival = findAllTasksInProgressInOrderOfArrival(task, limit);
  boolean rateLimited = !tasksInProgressInOrderOfArrival.contains(taskId);
  if (rateLimited) {
    logger.info("Task execution count limited. {}, limit {}, current {}", task.getTaskDefName(), limit,
        getInProgressTaskCount(task.getTaskDefName()));
    Monitors.recordTaskConcurrentExecutionLimited(task.getTaskDefName(), limit);
  }
  return rateLimited;
}

代码示例来源:origin: Netflix/conductor

@Override
public boolean exceedsInProgressLimit(Task task) {
  Optional<TaskDef> taskDefinition = task.getTaskDefinition();
  if(!taskDefinition.isPresent()) {
    return false;

代码示例来源:origin: Netflix/conductor

@Test
  public void testTaskDefinitionIfAvailable() {
    Task task = new Task();
    task.setStatus(Status.FAILED);
    assertEquals(Status.FAILED, task.getStatus());

    assertNull(task.getWorkflowTask());
    assertFalse(task.getTaskDefinition().isPresent());

    WorkflowTask workflowTask = new WorkflowTask();
    TaskDef taskDefinition = new TaskDef();
    workflowTask.setTaskDefinition(taskDefinition);
    task.setWorkflowTask(workflowTask);

    assertTrue(task.getTaskDefinition().isPresent());
    assertEquals(taskDefinition, task.getTaskDefinition().get());
  }
}

代码示例来源:origin: Netflix/conductor

Optional<TaskDef> taskDefinition = task.getTaskDefinition();

代码示例来源:origin: com.netflix.conductor/conductor-core

Optional<TaskDef> taskDefinition = pendingTask.getTaskDefinition();

代码示例来源:origin: com.netflix.conductor/conductor-redis-persistence

@Override
public boolean exceedsInProgressLimit(Task task) {
  Optional<TaskDef> taskDefinition = task.getTaskDefinition();
  if(!taskDefinition.isPresent()) {
    return false;

代码示例来源:origin: com.netflix.conductor/conductor-redis-persistence

Optional<TaskDef> taskDefinition = task.getTaskDefinition();

相关文章

Task类方法