diff options
author | 2017-12-21 08:10:15 -0800 | |
---|---|---|
committer | 2017-12-21 08:12:45 -0800 | |
commit | 57f228ab6fc8c871648e2f48bf97824566985f29 (patch) | |
tree | ff841e5f40a62e6e887204569c4885788d17d11f /src/main/java/com/google/devtools/build/lib/query2 | |
parent | 2384b98ac6e193bac30454f39e8949739e441982 (diff) |
Refactor WalkableGraph and BuildDriver interfaces
Remove WalkableGraph#isUpToDate and BuildDriver#alreadyEvaluated and delegate the
work to implementation.
RELNOTES: None
PiperOrigin-RevId: 179815374
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/query2')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/query2/SkyQueryEnvironment.java | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/query2/SkyQueryEnvironment.java b/src/main/java/com/google/devtools/build/lib/query2/SkyQueryEnvironment.java index f3bdc78760..883047e1a6 100644 --- a/src/main/java/com/google/devtools/build/lib/query2/SkyQueryEnvironment.java +++ b/src/main/java/com/google/devtools/build/lib/query2/SkyQueryEnvironment.java @@ -248,24 +248,21 @@ public class SkyQueryEnvironment extends AbstractBlazeQueryEnvironment<Target> private void beforeEvaluateQuery(QueryExpression expr) throws QueryException, InterruptedException { Set<SkyKey> roots = getGraphRootsFromExpression(expr); - if (graph == null || !graphFactory.isUpToDate(roots)) { - // If this environment is uninitialized or the graph factory needs to evaluate, do so. We - // assume here that this environment cannot be initialized-but-stale if the factory is up - // to date. - EvaluationResult<SkyValue> result; - try (AutoProfiler p = AutoProfiler.logged("evaluation and walkable graph", logger)) { - result = graphFactory.prepareAndGet(roots, loadingPhaseThreads, universeEvalEventHandler); - } - checkEvaluationResult(roots, result); + EvaluationResult<SkyValue> result; + try (AutoProfiler p = AutoProfiler.logged("evaluation and walkable graph", logger)) { + result = graphFactory.prepareAndGet(roots, loadingPhaseThreads, universeEvalEventHandler); + } + if (graph == null || graph != result.getWalkableGraph()) { + checkEvaluationResult(roots, result); packageSemaphore = makeFreshPackageMultisetSemaphore(); graph = result.getWalkableGraph(); blacklistPatternsSupplier = InterruptibleSupplier.Memoize.of(new BlacklistSupplier(graph)); - graphBackedRecursivePackageProvider = new GraphBackedRecursivePackageProvider(graph, universeTargetPatternKeys, pkgPath); } + if (executor == null) { executor = MoreExecutors.listeningDecorator( new ThreadPoolExecutor( |