Search in sources :

Example 1 with LegacyNetworkTopology

use of com.facebook.presto.execution.scheduler.LegacyNetworkTopology in project presto by prestodb.

the class TaskTestUtils method createTestingPlanner.

public static LocalExecutionPlanner createTestingPlanner() {
    MetadataManager metadata = MetadataManager.createTestMetadataManager();
    PageSourceManager pageSourceManager = new PageSourceManager();
    pageSourceManager.addConnectorPageSourceProvider(CONNECTOR_ID, new TestingPageSourceProvider());
    // we don't start the finalizer so nothing will be collected, which is ok for a test
    FinalizerService finalizerService = new FinalizerService();
    NodeScheduler nodeScheduler = new NodeScheduler(new LegacyNetworkTopology(), new InMemoryNodeManager(), new NodeSchedulerConfig().setIncludeCoordinator(true), new NodeTaskMap(finalizerService));
    NodePartitioningManager nodePartitioningManager = new NodePartitioningManager(nodeScheduler);
    return new LocalExecutionPlanner(metadata, new SqlParser(), Optional.empty(), pageSourceManager, new IndexManager(), nodePartitioningManager, new PageSinkManager(), new MockExchangeClientSupplier(), new ExpressionCompiler(metadata), new JoinFilterFunctionCompiler(metadata), new IndexJoinLookupStats(), new CompilerConfig(), new TaskManagerConfig(), new BinarySpillerFactory(new BlockEncodingManager(metadata.getTypeManager()), new FeaturesConfig()), new TestingBlockEncodingSerde(new TestingTypeManager()), new PagesIndex.TestingFactory(), new JoinCompiler(), new LookupJoinOperators(new JoinProbeCompiler()));
}
Also used : FeaturesConfig(com.facebook.presto.sql.analyzer.FeaturesConfig) NodeSchedulerConfig(com.facebook.presto.execution.scheduler.NodeSchedulerConfig) PagesIndex(com.facebook.presto.operator.PagesIndex) PageSourceManager(com.facebook.presto.split.PageSourceManager) NodePartitioningManager(com.facebook.presto.sql.planner.NodePartitioningManager) JoinProbeCompiler(com.facebook.presto.sql.gen.JoinProbeCompiler) NodeScheduler(com.facebook.presto.execution.scheduler.NodeScheduler) TestingTypeManager(com.facebook.presto.spi.type.TestingTypeManager) PageSinkManager(com.facebook.presto.split.PageSinkManager) LookupJoinOperators(com.facebook.presto.operator.LookupJoinOperators) JoinCompiler(com.facebook.presto.sql.gen.JoinCompiler) LocalExecutionPlanner(com.facebook.presto.sql.planner.LocalExecutionPlanner) MockExchangeClientSupplier(com.facebook.presto.execution.TestSqlTaskManager.MockExchangeClientSupplier) IndexJoinLookupStats(com.facebook.presto.operator.index.IndexJoinLookupStats) TestingBlockEncodingSerde(com.facebook.presto.spi.block.TestingBlockEncodingSerde) JoinFilterFunctionCompiler(com.facebook.presto.sql.gen.JoinFilterFunctionCompiler) SqlParser(com.facebook.presto.sql.parser.SqlParser) CompilerConfig(com.facebook.presto.sql.planner.CompilerConfig) InMemoryNodeManager(com.facebook.presto.metadata.InMemoryNodeManager) IndexManager(com.facebook.presto.index.IndexManager) MetadataManager(com.facebook.presto.metadata.MetadataManager) BlockEncodingManager(com.facebook.presto.block.BlockEncodingManager) FinalizerService(com.facebook.presto.util.FinalizerService) LegacyNetworkTopology(com.facebook.presto.execution.scheduler.LegacyNetworkTopology) BinarySpillerFactory(com.facebook.presto.spiller.BinarySpillerFactory) ExpressionCompiler(com.facebook.presto.sql.gen.ExpressionCompiler)

Example 2 with LegacyNetworkTopology

use of com.facebook.presto.execution.scheduler.LegacyNetworkTopology in project presto by prestodb.

the class TestNodeScheduler method setUp.

@BeforeMethod
public void setUp() throws Exception {
    finalizerService = new FinalizerService();
    nodeTaskMap = new NodeTaskMap(finalizerService);
    nodeManager = new InMemoryNodeManager();
    ImmutableList.Builder<Node> nodeBuilder = ImmutableList.builder();
    nodeBuilder.add(new PrestoNode("other1", URI.create("http://127.0.0.1:11"), NodeVersion.UNKNOWN, false));
    nodeBuilder.add(new PrestoNode("other2", URI.create("http://127.0.0.1:12"), NodeVersion.UNKNOWN, false));
    nodeBuilder.add(new PrestoNode("other3", URI.create("http://127.0.0.1:13"), NodeVersion.UNKNOWN, false));
    ImmutableList<Node> nodes = nodeBuilder.build();
    nodeManager.addNode(CONNECTOR_ID, nodes);
    NodeSchedulerConfig nodeSchedulerConfig = new NodeSchedulerConfig().setMaxSplitsPerNode(20).setIncludeCoordinator(false).setMaxPendingSplitsPerTask(10);
    NodeScheduler nodeScheduler = new NodeScheduler(new LegacyNetworkTopology(), nodeManager, nodeSchedulerConfig, nodeTaskMap);
    // contents of taskMap indicate the node-task map for the current stage
    taskMap = new HashMap<>();
    nodeSelector = nodeScheduler.createNodeSelector(CONNECTOR_ID);
    remoteTaskExecutor = Executors.newCachedThreadPool(daemonThreadsNamed("remoteTaskExecutor-%s"));
    finalizerService.start();
}
Also used : FinalizerService(com.facebook.presto.util.FinalizerService) ImmutableList(com.google.common.collect.ImmutableList) Node(com.facebook.presto.spi.Node) PrestoNode(com.facebook.presto.metadata.PrestoNode) LegacyNetworkTopology(com.facebook.presto.execution.scheduler.LegacyNetworkTopology) NodeSchedulerConfig(com.facebook.presto.execution.scheduler.NodeSchedulerConfig) NodeScheduler(com.facebook.presto.execution.scheduler.NodeScheduler) PrestoNode(com.facebook.presto.metadata.PrestoNode) InMemoryNodeManager(com.facebook.presto.metadata.InMemoryNodeManager) BeforeMethod(org.testng.annotations.BeforeMethod)

Aggregations

LegacyNetworkTopology (com.facebook.presto.execution.scheduler.LegacyNetworkTopology)2 NodeScheduler (com.facebook.presto.execution.scheduler.NodeScheduler)2 NodeSchedulerConfig (com.facebook.presto.execution.scheduler.NodeSchedulerConfig)2 InMemoryNodeManager (com.facebook.presto.metadata.InMemoryNodeManager)2 FinalizerService (com.facebook.presto.util.FinalizerService)2 BlockEncodingManager (com.facebook.presto.block.BlockEncodingManager)1 MockExchangeClientSupplier (com.facebook.presto.execution.TestSqlTaskManager.MockExchangeClientSupplier)1 IndexManager (com.facebook.presto.index.IndexManager)1 MetadataManager (com.facebook.presto.metadata.MetadataManager)1 PrestoNode (com.facebook.presto.metadata.PrestoNode)1 LookupJoinOperators (com.facebook.presto.operator.LookupJoinOperators)1 PagesIndex (com.facebook.presto.operator.PagesIndex)1 IndexJoinLookupStats (com.facebook.presto.operator.index.IndexJoinLookupStats)1 Node (com.facebook.presto.spi.Node)1 TestingBlockEncodingSerde (com.facebook.presto.spi.block.TestingBlockEncodingSerde)1 TestingTypeManager (com.facebook.presto.spi.type.TestingTypeManager)1 BinarySpillerFactory (com.facebook.presto.spiller.BinarySpillerFactory)1 PageSinkManager (com.facebook.presto.split.PageSinkManager)1 PageSourceManager (com.facebook.presto.split.PageSourceManager)1 FeaturesConfig (com.facebook.presto.sql.analyzer.FeaturesConfig)1