public class JavaExecutorBackedDefaultDepsAwareExecutor<T> extends Object implements DepsAwareExecutor<T,com.facebook.buck.core.graph.transformation.executor.impl.DefaultDepsAwareTask<T>>
DepsAwareTask
. This executor will attempt to
maintain maximum concurrency, while completing dependencies of each supplied work first.
This implementation submits all tasks to java's default executors in a queue, without attempting insert dependent work in the front of the queue, but rather continuously requeue-ing them until an executable work is found. This is how Bazel's skyframe works.
Modifier and Type | Method and Description |
---|---|
void |
close()
Shuts down the executor workers immediately.
|
com.facebook.buck.core.graph.transformation.executor.impl.DefaultDepsAwareTask<T> |
createTask(Callable<T> callable) |
com.facebook.buck.core.graph.transformation.executor.impl.DefaultDepsAwareTask<T> |
createThrowingTask(Callable<T> callable,
ThrowingSupplier<com.google.common.collect.ImmutableSet<com.facebook.buck.core.graph.transformation.executor.impl.DefaultDepsAwareTask<T>>,Exception> prereqSupplier,
ThrowingSupplier<com.google.common.collect.ImmutableSet<com.facebook.buck.core.graph.transformation.executor.impl.DefaultDepsAwareTask<T>>,Exception> depsSupplier) |
boolean |
isShutdown() |
static <U> JavaExecutorBackedDefaultDepsAwareExecutor<U> |
of(int numberOfThreads)
Creates a
JavaExecutorBackedDefaultDepsAwareExecutor with given numberOfThreads . |
Future<T> |
submit(com.facebook.buck.core.graph.transformation.executor.impl.DefaultDepsAwareTask<T> task) |
com.google.common.collect.ImmutableList<Future<T>> |
submitAll(Collection<com.facebook.buck.core.graph.transformation.executor.impl.DefaultDepsAwareTask<T>> tasks)
Same as
DepsAwareExecutor.submit(DepsAwareTask) except for multiple tasks. |
public static <U> JavaExecutorBackedDefaultDepsAwareExecutor<U> of(int numberOfThreads)
JavaExecutorBackedDefaultDepsAwareExecutor
with given numberOfThreads
.public void close()
DepsAwareExecutor
DepsAwareExecutor
close
in interface DepsAwareExecutor<T,com.facebook.buck.core.graph.transformation.executor.impl.DefaultDepsAwareTask<T>>
close
in interface AutoCloseable
public boolean isShutdown()
isShutdown
in interface DepsAwareExecutor<T,com.facebook.buck.core.graph.transformation.executor.impl.DefaultDepsAwareTask<T>>
DepsAwareExecutor.close()
has been calledpublic com.facebook.buck.core.graph.transformation.executor.impl.DefaultDepsAwareTask<T> createThrowingTask(Callable<T> callable, ThrowingSupplier<com.google.common.collect.ImmutableSet<com.facebook.buck.core.graph.transformation.executor.impl.DefaultDepsAwareTask<T>>,Exception> prereqSupplier, ThrowingSupplier<com.google.common.collect.ImmutableSet<com.facebook.buck.core.graph.transformation.executor.impl.DefaultDepsAwareTask<T>>,Exception> depsSupplier)
createThrowingTask
in interface DepsAwareExecutor<T,com.facebook.buck.core.graph.transformation.executor.impl.DefaultDepsAwareTask<T>>
DepsAwareTask
with two stages of dependency computationpublic com.facebook.buck.core.graph.transformation.executor.impl.DefaultDepsAwareTask<T> createTask(Callable<T> callable)
createTask
in interface DepsAwareExecutor<T,com.facebook.buck.core.graph.transformation.executor.impl.DefaultDepsAwareTask<T>>
DepsAwareTask
that can be executed in this executorpublic Future<T> submit(com.facebook.buck.core.graph.transformation.executor.impl.DefaultDepsAwareTask<T> task)
submit
in interface DepsAwareExecutor<T,com.facebook.buck.core.graph.transformation.executor.impl.DefaultDepsAwareTask<T>>
task
- the DepsAwareTask
to runpublic com.google.common.collect.ImmutableList<Future<T>> submitAll(Collection<com.facebook.buck.core.graph.transformation.executor.impl.DefaultDepsAwareTask<T>> tasks)
DepsAwareExecutor
DepsAwareExecutor.submit(DepsAwareTask)
except for multiple tasks.submitAll
in interface DepsAwareExecutor<T,com.facebook.buck.core.graph.transformation.executor.impl.DefaultDepsAwareTask<T>>