本文整理了Java中com.linkedin.parseq.Task.getId()
方法的一些代码示例,展示了Task.getId()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Task.getId()
方法的具体详情如下:
包路径:com.linkedin.parseq.Task
类名称:Task
方法名:getId
[英]Unique identifier of the task.
[中]任务的唯一标识符。
代码示例来源:origin: linkedin/parseq
/**
* {@inheritDoc}
*/
@Override
public Long getId() {
return _task.getId();
}
代码示例来源:origin: linkedin/parseq
/**
* {@inheritDoc}
*/
@Override
public Long getId() {
return _task.getId();
}
代码示例来源:origin: linkedin/parseq
/**
* {@inheritDoc}
*/
@Override
public Long getId() {
return _task.getId();
}
代码示例来源:origin: linkedin/parseq
/**
* {@inheritDoc}
*/
@Override
public Long getId() {
return _task.getId();
}
代码示例来源:origin: linkedin/parseq
/**
* {@inheritDoc}
*/
@Override
public Long getId() {
return _task.getId();
}
代码示例来源:origin: linkedin/parseq
/**
* {@inheritDoc}
*/
@Override
public Long getId() {
return _task.getId();
}
代码示例来源:origin: linkedin/parseq
/**
* {@inheritDoc}
*/
@Override
public Long getId() {
return _task.getId();
}
代码示例来源:origin: linkedin/parseq
/**
* {@inheritDoc}
*/
@Override
public Long getId() {
return _task.getId();
}
代码示例来源:origin: linkedin/parseq
/**
* {@inheritDoc}
*/
@Override
public Long getId() {
return _task.getId();
}
代码示例来源:origin: linkedin/parseq
/**
* {@inheritDoc}
*/
@Override
public Long getId() {
return _task.getId();
}
代码示例来源:origin: linkedin/parseq
/**
* {@inheritDoc}
*/
@Override
public Long getId() {
return _task.getId();
}
代码示例来源:origin: linkedin/parseq
/**
* {@inheritDoc}
*/
@Override
public Long getId() {
return _task.getId();
}
代码示例来源:origin: linkedin/parseq
/**
* {@inheritDoc}
*/
@Override
public Long getId() {
return _task.getId();
}
代码示例来源:origin: linkedin/parseq
/**
* {@inheritDoc}
*/
@Override
public Long getId() {
return _task.getId();
}
代码示例来源:origin: linkedin/parseq
public Long getTaskId() {
return _task.getId();
}
代码示例来源:origin: linkedin/parseq
public void logTaskStart(final Task<?> task) {
if (_planLogger.isDebugEnabled()) {
_planLogger.debug(START_TASK_FORMAT, _planId, task.getName());
} else if (_rootLogger.isDebugEnabled() && _rootId.equals(task.getId())) {
_rootLogger.debug(START_TASK_FORMAT, _planId, task.getName());
} else if (_allLogger.isDebugEnabled()) {
_allLogger.debug(START_TASK_FORMAT, _planId, task.getName());
}
}
代码示例来源: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
@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 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)));
}
内容来源于网络,如有侵权,请联系作者删除!