Search in sources :

Example 11 with SplitSource

use of com.facebook.presto.split.SplitSource in project presto by prestodb.

the class TestSourcePartitionedScheduler method getSourcePartitionedScheduler.

private static StageScheduler getSourcePartitionedScheduler(ConnectorSplitSource connectorSplitSource, SqlStageExecution stage, InternalNodeManager nodeManager, NodeTaskMap nodeTaskMap, int splitBatchSize) {
    NodeSchedulerConfig nodeSchedulerConfig = new NodeSchedulerConfig().setIncludeCoordinator(false).setMaxSplitsPerNode(20).setMaxPendingSplitsPerTask(0);
    NodeScheduler nodeScheduler = new NodeScheduler(new LegacyNetworkTopology(), nodeManager, new NodeSelectionStats(), nodeSchedulerConfig, nodeTaskMap, new ThrowingNodeTtlFetcherManager(), new NoOpQueryManager(), new SimpleTtlNodeSelectorConfig());
    SplitSource splitSource = new ConnectorAwareSplitSource(CONNECTOR_ID, TestingTransactionHandle.create(), connectorSplitSource);
    SplitPlacementPolicy placementPolicy = new DynamicSplitPlacementPolicy(nodeScheduler.createNodeSelector(TestingSession.testSessionBuilder().build(), splitSource.getConnectorId()), stage::getAllTasks);
    return newSourcePartitionedSchedulerAsStageScheduler(stage, TABLE_SCAN_NODE_ID, splitSource, placementPolicy, splitBatchSize);
}
Also used : NoOpQueryManager(com.facebook.presto.dispatcher.NoOpQueryManager) NodeSelectionStats(com.facebook.presto.execution.scheduler.nodeSelection.NodeSelectionStats) ConnectorSplitSource(com.facebook.presto.spi.ConnectorSplitSource) SplitSource(com.facebook.presto.split.SplitSource) ConnectorAwareSplitSource(com.facebook.presto.split.ConnectorAwareSplitSource) FixedSplitSource(com.facebook.presto.spi.FixedSplitSource) ThrowingNodeTtlFetcherManager(com.facebook.presto.ttl.nodettlfetchermanagers.ThrowingNodeTtlFetcherManager) SimpleTtlNodeSelectorConfig(com.facebook.presto.execution.scheduler.nodeSelection.SimpleTtlNodeSelectorConfig) ConnectorAwareSplitSource(com.facebook.presto.split.ConnectorAwareSplitSource)

Aggregations

SplitSource (com.facebook.presto.split.SplitSource)11 ImmutableSet (com.google.common.collect.ImmutableSet)6 ArrayList (java.util.ArrayList)6 Split (com.facebook.presto.metadata.Split)5 PlanNodeId (com.facebook.presto.spi.plan.PlanNodeId)5 HashMap (java.util.HashMap)5 TableScanNode (com.facebook.presto.spi.plan.TableScanNode)4 ImmutableList (com.google.common.collect.ImmutableList)4 Map (java.util.Map)4 Session (com.facebook.presto.Session)3 PlanNode (com.facebook.presto.spi.plan.PlanNode)3 SplitSourceFactory (com.facebook.presto.sql.planner.SplitSourceFactory)3 PlanFragmentId (com.facebook.presto.sql.planner.plan.PlanFragmentId)3 Preconditions.checkArgument (com.google.common.base.Preconditions.checkArgument)3 List (java.util.List)3 Objects.requireNonNull (java.util.Objects.requireNonNull)3 Optional (java.util.Optional)3 Set (java.util.Set)3 ScheduledSplit (com.facebook.presto.execution.ScheduledSplit)2 TaskManagerConfig (com.facebook.presto.execution.TaskManagerConfig)2