public Driver createDriver(DriverContext driverContext, @Nullable ScheduledSplit partitionedSplit)
{
Driver driver = driverFactory.createDriver(driverContext);
drivers.add(new WeakReference<>(driver));
if (partitionedSplit != null) {
driver.updateSource(new TaskSource(partitionedSplit.getPlanNodeId(), ImmutableSet.of(partitionedSplit), true));
}
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;
}