public DriverContext addDriverContext() { return addDriverContext(Lifespan.taskWide()); }
public PipelineContext addPipelineContext(int pipelineId, boolean inputPipeline, boolean outputPipeline, boolean partitioned) { PipelineContext pipelineContext = new PipelineContext( pipelineId, this, notificationExecutor, yieldExecutor, taskMemoryContext.newMemoryTrackingContext(), inputPipeline, outputPipeline, partitioned); pipelineContexts.add(pipelineContext); return pipelineContext; }
public void finished() { if (!finished.compareAndSet(false, true)) { // already finished return; } executionEndTime.set(DateTime.now()); endNanos.set(System.nanoTime()); pipelineContext.driverFinished(this); }
public CounterStat getInputDataSize() { CounterStat stat = new CounterStat(); for (PipelineContext pipelineContext : pipelineContexts) { if (pipelineContext.isInputPipeline()) { stat.merge(pipelineContext.getInputDataSize()); } } return stat; }
public CounterStat getInputPositions() { CounterStat stat = new CounterStat(); for (PipelineContext pipelineContext : pipelineContexts) { if (pipelineContext.isInputPipeline()) { stat.merge(pipelineContext.getInputPositions()); } } return stat; }
public DriverSplitRunner createDriverRunner(@Nullable ScheduledSplit partitionedSplit, Lifespan lifespan) { checkLifespan(driverFactory.getPipelineExecutionStrategy(), lifespan); status.incrementPendingCreation(pipelineContext.getPipelineId(), lifespan); // create driver context immediately so the driver existence is recorded in the stats // the number of drivers is used to balance work across nodes DriverContext driverContext = pipelineContext.addDriverContext(lifespan); return new DriverSplitRunner(this, driverContext, partitionedSplit, lifespan); }
public boolean load(List<UpdateRequest> requests) UnloadedIndexKeyRecordSet recordSetForLookupSource = new UnloadedIndexKeyRecordSet(pipelineContext.getSession(), indexSnapshotReference.get(), lookupSourceInputChannels, indexTypes, requests, joinCompiler); try (Driver driver = driverFactory.createDriver(pipelineContext.addDriverContext())) { PlanNodeId sourcePlanNodeId = driverFactory.getSourceId().get(); ScheduledSplit split = new ScheduledSplit(0, sourcePlanNodeId, new Split(INDEX_CONNECTOR_ID, new ConnectorTransactionHandle() {}, new IndexSplit(recordSetForLookupSource))); : new UnloadedIndexKeyRecordSet(pipelineContext.getSession(), indexSnapshotReference.get(), allInputChannels, indexTypes, requests, joinCompiler);
public void failed(Throwable cause) { pipelineContext.failed(cause); finished.set(true); }
while (!compareAndSet(operatorSummaries, operator.getOperatorId(), current, updated));
keyOutputChannels, keyOutputHashChannel, pipelineContext.addDriverContext(), maxIndexMemorySize, expectedPositions, pagesIndexFactory); this.driverFactory = indexBuildDriverFactoryProvider.createSnapshot(pipelineContext.getPipelineId(), this.indexSnapshotBuilder);
public CounterStat getInputDataSize() { CounterStat stat = new CounterStat(); for (PipelineContext pipelineContext : pipelineContexts) { if (pipelineContext.isInputPipeline()) { stat.merge(pipelineContext.getInputDataSize()); } } return stat; }
public CounterStat getInputPositions() { CounterStat stat = new CounterStat(); for (PipelineContext pipelineContext : pipelineContexts) { if (pipelineContext.isInputPipeline()) { stat.merge(pipelineContext.getInputPositions()); } } return stat; }
public void failed(Throwable cause) { pipelineContext.failed(cause); finished.set(true); }
while (!compareAndSet(operatorSummaries, operator.getOperatorId(), current, updated));
@Override protected List<Driver> createDrivers(TaskContext taskContext) { DriverFactory driverFactory = createDriverFactory(); DriverContext driverContext = taskContext.addPipelineContext(0, true, true, false).addDriverContext(); Driver driver = driverFactory.createDriver(driverContext); return ImmutableList.of(driver); } }
public static OperatorContext create(ScheduledExecutorService scheduledExecutor) { Executor executor = MoreExecutors.directExecutor(); TaskContext taskContext = TestingTaskContext.createTaskContext( executor, scheduledExecutor, TestingSession.testSessionBuilder().build()); MemoryTrackingContext pipelineMemoryContext = new MemoryTrackingContext(newSimpleAggregatedMemoryContext(), newSimpleAggregatedMemoryContext(), newSimpleAggregatedMemoryContext()); PipelineContext pipelineContext = new PipelineContext( 1, taskContext, executor, scheduledExecutor, pipelineMemoryContext, false, false, false); DriverContext driverContext = new DriverContext( pipelineContext, executor, scheduledExecutor, pipelineMemoryContext, Lifespan.taskWide()); OperatorContext operatorContext = driverContext.addOperatorContext( 1, new PlanNodeId("test"), "operator type"); return operatorContext; }
public void finished() { if (!finished.compareAndSet(false, true)) { // already finished return; } executionEndTime.set(DateTime.now()); endNanos.set(System.nanoTime()); freeMemory(memoryReservation.get()); pipelineContext.driverFinished(this); }
private static DriverContext createDriverContext(Session session) { return createTaskContext(EXECUTOR, SCHEDULED_EXECUTOR, session) .addPipelineContext(0, true, true, false) .addDriverContext(); }
public PipelineContext addPipelineContext(boolean inputPipeline, boolean outputPipeline) { PipelineContext pipelineContext = new PipelineContext(this, executor, inputPipeline, outputPipeline); pipelineContexts.add(pipelineContext); return pipelineContext; }
private DriverContext newDriverContext() { return createTaskContext(executor, scheduledExecutor, TEST_SESSION) .addPipelineContext(0, true, true, false) .addDriverContext(); }