Search in sources :

Example 16 with TaskSource

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;
}
Also used : ScheduledSplit(com.facebook.presto.execution.ScheduledSplit) SerializedPrestoSparkTaskSource(com.facebook.presto.spark.classloader_interface.SerializedPrestoSparkTaskSource) SerializedPrestoSparkTaskSource(com.facebook.presto.spark.classloader_interface.SerializedPrestoSparkTaskSource) TaskSource(com.facebook.presto.execution.TaskSource)

Aggregations

TaskSource (com.facebook.presto.execution.TaskSource)16 ScheduledSplit (com.facebook.presto.execution.ScheduledSplit)12 PlanNodeId (com.facebook.presto.spi.plan.PlanNodeId)10 Duration (io.airlift.units.Duration)5 Type (com.facebook.presto.common.type.Type)4 SerializedPrestoSparkTaskSource (com.facebook.presto.spark.classloader_interface.SerializedPrestoSparkTaskSource)4 FixedPageSource (com.facebook.presto.spi.FixedPageSource)4 Split (com.facebook.presto.metadata.Split)3 PageConsumerOperator (com.facebook.presto.testing.PageConsumerOperator)3 ImmutableList (com.google.common.collect.ImmutableList)3 JsonCodec (com.facebook.airlift.json.JsonCodec)2 SmileCodec (com.facebook.airlift.json.smile.SmileCodec)2 Page (com.facebook.presto.common.Page)2 TaskManagerConfig (com.facebook.presto.execution.TaskManagerConfig)2 MemoryManagerConfig (com.facebook.presto.memory.MemoryManagerConfig)2 Driver (com.facebook.presto.operator.Driver)2 LookupJoinOperators (com.facebook.presto.operator.LookupJoinOperators)2 NoOpFragmentResultCacheManager (com.facebook.presto.operator.NoOpFragmentResultCacheManager)2 PagesIndex (com.facebook.presto.operator.PagesIndex)2 TableCommitContext (com.facebook.presto.operator.TableCommitContext)2