use of com.facebook.presto.version.EmbedVersion in project presto by prestodb.
the class TestTaskExecutor method testTaskExecutorRunawaySplitInterrupt.
@Test
public void testTaskExecutorRunawaySplitInterrupt() throws Exception {
TaskExecutor taskExecutor = new TaskExecutor(8, 16, 3, 4, TASK_FAIR, new Duration(1, SECONDS), elements -> elements.stream().anyMatch(element -> element.getFileName().equals("TestTaskExecutor.java")), new Duration(1, SECONDS), new EmbedVersion(new ServerConfig()), new MultilevelSplitQueue(2), Ticker.systemTicker());
taskExecutor.start();
try {
TaskId taskId = new TaskId("foo", 0, 0, 0);
TaskHandle taskHandle = taskExecutor.addTask(taskId, () -> 1.0, 1, new Duration(1, TimeUnit.SECONDS), OptionalInt.of(1));
MockSplitRunner mockSplitRunner = new MockSplitRunner();
taskExecutor.enqueueSplits(taskHandle, false, ImmutableList.of(mockSplitRunner));
mockSplitRunner.interrupted.get(60, TimeUnit.SECONDS);
} finally {
taskExecutor.stop();
}
}
Aggregations