presto-main/src/main/java/io/prestosql/execution/FutureStateChange.java/FutureStateChange/fireStateChange
class FutureStateChange:    private void fireStateChange(T newState, Executor executor)
    {
        requireNonNull(executor, "executor is null");
        Set<SettableFuture<T>> futures;
        synchronized (listeners) {
            futures = ImmutableSet.copyOf(listeners);
            listeners.clear();
        }

        for (SettableFuture<T> future : futures) {
            executor.execute(() -> future.set(newState));
        }
    }