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

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

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

Task.get介绍

[英]Unique identifier of the task.
[中]任务的唯一标识符。

代码示例

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

/**
 * {@inheritDoc}
 */
@Override
public Tuple15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> get() throws PromiseException {
 return _task.get();
}

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

@Test
public void testPar5Dsc() {
 Task<Integer> task = Task.par(Task.value(1), Task.value(2), Task.value(3), Task.value(4), Task.value(5))
   .map("test", (a, b, c, d, e) -> a + b + c + d + e);
 runAndWait("TestTaskFactoryMethods.testPar5Dsc", task);
 assertEquals((int)task.get(), 1 + 2 + 3 + 4 + 5);
 assertEquals(countTasks(task.getTrace()), 2 + 1 + 5);
}

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

@Test
public void testPar4FlatMapDsc() {
 Task<Integer> task = Task.par(Task.value(1), Task.value(2), Task.value(3), Task.value(4)).flatMap("test", (a, b, c, d) -> Task.value(a + b + c + d));
 runAndWait("TestTaskFactoryMethods.testPar4FlatMapDsc", task);
 assertEquals((int)task.get(), 1 + 2 + 3 + 4);
 assertEquals(countTasks(task.getTrace()), 2 + 3 + 4);
}

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

/**
 * {@inheritDoc}
 */
@Override
public Tuple8<T1, T2, T3, T4, T5, T6, T7, T8> get() throws PromiseException {
 return _task.get();
}

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

@Test
public void testPar7() {
 Task<Integer> task = Task
   .par(Task.value(1), Task.value(2), Task.value(3), Task.value(4), Task.value(5), Task.value(6), Task.value(7))
    .map((a, b, c, d, e, f, g) -> a + b + c + d + e + f + g);
 runAndWait("TestTaskFactoryMethods.testPar7", task);
 assertEquals((int)task.get(), 1 + 2 + 3 + 4 + 5 + 6 + 7);
 assertEquals(countTasks(task.getTrace()), 2 + 1 + 7);
}

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

/**
 * {@inheritDoc}
 */
@Override
public Tuple6<T1, T2, T3, T4, T5, T6> get() throws PromiseException {
 return _task.get();
}

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

@Test
public void testPar10() {
 Task<Integer> task = Task.par(Task.value(1), Task.value(2), Task.value(3), Task.value(4), Task.value(5), Task.value(6),
   Task.value(7), Task.value(8), Task.value(9), Task.value(10))
   .map((a, b, c, d, e, f, g, h, i, j) -> a + b + c + d + e + f + g + h + i + j);
 runAndWait("TestTaskFactoryMethods.testPar10", task);
 assertEquals((int)task.get(), 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10);
 assertEquals(countTasks(task.getTrace()), 2 + 1 + 10);
}

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

/**
 * {@inheritDoc}
 */
@Override
public Tuple7<T1, T2, T3, T4, T5, T6, T7> get() throws PromiseException {
 return _task.get();
}

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

@Test
public void testPar10Dsc() {
 Task<Integer> task = Task.par(Task.value(1), Task.value(2), Task.value(3), Task.value(4), Task.value(5), Task.value(6),
   Task.value(7), Task.value(8), Task.value(9), Task.value(10))
   .map("test", (a, b, c, d, e, f, g, h, i, j) -> a + b + c + d + e + f + g + h + i + j);
 runAndWait("TestTaskFactoryMethods.testPar10Dsc", task);
 assertEquals((int)task.get(), 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10);
 assertEquals(countTasks(task.getTrace()), 2 + 1 + 10);
}

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

@Override
 public void run()
 {
  doClassify(new ConnectedClassifier(network.get()));
 }
});

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

@Test
public void testPar12() {
 Task<Integer> task = Task.par(Task.value(1), Task.value(2), Task.value(3), Task.value(4), Task.value(5), Task.value(6),
   Task.value(7), Task.value(8), Task.value(9), Task.value(10), Task.value(11), Task.value(12))
   .map((a, b, c, d, e, f, g, h, i, j, k, l) -> a + b + c + d + e + f + g + h + i + j + k + l);
 runAndWait("TestTaskFactoryMethods.testPar12", task);
 assertEquals((int)task.get(), 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12);
 assertEquals(countTasks(task.getTrace()), 2 + 1 + 12);
}

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

@SuppressWarnings("deprecation")
@Test
public void testIterableSeqWithSingletonList() throws InterruptedException {
 final String valueStr = "value";
 final Task<String> task = value("value", valueStr);
 final Task<List<String>> seq = seq(Collections.singleton(task));
 runAndWait("TestSeqTask.testIterableSeqWithSingletonList", seq);
 assertEquals(valueStr, seq.get());
}

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

@Test
public void testPar12Dsc() {
 Task<Integer> task = Task.par(Task.value(1), Task.value(2), Task.value(3), Task.value(4), Task.value(5), Task.value(6),
   Task.value(7), Task.value(8), Task.value(9), Task.value(10), Task.value(11), Task.value(12))
   .map("test", (a, b, c, d, e, f, g, h, i, j, k, l) -> a + b + c + d + e + f + g + h + i + j + k + l);
 runAndWait("TestTaskFactoryMethods.testPar12Dsc", task);
 assertEquals((int)task.get(), 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12);
 assertEquals(countTasks(task.getTrace()), 2 + 1 + 12);
}

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

@Test
public void testSuccessfulTask()
{
 Task<String> task = withRetryPolicy(RetryPolicy.attempts(3, 0), attempt -> Task.value("successful attempt " + attempt));
 runAndWait(task);
 assertTrue(task.isDone());
 assertEquals(task.get(), "successful attempt 0");
}

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

@Test
public void testPar15() {
 Task<Integer> task = Task.par(Task.value(1), Task.value(2), Task.value(3), Task.value(4), Task.value(5), Task.value(6),
   Task.value(7), Task.value(8), Task.value(9), Task.value(10), Task.value(11), Task.value(12), Task.value(13),
   Task.value(14), Task.value(15))
   .map((a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> a + b + c + d + e + f + g + h + i + j + k + l + m + n +
     o);
 runAndWait("TestTaskFactoryMethods.testPar15", task);
 assertEquals((int)task.get(), 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15);
 assertEquals(countTasks(task.getTrace()), 2 + 1 + 15);
}

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

@SuppressWarnings("deprecation")
@Test
public void testSeq3() throws InterruptedException {
 final Task<String> seq = seq(value(1), value(2), value("result"));
 runAndWait("TestSeqTask.testSeq3", seq);
 assertEquals("result", seq.get());
}

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

@Test
public void testPar15FlatMapDsc() {
 Task<Integer> task = Task.par(Task.value(1), Task.value(2), Task.value(3), Task.value(4), Task.value(5), Task.value(6),
   Task.value(7), Task.value(8), Task.value(9), Task.value(10), Task.value(11), Task.value(12), Task.value(13),
   Task.value(14), Task.value(15))
   .flatMap("test", (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Task.value(a + b + c + d + e + f + g + h + i +
     j + k + l + m + n + o));
 runAndWait("TestTaskFactoryMethods.testPar15FlatMapDsc", task);
 assertEquals((int)task.get(), 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15);
 assertEquals(countTasks(task.getTrace()), 2 + 3 + 15);
}

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

@SuppressWarnings("deprecation")
@Test
public void testSeq6() throws InterruptedException {
 final Task<String> seq = seq(value(1), value(2), value(3), value(4), value(5), value("result"));
 runAndWait("TestSeqTask.testSeq6", seq);
 assertEquals("result", seq.get());
}

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

@SuppressWarnings("deprecation")
@Test
public void testPar9() throws InterruptedException {
 final Task<List<Integer>> par =
   par(value(1), value(2), value(3), value(4), value(5), value(6), value(7), value(8), value(9));
 runAndWait("TestParTask.testPar9", par);
 assertEquals(Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9), par.get());
}

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

@SuppressWarnings("deprecation")
@Test
public void testSeq7() throws InterruptedException {
 final Task<String> seq = seq(value(1), value(2), value(3), value(4), value(5), value(6), value("result"));
 runAndWait("TestSeqTask.testSeq7", seq);
 assertEquals("result", seq.get());
}

相关文章