本文整理了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
暂无
代码示例来源: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();
内容来源于网络,如有侵权,请联系作者删除!