CompletableFuture<Void> runOnce() {
        CompletableFuture<Void> result;
        synchronized (this.singleRunLock) {
            if (this.currentIteration != null) {
                // Some other iteration is in progress. Piggyback on that one and return when it is done.
                return this.currentIteration;
            } else {
                // No other iteration is running.
                this.currentIteration = new CompletableFuture<>();
                this.currentIteration.whenComplete((r, ex) -> {
                    // Unregister the current iteration when done.
                    synchronized (this.singleRunLock) {
                        this.currentIteration = null;
                    }
                });
                result = this.currentIteration;
            }
        }

        Futures.completeAfter(this::runOnceInternal, result);
        return result;
    }
CompletableFuture < Void > runOnce ( ) { CompletableFuture < Void > result ; synchronized ( this . singleRunLock ) { if ( this . currentIteration != null ) { return this . currentIteration ; } else { this . currentIteration = new CompletableFuture < > ( ) ; this . currentIteration . whenComplete ( ( r , ex ) -> { synchronized ( this . singleRunLock ) { this . currentIteration = null ; } } ) ; result = this . currentIteration ; } } Futures . completeAfter ( this :: runOnceInternal , result ) ; return result ; }
Executes one iteration of the MetadataCleaner. This ensures that there cannot be more than one concurrent executions of
such an iteration (whether it's from this direct call or from the regular MetadataCleaner invocation). If concurrent
invocations are made, then subsequent calls will be tied to the execution of the first, and will all complete at
the same time (even though there's only one executing).

@return A CompletableFuture that, when completed, indicates that the operation completed (successfully or not).