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

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

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

Task.getShallowTrace介绍

[英]Returns the ShallowTrace for this task. The ShallowTrace will be a point-in-time snapshot and may change over time until the task is completed.
[中]返回此任务的ShallowTrace。ShallowTrace将是一个时间点快照,可能会随着时间的推移而改变,直到任务完成。

代码示例

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

/**
 * {@inheritDoc}
 */
@Override
public ShallowTrace getShallowTrace() {
 return _task.getShallowTrace();
}

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

/**
 * {@inheritDoc}
 */
@Override
public ShallowTrace getShallowTrace() {
 return _task.getShallowTrace();
}

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

/**
 * {@inheritDoc}
 */
@Override
public ShallowTrace getShallowTrace() {
 return _task.getShallowTrace();
}

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

/**
 * {@inheritDoc}
 */
@Override
public ShallowTrace getShallowTrace() {
 return _task.getShallowTrace();
}

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

/**
 * {@inheritDoc}
 */
@Override
public ShallowTrace getShallowTrace() {
 return _task.getShallowTrace();
}

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

/**
 * {@inheritDoc}
 */
@Override
public ShallowTrace getShallowTrace() {
 return _task.getShallowTrace();
}

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

/**
 * {@inheritDoc}
 */
@Override
public ShallowTrace getShallowTrace() {
 return _task.getShallowTrace();
}

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

/**
 * {@inheritDoc}
 */
@Override
public ShallowTrace getShallowTrace() {
 return _task.getShallowTrace();
}

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

/**
 * {@inheritDoc}
 */
@Override
public ShallowTrace getShallowTrace() {
 return _task.getShallowTrace();
}

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

/**
 * {@inheritDoc}
 */
@Override
public ShallowTrace getShallowTrace() {
 return _task.getShallowTrace();
}

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

/**
 * {@inheritDoc}
 */
@Override
public ShallowTrace getShallowTrace() {
 return _task.getShallowTrace();
}

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

/**
 * {@inheritDoc}
 */
@Override
public ShallowTrace getShallowTrace() {
 return _task.getShallowTrace();
}

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

/**
 * {@inheritDoc}
 */
@Override
public ShallowTrace getShallowTrace() {
 return _task.getShallowTrace();
}

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

/**
 * {@inheritDoc}
 */
@Override
public ShallowTrace getShallowTrace() {
 return _task.getShallowTrace();
}

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

private void recordCompletionTimes(final Histogram planHistogram, Histogram taskHistogram, Task<?> task) {
 ShallowTrace st = task.getShallowTrace();
 planHistogram.recordValue(st.getEndNanos() - st.getStartNanos());
 task.getTrace().getTraceMap().values().forEach(shallowTrace -> {
  taskHistogram.recordValue(shallowTrace.getPendingNanos() - shallowTrace.getStartNanos());
 });
}

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

@Test
public void testShareableTaskType() {
 Task<Integer> value = Task.value(10);
 Task<Integer> shareableTask = value.shareable();
 assertEquals(shareableTask.getShallowTrace().getTaskType(), TaskType.SHAREABLE.getName());
}

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

@Test
public void testFusionTaskType() {
 Task<Integer> task = getSuccessTask().map(String::length);
 runAndWait("fusionTaskType", task);
 assertEquals(task.getShallowTrace().getTaskType(), TaskType.FUSION.getName());
}

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

@Test
public void testFlatMapTaskType() {
 Task<String> task = Task.value("Welcome");
 Task<String> flatMap = task.flatMap("+earth", s -> Task.callable(() -> s + " on earth!"));
 runAndWait("flatMapTaskType", flatMap);
 assertEquals(flatMap.getShallowTrace().getTaskType(), TaskType.FLATTEN.getName());
}

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

@Test
public void testWithRecoverTaskType() {
 Task<String> task = getFailureTask().recoverWith(e -> Task.value("recoveryTask"));
 runAndWait(task);
 assertEquals(doesTaskTypeExistInTrace(task.getTrace(), TaskType.RECOVER.getName()), true);
 assertEquals(task.getShallowTrace().getTaskType(), TaskType.WITH_RECOVER.getName());
}

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

private <T> void assertDone(final Task<T> task, final T expectedValue) {
 assertTrue(task.isDone());
 assertFalse(task.isFailed());
 assertEquals(expectedValue, task.get());
 assertNull(task.getError());
 assertTrue(task.getShallowTrace().getStartNanos() > 0);
 assertTrue(task.getShallowTrace().getStartNanos() <= task.getShallowTrace().getEndNanos());
}

相关文章