com.linkedin.parseq.Task.getShallowTraceBuilder()方法的使用及代码示例

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

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

Task.getShallowTraceBuilder介绍

暂无

代码示例

代码示例来源:origin: linkedin/parseq

@Override
public ShallowTraceBuilder getShallowTraceBuilder() {
 return _task.getShallowTraceBuilder();
}

代码示例来源:origin: linkedin/parseq

@Override
public ShallowTraceBuilder getShallowTraceBuilder() {
 return _task.getShallowTraceBuilder();
}

代码示例来源:origin: linkedin/parseq

@Override
public ShallowTraceBuilder getShallowTraceBuilder() {
 return _task.getShallowTraceBuilder();
}

代码示例来源:origin: linkedin/parseq

@Override
public ShallowTraceBuilder getShallowTraceBuilder() {
 return _task.getShallowTraceBuilder();
}

代码示例来源:origin: linkedin/parseq

@Override
public ShallowTraceBuilder getShallowTraceBuilder() {
 return _task.getShallowTraceBuilder();
}

代码示例来源:origin: linkedin/parseq

@Override
public ShallowTraceBuilder getShallowTraceBuilder() {
 return _task.getShallowTraceBuilder();
}

代码示例来源:origin: linkedin/parseq

@Override
public ShallowTraceBuilder getShallowTraceBuilder() {
 return _task.getShallowTraceBuilder();
}

代码示例来源:origin: linkedin/parseq

@Override
public ShallowTraceBuilder getShallowTraceBuilder() {
 return _task.getShallowTraceBuilder();
}

代码示例来源:origin: linkedin/parseq

@Override
public ShallowTraceBuilder getShallowTraceBuilder() {
 return _task.getShallowTraceBuilder();
}

代码示例来源:origin: linkedin/parseq

@Override
public ShallowTraceBuilder getShallowTraceBuilder() {
 return _task.getShallowTraceBuilder();
}

代码示例来源:origin: linkedin/parseq

@Override
public ShallowTraceBuilder getShallowTraceBuilder() {
 return _task.getShallowTraceBuilder();
}

代码示例来源:origin: linkedin/parseq

@Override
public ShallowTraceBuilder getShallowTraceBuilder() {
 return _task.getShallowTraceBuilder();
}

代码示例来源:origin: linkedin/parseq

@Override
public ShallowTraceBuilder getShallowTraceBuilder() {
 return _task.getShallowTraceBuilder();
}

代码示例来源:origin: linkedin/parseq

@Override
public ShallowTraceBuilder getShallowTraceBuilder() {
 return _task.getShallowTraceBuilder();
}

代码示例来源:origin: linkedin/parseq

@Override
public ShallowTraceBuilder getShallowTraceBuilder() {
 return _task.getShallowTraceBuilder();
}

代码示例来源:origin: linkedin/parseq

/**
 * A helper for creating task wrapper with associated retry policy.
 *
 * @param name A name of the task that needs to be retried.
 * @param policy Retry policy that will control this task's behavior.
 * @param taskFunction A task generator function. It will receive a zero-based attempt number as a parameter.
 * @param <U> Type of a task result.
 */
public static <U> Task<U> withRetryPolicy(String name, RetryPolicy policy, Function1<Integer, Task<U>> taskFunction) {
 RetriableTask<U> retriableTask = new RetriableTask<>(name, policy, taskFunction);
 Task<U> retryTaskWrapper = Task.async(name + " retriableTask", retriableTask::run);
 retryTaskWrapper.getShallowTraceBuilder().setTaskType(TaskType.WITH_RETRY.getName());
 return retryTaskWrapper;
}

代码示例来源:origin: linkedin/parseq

@SuppressWarnings("deprecation")
@Test
public void testTraceWithSuccessChild() throws InterruptedException {
 final Task<String> task = value("taskName", "value");
 final Task<?> seq = Tasks.seq(Arrays.asList(task));
 runAndWait("TestTaskToTrace.testTraceWithSuccessChild", seq);
 verifyShallowTrace(task);
 verifyShallowTrace(seq);
 assertEquals(1, getRelationships(seq.getTrace(), seq.getId()).size());
 assertTrue(seq.getTrace().getRelationships()
   .contains(new TraceRelationship(seq.getShallowTraceBuilder(),
     task.getShallowTraceBuilder(), Relationship.PARENT_OF)));
}

代码示例来源:origin: linkedin/parseq

@Test
public void testTraceWithEarlyFinish() throws InterruptedException {
 final Task<String> innerTask = value("xyz");
 final Task<String> task = new BaseTask<String>() {
  @Override
  protected Promise<? extends String> run(final Context context) throws Exception {
   // We kick off a task that won't finish before the containing task
   // (this task) is finished.
   context.run(innerTask);
   return Promises.value("value");
  }
 };
 runAndWait("TestTaskToTrace.testTraceWithEarlyFinish", task);
 assertEquals(1, getRelationships(task.getTrace(), task.getId()).size());
 assertTrue(task.getTrace().getRelationships()
   .contains(new TraceRelationship(task.getShallowTraceBuilder(),
     innerTask.getShallowTraceBuilder(), Relationship.POTENTIAL_PARENT_OF)));
 assertEquals(ResultType.EARLY_FINISH, task.getTrace().getTraceMap().get(innerTask.getId()).getResultType());
}

代码示例来源:origin: linkedin/parseq

@Test
public void testSideEffectsPredecessorTrace() throws InterruptedException, IOException {
 final Task<String> baseTask = value("base", "baseValue");
 final Task<String> sideEffect = value("sideEffect", "sideEffectValue");
 final Task<String> withSideEffect = baseTask.withSideEffect(x -> sideEffect);
 runAndWait("TestTaskToTrace.testSideEffectsPredecessorTrace", withSideEffect);
 assertTrue(sideEffect.await(5, TimeUnit.SECONDS));
 assertEquals(2, getRelationships(withSideEffect.getTrace(), withSideEffect.getId()).size());
 verifyShallowTrace(sideEffect);
 verifyShallowTrace(baseTask);
 assertTrue(withSideEffect.getTrace().getRelationships().toString(), withSideEffect.getTrace().getRelationships()
   .contains(new TraceRelationship(withSideEffect.getShallowTraceBuilder(),
     baseTask.getShallowTraceBuilder(), Relationship.PARENT_OF)));
}

代码示例来源:origin: linkedin/parseq

@Test
public void testTraceWithPredecessorTrace() throws InterruptedException {
 final Task<String> predecessor = value("predecessor", "predecessorValue");
 final Task<String> successor = value("successor", "successorValue");
 final Task<?> seq = predecessor.andThen(successor);
 runAndWait("TestTaskToTrace.testTraceWithPredecessorTrace", seq);
 verifyShallowTrace(successor);
 verifyShallowTrace(predecessor);
 assertEquals(predecessor.getTrace(), successor.getTrace());
 //expected relationship: PARENT_OF and SUCCESSOR_OF
 assertEquals(2, getRelationships(successor.getTrace(), successor.getId()).size());
 assertTrue(successor.getTrace().getRelationships()
   .contains(new TraceRelationship(successor.getShallowTraceBuilder(),
     predecessor.getShallowTraceBuilder(), Relationship.SUCCESSOR_OF)));
}

相关文章