use of com.facebook.drift.annotations.ThriftMethod in project presto by prestodb.
the class ThriftTaskService method getResults.
@ThriftMethod
public ListenableFuture<ThriftBufferResult> getResults(TaskId taskId, OutputBufferId bufferId, long token, long maxSizeInBytes) {
requireNonNull(taskId, "taskId is null");
requireNonNull(bufferId, "bufferId is null");
ListenableFuture<BufferResult> bufferResultFuture = taskManager.getTaskResults(taskId, bufferId, token, new DataSize(maxSizeInBytes, BYTE));
Duration waitTime = randomizeWaitTime(DEFAULT_MAX_WAIT_TIME);
bufferResultFuture = addTimeout(bufferResultFuture, () -> BufferResult.emptyResults(taskManager.getTaskInstanceId(taskId), token, false), waitTime, timeoutExecutor);
return Futures.transform(bufferResultFuture, ThriftBufferResult::fromBufferResult, directExecutor());
}
Aggregations