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

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

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

Task.getExternalInputPayloadStoragePath介绍

暂无

代码示例

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

/**
 * Populates the task input from external payload storage if the external storage path is specified.
 *
 * @param task the task for which the input is to be populated.
 */
private void populateTaskInput(Task task) {
  if (StringUtils.isNotBlank(task.getExternalInputPayloadStoragePath())) {
    WorkflowTaskMetrics.incrementExternalPayloadUsedCount(task.getTaskDefName(), ExternalPayloadStorage.Operation.READ.name(), ExternalPayloadStorage.PayloadType.TASK_INPUT.name());
    task.setInputData(downloadFromExternalStorage(ExternalPayloadStorage.PayloadType.TASK_INPUT, task.getExternalInputPayloadStoragePath()));
    task.setExternalInputPayloadStoragePath(null);
  }
}

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

.filter(task -> StringUtils.isNotBlank(task.getExternalInputPayloadStoragePath()) || StringUtils.isNotBlank(task.getExternalOutputPayloadStoragePath()))
.forEach(task -> {
  if (StringUtils.isNotBlank(task.getExternalOutputPayloadStoragePath())) {
    task.setExternalOutputPayloadStoragePath(null);
  if (StringUtils.isNotBlank(task.getExternalInputPayloadStoragePath())) {
    task.setInputData(externalPayloadStorageUtils.downloadPayload(task.getExternalInputPayloadStoragePath()));
    Monitors.recordExternalPayloadStorageUsage(task.getTaskDefName(), ExternalPayloadStorage.Operation.READ.toString(), ExternalPayloadStorage.PayloadType.TASK_INPUT.toString());
    task.setExternalInputPayloadStoragePath(null);

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

@SuppressWarnings("unchecked")
@Test
public void testUploadTaskPayload() throws IOException {
  AtomicInteger uploadCount = new AtomicInteger(0);
  InputStream stream = ExternalPayloadStorageUtilsTest.class.getResourceAsStream("/payload.json");
  Map<String, Object> payload = objectMapper.readValue(stream, Map.class);
  when(externalPayloadStorage.getLocation(ExternalPayloadStorage.Operation.WRITE, ExternalPayloadStorage.PayloadType.TASK_INPUT, "")).thenReturn(location);
  doAnswer(invocation -> {
    uploadCount.incrementAndGet();
    return null;
  }).when(externalPayloadStorage).upload(anyString(), any(), anyLong());
  Task task = new Task();
  task.setInputData(payload);
  externalPayloadStorageUtils.verifyAndUpload(task, ExternalPayloadStorage.PayloadType.TASK_INPUT);
  assertNull(task.getInputData());
  assertEquals(1, uploadCount.get());
  assertNotNull(task.getExternalInputPayloadStoragePath());
}

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

Objects.equals(getInputMessage(), task.getInputMessage()) &&
Objects.equals(getOutputMessage(), task.getOutputMessage()) &&
Objects.equals(getExternalInputPayloadStoragePath(), task.getExternalInputPayloadStoragePath()) &&
Objects.equals(getExternalOutputPayloadStoragePath(), task.getExternalOutputPayloadStoragePath());

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

assertEquals(taskOutputParams, workflowInstance.getTasks().get(0).getOutputData());
assertNull(workflowInstance.getExternalInputPayloadStoragePath());
assertNull(workflowInstance.getTasks().get(0).getExternalInputPayloadStoragePath());
assertNull(workflowInstance.getTasks().get(0).getExternalOutputPayloadStoragePath());

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

rescheduled.setReasonForIncompletion(null);
if (StringUtils.isNotBlank(task.getExternalInputPayloadStoragePath())) {
  rescheduled.setExternalInputPayloadStoragePath(task.getExternalInputPayloadStoragePath());
} else {
  rescheduled.getInputData().putAll(task.getInputData());

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

assertTrue("The second task input should not be persisted", workflow.getTasks().get(1).getInputData().isEmpty());
assertEquals(taskOutputPath, workflow.getTasks().get(0).getExternalOutputPayloadStoragePath());
assertEquals("task/input", workflow.getTasks().get(1).getExternalInputPayloadStoragePath());
assertEquals("junit_task_2", task.getTaskType());
assertTrue(task.getInputData().isEmpty());
assertNotNull(task.getExternalInputPayloadStoragePath());
assertTrue(workflowExecutionService.ackTaskReceived(task.getTaskId()));
assertEquals(workflowId, task.getWorkflowInstanceId());
assertTrue("The second task input should not be persisted", workflow.getTasks().get(1).getInputData().isEmpty());
assertEquals(taskOutputPath, workflow.getTasks().get(0).getExternalOutputPayloadStoragePath());
assertEquals("task/input", workflow.getTasks().get(1).getExternalInputPayloadStoragePath());
assertTrue(workflow.getOutput().isEmpty());
assertNotNull(workflow.getExternalOutputPayloadStoragePath());

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

assertEquals("junit_task_2", task.getTaskType());
assertTrue(task.getInputData().isEmpty());
assertNotNull(task.getExternalInputPayloadStoragePath());
assertTrue(workflowExecutionService.ackTaskReceived(task.getTaskId()));
assertEquals(workflowId, task.getWorkflowInstanceId());
assertEquals("junit_task_2", task.getTaskType());
assertTrue(task.getInputData().isEmpty());
assertNotNull(task.getExternalInputPayloadStoragePath());
assertTrue(workflowExecutionService.ackTaskReceived(task.getTaskId()));
assertEquals(workflowId, task.getWorkflowInstanceId());
assertTrue("The second task input should not be persisted", workflow.getTasks().get(2).getInputData().isEmpty());
assertEquals(taskOutputPath, workflow.getTasks().get(0).getExternalOutputPayloadStoragePath());
assertEquals("task/input", workflow.getTasks().get(1).getExternalInputPayloadStoragePath());
assertEquals("task/input", workflow.getTasks().get(2).getExternalInputPayloadStoragePath());
assertTrue(workflow.getOutput().isEmpty());
assertNotNull(workflow.getExternalOutputPayloadStoragePath());

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

if (from.getExternalInputPayloadStoragePath() != null) {
  to.setExternalInputPayloadStoragePath( from.getExternalInputPayloadStoragePath() );

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

/**
 * Populates the task input from external payload storage if the external storage path is specified.
 *
 * @param task the task for which the input is to be populated.
 */
private void populateTaskInput(Task task) {
  if (StringUtils.isNotBlank(task.getExternalInputPayloadStoragePath())) {
    WorkflowTaskMetrics.incrementExternalPayloadUsedCount(task.getTaskDefName(), ExternalPayloadStorage.Operation.READ.name(), ExternalPayloadStorage.PayloadType.TASK_INPUT.name());
    task.setInputData(downloadFromExternalStorage(ExternalPayloadStorage.PayloadType.TASK_INPUT, task.getExternalInputPayloadStoragePath()));
    task.setExternalInputPayloadStoragePath(null);
  }
}

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

.filter(task -> StringUtils.isNotBlank(task.getExternalInputPayloadStoragePath()) || StringUtils.isNotBlank(task.getExternalOutputPayloadStoragePath()))
.forEach(task -> {
  if (StringUtils.isNotBlank(task.getExternalOutputPayloadStoragePath())) {
    task.setExternalOutputPayloadStoragePath(null);
  if (StringUtils.isNotBlank(task.getExternalInputPayloadStoragePath())) {
    task.setInputData(externalPayloadStorageUtils.downloadPayload(task.getExternalInputPayloadStoragePath()));
    Monitors.recordExternalPayloadStorageUsage(task.getTaskDefName(), ExternalPayloadStorage.Operation.READ.toString(), ExternalPayloadStorage.PayloadType.TASK_INPUT.toString());
    task.setExternalInputPayloadStoragePath(null);

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

Objects.equals(getInputMessage(), task.getInputMessage()) &&
Objects.equals(getOutputMessage(), task.getOutputMessage()) &&
Objects.equals(getExternalInputPayloadStoragePath(), task.getExternalInputPayloadStoragePath()) &&
Objects.equals(getExternalOutputPayloadStoragePath(), task.getExternalOutputPayloadStoragePath());

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

rescheduled.setReasonForIncompletion(null);
if (StringUtils.isNotBlank(task.getExternalInputPayloadStoragePath())) {
  rescheduled.setExternalInputPayloadStoragePath(task.getExternalInputPayloadStoragePath());
} else {
  rescheduled.getInputData().putAll(task.getInputData());

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

if (from.getExternalInputPayloadStoragePath() != null) {
  to.setExternalInputPayloadStoragePath( from.getExternalInputPayloadStoragePath() );

相关文章

Task类方法