本文整理了Java中com.linkedin.parseq.Task.getShallowTrace()
方法的一些代码示例,展示了Task.getShallowTrace()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Task.getShallowTrace()
方法的具体详情如下:
包路径:com.linkedin.parseq.Task
类名称: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());
}
内容来源于网络,如有侵权,请联系作者删除!