public boolean isNoMoreDriverRunner() { return status.isNoMoreDriverRunners(pipelineContext.getPipelineId()); }
public void noMoreDriverRunner(Iterable<Lifespan> lifespans) { for (Lifespan lifespan : lifespans) { status.setNoMoreDriverRunner(pipelineContext.getPipelineId(), lifespan); } closeDriverFactoryIfFullyCreated(); }
public void closeDriverFactoryIfFullyCreated() { if (closed) { return; } for (Lifespan lifespan : status.getAndAcknowledgeLifespansWithNoMoreDrivers(pipelineContext.getPipelineId())) { driverFactory.noMoreDrivers(lifespan); } if (!isNoMoreDriverRunner() || status.getPendingCreation(pipelineContext.getPipelineId()) != 0) { return; } driverFactory.noMoreDrivers(); closed = true; }
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 Driver createDriver(DriverContext driverContext, @Nullable ScheduledSplit partitionedSplit) { Driver driver = driverFactory.createDriver(driverContext); // record driver so other threads add unpartitioned sources can see the driver // NOTE: this MUST be done before reading unpartitionedSources, so we see a consistent view of the unpartitioned sources drivers.add(new WeakReference<>(driver)); if (partitionedSplit != null) { // TableScanOperator requires partitioned split to be added before the first call to process driver.updateSource(new TaskSource(partitionedSplit.getPlanNodeId(), ImmutableSet.of(partitionedSplit), true)); } // add unpartitioned sources Optional<PlanNodeId> sourceId = driver.getSourceId(); if (sourceId.isPresent()) { TaskSource taskSource = unpartitionedSources.get(sourceId.get()); if (taskSource != null) { driver.updateSource(taskSource); } } status.decrementPendingCreation(pipelineContext.getPipelineId(), driverContext.getLifespan()); closeDriverFactoryIfFullyCreated(); return driver; }
expectedPositions, pagesIndexFactory); this.driverFactory = indexBuildDriverFactoryProvider.createSnapshot(pipelineContext.getPipelineId(), this.indexSnapshotBuilder);
driverContext.getPipelineContext().getPipelineId(), operatorId, planNodeId,