use of com.facebook.presto.execution.TaskSource in project presto by prestodb.
the class PrestoSparkRddFactory method createTaskSources.
private ListMultimap<Integer, SerializedPrestoSparkTaskSource> createTaskSources(PlanNodeId tableScanId, SetMultimap<Integer, ScheduledSplit> assignedSplits) {
ListMultimap<Integer, SerializedPrestoSparkTaskSource> result = ArrayListMultimap.create();
for (int partitionId : ImmutableSet.copyOf(assignedSplits.keySet())) {
// remove the entry from the collection to let GC reclaim the memory
Set<ScheduledSplit> splits = assignedSplits.removeAll(partitionId);
TaskSource taskSource = new TaskSource(tableScanId, splits, true);
SerializedPrestoSparkTaskSource serializedTaskSource = new SerializedPrestoSparkTaskSource(serializeZstdCompressed(taskSourceCodec, taskSource));
result.put(partitionId, serializedTaskSource);
}
return result;
}
Aggregations