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

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

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

Task.getUpdateTime介绍

暂无

代码示例

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

this.scheduledTime = sdf.format(new Date(task.getScheduledTime()));
this.startTime = sdf.format(new Date(task.getStartTime()));
this.updateTime = sdf.format(new Date(task.getUpdateTime()));
this.endTime = sdf.format(new Date(task.getEndTime()));
this.status = task.getStatus();

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

private boolean requeue(Task pending) {
  long callback = pending.getCallbackAfterSeconds();
  if (callback < 0) {
    callback = 0;
  }
  queueDAO.remove(QueueUtils.getQueueName(pending), pending.getTaskId());
  long now = System.currentTimeMillis();
  callback = callback - ((now - pending.getUpdateTime())/1000);
  if(callback < 0) {
    callback = 0;
  }
  return queueDAO.pushIfNotExists(QueueUtils.getQueueName(pending), pending.getTaskId(), callback);
}

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

@VisibleForTesting
boolean isResponseTimedOut(TaskDef taskDefinition, Task task) {
  if (taskDefinition == null) {
    LOGGER.warn("missing task type : {}, workflowId= {}", task.getTaskDefName(), task.getWorkflowInstanceId());
    return false;
  }
  if (task.getStatus().isTerminal() || !task.getStatus().equals(IN_PROGRESS) || taskDefinition.getResponseTimeoutSeconds() == 0) {
    return false;
  }
  if (!task.getStatus().equals(IN_PROGRESS) || taskDefinition.getResponseTimeoutSeconds() == 0) {
    return false;
  }
  if (queueDAO.exists(QueueUtils.getQueueName(task), task.getTaskId())) {
    // this task is present in the queue
    // this means that it has been updated with callbackAfterSeconds and is not being executed in a worker
    return false;
  }
  LOGGER.debug("Evaluating responseTimeOut for Task: {}, with Task Definition: {} ", task, taskDefinition);
  long responseTimeout = 1000L * taskDefinition.getResponseTimeoutSeconds();
  long now = System.currentTimeMillis();
  long noResponseTime = now - task.getUpdateTime();
  if (noResponseTime < responseTimeout) {
    LOGGER.debug("Current responseTime: {} has not exceeded the configured responseTimeout of {} " +
        "for the Task: {} with Task Definition: {}", noResponseTime, responseTimeout, task, taskDefinition);
    return false;
  }
  Monitors.recordTaskResponseTimeout(task.getTaskDefName());
  return true;
}

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

getStartTime() == task.getStartTime() &&
getEndTime() == task.getEndTime() &&
getUpdateTime() == task.getUpdateTime() &&
getStartDelayInSeconds() == task.getStartDelayInSeconds() &&
isRetried() == task.isRetried() &&

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

private int requeuePendingTasks(Workflow workflow, long threshold) {
  int count = 0;
  List<Task> tasks = workflow.getTasks();
  for (Task pending : tasks) {
    if (SystemTaskType.is(pending.getTaskType())) {
      continue;
    }
    if (pending.getStatus().isTerminal()) {
      continue;
    }
    if (pending.getUpdateTime() < threshold) {
      logger.info("Requeuing Task: workflowId=" + workflow.getWorkflowId() + ", taskType=" + pending.getTaskType() + ", taskId="
          + pending.getTaskId());
      long callback = pending.getCallbackAfterSeconds();
      if (callback < 0) {
        callback = 0;
      }
      boolean pushed = queueDAO.pushIfNotExists(QueueUtils.getQueueName(pending), pending.getTaskId(), callback);
      if (pushed) {
        count++;
      }
    }
  }
  return count;
}

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

@Override
  public int hashCode() {
    return Objects.hash(getTaskType(), getStatus(), getInputData(), getReferenceTaskName(), getRetryCount(), getSeq(), getCorrelationId(), getPollCount(), getTaskDefName(), getScheduledTime(), getStartTime(), getEndTime(), getUpdateTime(), getStartDelayInSeconds(), getRetriedTaskId(), isRetried(), isExecuted(), isCallbackFromWorker(), getResponseTimeoutSeconds(), getWorkflowInstanceId(), getWorkflowType(), getTaskId(), getReasonForIncompletion(), getCallbackAfterSeconds(), getWorkerId(), getOutputData(), getWorkflowTask(), getDomain(), getInputMessage(), getOutputMessage(), getRateLimitPerFrequency(), getRateLimitFrequencyInSeconds(), getExternalInputPayloadStoragePath(), getExternalOutputPayloadStoragePath());
  }
}

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

to.setStartTime( from.getStartTime() );
to.setEndTime( from.getEndTime() );
to.setUpdateTime( from.getUpdateTime() );
to.setStartDelayInSeconds( from.getStartDelayInSeconds() );
if (from.getRetriedTaskId() != null) {

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

private boolean requeue(Task pending) {
  long callback = pending.getCallbackAfterSeconds();
  if (callback < 0) {
    callback = 0;
  }
  queueDAO.remove(QueueUtils.getQueueName(pending), pending.getTaskId());
  long now = System.currentTimeMillis();
  callback = callback - ((now - pending.getUpdateTime())/1000);
  if(callback < 0) {
    callback = 0;
  }
  return queueDAO.pushIfNotExists(QueueUtils.getQueueName(pending), pending.getTaskId(), callback);
}

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

this.scheduledTime = sdf.format(new Date(task.getScheduledTime()));
this.startTime = sdf.format(new Date(task.getStartTime()));
this.updateTime = sdf.format(new Date(task.getUpdateTime()));
this.endTime = sdf.format(new Date(task.getEndTime()));
this.status = task.getStatus();

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

@VisibleForTesting
boolean isResponseTimedOut(TaskDef taskDefinition, Task task) {
  if (taskDefinition == null) {
    LOGGER.warn("missing task type : {}, workflowId= {}", task.getTaskDefName(), task.getWorkflowInstanceId());
    return false;
  }
  if (task.getStatus().isTerminal() || !task.getStatus().equals(IN_PROGRESS) || taskDefinition.getResponseTimeoutSeconds() == 0) {
    return false;
  }
  if (!task.getStatus().equals(IN_PROGRESS) || taskDefinition.getResponseTimeoutSeconds() == 0) {
    return false;
  }
  if (queueDAO.exists(QueueUtils.getQueueName(task), task.getTaskId())) {
    // this task is present in the queue
    // this means that it has been updated with callbackAfterSeconds and is not being executed in a worker
    return false;
  }
  LOGGER.debug("Evaluating responseTimeOut for Task: {}, with Task Definition: {} ", task, taskDefinition);
  long responseTimeout = 1000L * taskDefinition.getResponseTimeoutSeconds();
  long now = System.currentTimeMillis();
  long noResponseTime = now - task.getUpdateTime();
  if (noResponseTime < responseTimeout) {
    LOGGER.debug("Current responseTime: {} has not exceeded the configured responseTimeout of {} " +
        "for the Task: {} with Task Definition: {}", noResponseTime, responseTimeout, task, taskDefinition);
    return false;
  }
  Monitors.recordTaskResponseTimeout(task.getTaskDefName());
  return true;
}

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

getStartTime() == task.getStartTime() &&
getEndTime() == task.getEndTime() &&
getUpdateTime() == task.getUpdateTime() &&
getStartDelayInSeconds() == task.getStartDelayInSeconds() &&
isRetried() == task.isRetried() &&

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

private int requeuePendingTasks(Workflow workflow, long threshold) {
  int count = 0;
  List<Task> tasks = workflow.getTasks();
  for (Task pending : tasks) {
    if (SystemTaskType.is(pending.getTaskType())) {
      continue;
    }
    if (pending.getStatus().isTerminal()) {
      continue;
    }
    if (pending.getUpdateTime() < threshold) {
      logger.info("Requeuing Task: workflowId=" + workflow.getWorkflowId() + ", taskType=" + pending.getTaskType() + ", taskId="
          + pending.getTaskId());
      long callback = pending.getCallbackAfterSeconds();
      if (callback < 0) {
        callback = 0;
      }
      boolean pushed = queueDAO.pushIfNotExists(QueueUtils.getQueueName(pending), pending.getTaskId(), callback);
      if (pushed) {
        count++;
      }
    }
  }
  return count;
}

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

@Override
  public int hashCode() {
    return Objects.hash(getTaskType(), getStatus(), getInputData(), getReferenceTaskName(), getRetryCount(), getSeq(), getCorrelationId(), getPollCount(), getTaskDefName(), getScheduledTime(), getStartTime(), getEndTime(), getUpdateTime(), getStartDelayInSeconds(), getRetriedTaskId(), isRetried(), isExecuted(), isCallbackFromWorker(), getResponseTimeoutSeconds(), getWorkflowInstanceId(), getWorkflowType(), getTaskId(), getReasonForIncompletion(), getCallbackAfterSeconds(), getWorkerId(), getOutputData(), getWorkflowTask(), getDomain(), getInputMessage(), getOutputMessage(), getRateLimitPerFrequency(), getRateLimitFrequencyInSeconds(), getExternalInputPayloadStoragePath(), getExternalOutputPayloadStoragePath());
  }
}

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

to.setStartTime( from.getStartTime() );
to.setEndTime( from.getEndTime() );
to.setUpdateTime( from.getUpdateTime() );
to.setStartDelayInSeconds( from.getStartDelayInSeconds() );
if (from.getRetriedTaskId() != null) {

相关文章

Task类方法