Search in sources :

Example 16 with SeedStoreManager

use of io.prestosql.seedstore.SeedStoreManager in project hetu-core by openlookeng.

the class TestUtil method getTestStage.

public static SqlStageExecution getTestStage(RowExpression expression) {
    StageId stageId = new StageId(new QueryId("query"), 0);
    SqlStageExecution stage = createSqlStageExecution(stageId, new TestSqlTaskManager.MockLocationFactory().createStageLocation(stageId), createExchangePlanFragment(expression), new HashMap<>(), new MockRemoteTaskFactory(executor, scheduledExecutor), TEST_SESSION, true, nodeTaskMap, executor, new NoOpFailureDetector(), new SplitSchedulerStats(), new DynamicFilterService(new LocalStateStoreProvider(new SeedStoreManager(new FileSystemClientManager()))), new QuerySnapshotManager(stageId.getQueryId(), TestingSnapshotUtils.NOOP_SNAPSHOT_UTILS, TEST_SESSION));
    stage.setOutputBuffers(createInitialEmptyOutputBuffers(ARBITRARY));
    return stage;
}
Also used : NoOpFailureDetector(io.prestosql.failuredetector.NoOpFailureDetector) StageId(io.prestosql.execution.StageId) QueryId(io.prestosql.spi.QueryId) SqlStageExecution.createSqlStageExecution(io.prestosql.execution.SqlStageExecution.createSqlStageExecution) SqlStageExecution(io.prestosql.execution.SqlStageExecution) FileSystemClientManager(io.prestosql.filesystem.FileSystemClientManager) QuerySnapshotManager(io.prestosql.snapshot.QuerySnapshotManager) LocalStateStoreProvider(io.prestosql.statestore.LocalStateStoreProvider) SplitSchedulerStats(io.prestosql.execution.scheduler.SplitSchedulerStats) SeedStoreManager(io.prestosql.seedstore.SeedStoreManager) DynamicFilterService(io.prestosql.dynamicfilter.DynamicFilterService) MockRemoteTaskFactory(io.prestosql.execution.MockRemoteTaskFactory)

Example 17 with SeedStoreManager

use of io.prestosql.seedstore.SeedStoreManager in project boostkit-bigdata by kunpengcompute.

the class OmniLocalQueryRunner method createDriversWithPlanOnly.

private void createDriversWithPlanOnly(Session session, Plan plan, OutputFactory outputFactory, TaskContext taskContext) {
    if (printPlan) {
        System.out.println(PlanPrinter.textLogicalPlan(plan.getRoot(), plan.getTypes(), metadata, plan.getStatsAndCosts(), session, 0, false));
    }
    SubPlan subplan = planFragmenter.createSubPlans(session, plan, true, WarningCollector.NOOP);
    if (!subplan.getChildren().isEmpty()) {
        throw new AssertionError("Expected subplan to have no children");
    }
    NodeInfo nodeInfo = new NodeInfo("test");
    FileSystemClientManager fileSystemClientManager = new FileSystemClientManager();
    SeedStoreManager seedStoreManager = new SeedStoreManager(fileSystemClientManager);
    StateStoreProvider stateStoreProvider = new LocalStateStoreProvider(seedStoreManager);
    LocalExecutionPlanner localExecutionPlanner = new LocalExecutionPlanner(metadata, new TypeAnalyzer(sqlParser, metadata), Optional.empty(), pageSourceManager, indexManager, nodePartitioningManager, pageSinkManager, null, expressionCompiler, pageFunctionCompiler, joinFilterFunctionCompiler, new IndexJoinLookupStats(), this.taskManagerConfig, spillerFactory, singleStreamSpillerFactory, partitioningSpillerFactory, new PagesIndex.TestingFactory(false), joinCompiler, new LookupJoinOperators(), new OrderingCompiler(), nodeInfo, stateStoreProvider, new StateStoreListenerManager(stateStoreProvider), new DynamicFilterCacheManager(), heuristicIndexerManager, cubeManager);
    OmniLocalExecutionPlanner omniLocalExecutionPlanner = new OmniLocalExecutionPlanner(localExecutionPlanner);
    ScheduledExecutorService taskNotificationExecutor = newScheduledThreadPool(10, threadsNamed("task-notification-%s"));
    OutputBuffer outputBuffer = new PartitionedOutputBuffer(new StateMachine<>("bufferState", taskNotificationExecutor, OPEN, TERMINAL_BUFFER_STATES), createInitialEmptyOutputBuffers(PARTITIONED).withBuffer(new OutputBuffers.OutputBufferId(0), 0).withNoMoreBufferIds(), new DataSize(1, MEGABYTE), () -> new SimpleLocalMemoryContext(newSimpleAggregatedMemoryContext(), "test"), taskNotificationExecutor);
    StageExecutionDescriptor stageExecutionDescriptor = subplan.getFragment().getStageExecutionDescriptor();
    omniLocalExecutionPlanner.plan(taskContext, subplan.getFragment().getRoot(), plan.getTypes(), new PartitioningScheme(Partitioning.create(FIXED_HASH_DISTRIBUTION, ImmutableList.of()), subplan.getFragment().getRoot().getOutputSymbols(), Optional.empty(), false, Optional.of(new int[] { 1 })), stageExecutionDescriptor, subplan.getFragment().getPartitionedSources(), outputBuffer, Optional.empty(), Optional.empty(), null);
}
Also used : StateStoreListenerManager(io.prestosql.statestore.listener.StateStoreListenerManager) PagesIndex(io.prestosql.operator.PagesIndex) LocalStateStoreProvider(io.prestosql.statestore.LocalStateStoreProvider) StateStoreProvider(io.prestosql.statestore.StateStoreProvider) OutputBuffer(io.prestosql.execution.buffer.OutputBuffer) PartitionedOutputBuffer(io.prestosql.execution.buffer.PartitionedOutputBuffer) LocalStateStoreProvider(io.prestosql.statestore.LocalStateStoreProvider) OutputBuffers.createInitialEmptyOutputBuffers(io.prestosql.execution.buffer.OutputBuffers.createInitialEmptyOutputBuffers) OutputBuffers(io.prestosql.execution.buffer.OutputBuffers) SeedStoreManager(io.prestosql.seedstore.SeedStoreManager) DataSize(io.airlift.units.DataSize) OrderingCompiler(io.prestosql.sql.gen.OrderingCompiler) LookupJoinOperators(io.prestosql.operator.LookupJoinOperators) DynamicFilterCacheManager(io.prestosql.dynamicfilter.DynamicFilterCacheManager) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) LocalExecutionPlanner(io.prestosql.sql.planner.LocalExecutionPlanner) PartitionedOutputBuffer(io.prestosql.execution.buffer.PartitionedOutputBuffer) SimpleLocalMemoryContext(io.prestosql.memory.context.SimpleLocalMemoryContext) IndexJoinLookupStats(io.prestosql.operator.index.IndexJoinLookupStats) StageExecutionDescriptor(io.prestosql.operator.StageExecutionDescriptor) PartitioningScheme(io.prestosql.sql.planner.PartitioningScheme) TypeAnalyzer(io.prestosql.sql.planner.TypeAnalyzer) FileSystemClientManager(io.prestosql.filesystem.FileSystemClientManager) NodeInfo(io.airlift.node.NodeInfo) SubPlan(io.prestosql.sql.planner.SubPlan)

Aggregations

SeedStoreManager (io.prestosql.seedstore.SeedStoreManager)17 LocalStateStoreProvider (io.prestosql.statestore.LocalStateStoreProvider)14 FileSystemClientManager (io.prestosql.filesystem.FileSystemClientManager)13 Split (io.prestosql.metadata.Split)9 PlanNodeId (io.prestosql.spi.plan.PlanNodeId)9 DynamicFilterService (io.prestosql.dynamicfilter.DynamicFilterService)8 SqlStageExecution.createSqlStageExecution (io.prestosql.execution.SqlStageExecution.createSqlStageExecution)8 NoOpFailureDetector (io.prestosql.failuredetector.NoOpFailureDetector)8 QuerySnapshotManager (io.prestosql.snapshot.QuerySnapshotManager)8 QueryId (io.prestosql.spi.QueryId)8 FinalizerService (io.prestosql.util.FinalizerService)8 Test (org.testng.annotations.Test)8 MockRemoteTaskFactory (io.prestosql.execution.MockRemoteTaskFactory)7 SqlStageExecution (io.prestosql.execution.SqlStageExecution)7 StageId (io.prestosql.execution.StageId)7 PlanFragment (io.prestosql.sql.planner.PlanFragment)7 TestingSplit (io.prestosql.testing.TestingSplit)7 UUID (java.util.UUID)7 NodeTaskMap (io.prestosql.execution.NodeTaskMap)6 TableInfo (io.prestosql.execution.TableInfo)6