diff options
author | Nathan Harmata <nharmata@google.com> | 2017-02-27 21:55:56 +0000 |
---|---|---|
committer | Yue Gan <yueg@google.com> | 2017-02-28 11:33:08 +0000 |
commit | 822c37816ac669e51bec3853b41849a19ec5e230 (patch) | |
tree | a12e1f438342aa9ec1846089fc255bf2abb18ad3 /src/main/java/com/google/devtools/build/lib/skyframe/PrepareDepsOfPatternFunction.java | |
parent | fb64609c3f1d3492f4d80807f5d91894fa147172 (diff) |
Reimplement blaze query using an async evaluation model. Use a concurrent backend for SkyQueryEnvironment's implementation in order to achieve parallelism.
Advantages:
-New design has no flaws that the old design had.
-Code is structured so that deadlocks due to thread starvation are impossible (yup!).
Disadvantages:
-The meat of this change needs to all be in a single CL because every single QueryFunction and QueryExpression needs to be rewritten in the async style.
Still TODO:
-Fully embrace the async model in all QueryFunctions (e.g. 'rdeps', 'allpaths').
-Use concurrency in BlazeQueryEnvironment to achieve parallel evaluation for (non SkyQuery) 'blaze query' and genquery.
--
PiperOrigin-RevId: 148690279
MOS_MIGRATED_REVID=148690279
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/PrepareDepsOfPatternFunction.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/skyframe/PrepareDepsOfPatternFunction.java | 28 |
1 files changed, 3 insertions, 25 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/PrepareDepsOfPatternFunction.java b/src/main/java/com/google/devtools/build/lib/skyframe/PrepareDepsOfPatternFunction.java index df6351a513..3b4b768793 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/PrepareDepsOfPatternFunction.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/PrepareDepsOfPatternFunction.java @@ -37,7 +37,6 @@ import com.google.devtools.build.lib.skyframe.EnvironmentBackedRecursivePackageP import com.google.devtools.build.lib.util.BatchCallback; import com.google.devtools.build.lib.util.BatchCallback.NullCallback; import com.google.devtools.build.lib.util.Preconditions; -import com.google.devtools.build.lib.util.ThreadSafeBatchCallback; import com.google.devtools.build.lib.vfs.Path; import com.google.devtools.build.lib.vfs.PathFragment; import com.google.devtools.build.lib.vfs.RootedPath; @@ -47,7 +46,6 @@ import com.google.devtools.build.skyframe.SkyKey; import com.google.devtools.build.skyframe.SkyValue; import java.util.ArrayList; import java.util.List; -import java.util.concurrent.ForkJoinPool; import java.util.concurrent.atomic.AtomicReference; import javax.annotation.Nullable; @@ -131,7 +129,7 @@ public class PrepareDepsOfPatternFunction implements SkyFunction { * transitive dependencies. Its methods may throw {@link MissingDepException} if the package * values this depends on haven't been calculated and added to its environment. */ - static class DepsOfPatternPreparer implements TargetPatternResolver<Void> { + static class DepsOfPatternPreparer extends TargetPatternResolver<Void> { private final EnvironmentBackedRecursivePackageProvider packageProvider; private final Environment env; @@ -230,7 +228,8 @@ public class PrepareDepsOfPatternFunction implements SkyFunction { String directory, boolean rulesOnly, ImmutableSet<PathFragment> excludedSubdirectories, - BatchCallback<Void, E> callback, Class<E> exceptionClass) + BatchCallback<Void, E> callback, + Class<E> exceptionClass) throws TargetParsingException, E, InterruptedException { FilteringPolicy policy = rulesOnly ? FilteringPolicies.RULES_ONLY : FilteringPolicies.NO_FILTER; @@ -261,26 +260,5 @@ public class PrepareDepsOfPatternFunction implements SkyFunction { } } } - - @Override - public <E extends Exception> void findTargetsBeneathDirectoryPar( - RepositoryName repository, - String originalPattern, - String directory, - boolean rulesOnly, - ImmutableSet<PathFragment> excludedSubdirectories, - ThreadSafeBatchCallback<Void, E> callback, - Class<E> exceptionClass, - ForkJoinPool forkJoinPool) - throws TargetParsingException, E, InterruptedException { - findTargetsBeneathDirectory( - repository, - originalPattern, - directory, - rulesOnly, - excludedSubdirectories, - callback, - exceptionClass); - } } } |