Source:
public LookupJoinOperatorFactory(int operatorId, PlanNodeId planNodeId, LookupSourceFactory lookupSourceFactory, List<Type> probeTypes, List<Type> probeOutputTypes, JoinType joinType, JoinProbeFactory joinProbeFactory) { this.operatorId = operatorId; this.planNodeId = requireNonNull(planNodeId, "planNodeId is null"); this.lookupSourceFactory = requireNonNull(lookupSourceFactory, "lookupSourceFactory is null"); this.probeTypes = ImmutableList.copyOf(requireNonNull(probeTypes, "probeTypes is null")); this.probeOutputTypes = ImmutableList.copyOf(requireNonNull(probeOutputTypes, "probeOutputTypes is null")); this.buildTypes = ImmutableList.copyOf(lookupSourceFactory.getTypes()); this.buildOutputTypes = ImmutableList.copyOf(lookupSourceFactory.getOutputTypes()); this.joinType = requireNonNull(joinType, "joinType is null"); this.joinProbeFactory = requireNonNull(joinProbeFactory, "joinProbeFactory is null"); probeReferenceCount = new ReferenceCount(); lookupSourceFactoryUsersCount = new ReferenceCount(); lookupSourceFactoryUsersCount.getFreeFuture().addListener(lookupSourceFactory::destroy, directExecutor()); probeReferenceCount.getFreeFuture().addListener(lookupSourceFactoryUsersCount::release, directExecutor()); if (joinType == INNER || joinType == PROBE_OUTER) { this.outerOperatorFactory = Optional.empty(); } else { ListenableFuture<LookupSource> lookupSourceAfterProbeFinished = transformAsync(probeReferenceCount.getFreeFuture(), ignored -> lookupSourceFactory.createLookupSource()); ListenableFuture<OuterPositionIterator> outerPositionsFuture = transform(lookupSourceAfterProbeFinished, lookupSource -> { try (LookupSource close = lookupSource) { return lookupSource.getOuterPositionIterator(); } }); lookupSourceFactoryUsersCount.retain(); this.outerOperatorFactory = Optional.of(new LookupOuterOperatorFactory(operatorId, planNodeId, outerPositionsFuture, probeOutputTypes, buildOutputTypes, lookupSourceFactoryUsersCount)); } }

Target:
public LookupJoinOperatorFactory(int operatorId, PlanNodeId planNodeId, LookupSourceFactory lookupSourceFactory, List<Type> probeTypes, List<Type> probeOutputTypes, JoinType joinType, JoinProbeFactory joinProbeFactory) { this.operatorId = operatorId; this.planNodeId = requireNonNull(planNodeId, "planNodeId is null"); this.lookupSourceFactory = requireNonNull(lookupSourceFactory, "lookupSourceFactory is null"); this.probeTypes = ImmutableList.copyOf(requireNonNull(probeTypes, "probeTypes is null")); this.probeOutputTypes = ImmutableList.copyOf(requireNonNull(probeOutputTypes, "probeOutputTypes is null")); this.buildTypes = ImmutableList.copyOf(lookupSourceFactory.getTypes()); this.buildOutputTypes = ImmutableList.copyOf(lookupSourceFactory.getOutputTypes()); this.joinType = requireNonNull(joinType, "joinType is null"); this.joinProbeFactory = requireNonNull(joinProbeFactory, "joinProbeFactory is null"); probeReferenceCount = new ReferenceCount(); lookupSourceFactoryUsersCount = new ReferenceCount(); lookupSourceFactoryUsersCount.getFreeFuture().addListener(lookupSourceFactory::destroy, directExecutor()); probeReferenceCount.getFreeFuture().addListener(lookupSourceFactoryUsersCount::release, directExecutor()); if (joinType == INNER || joinType == PROBE_OUTER) { this.outerOperatorFactory = Optional.empty(); } else { ListenableFuture<LookupSource> lookupSourceAfterProbeFinished = transformAsync(probeReferenceCount.getFreeFuture(), ignored -> lookupSourceFactory.createLookupSource()); ListenableFuture<OuterPositionIterator> outerPositionsFuture = transform(lookupSourceAfterProbeFinished, lookupSource -> { try (LookupSource ignore = lookupSource) { return lookupSource.getOuterPositionIterator(); } }); lookupSourceFactoryUsersCount.retain(); this.outerOperatorFactory = Optional.of(new LookupOuterOperatorFactory(operatorId, planNodeId, outerPositionsFuture, probeOutputTypes, buildOutputTypes, lookupSourceFactoryUsersCount)); } }