aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools
diff options
context:
space:
mode:
authorGravatar Janak Ramakrishnan <janakr@google.com>2016-11-16 19:35:48 +0000
committerGravatar Kristina Chodorow <kchodorow@google.com>2016-11-17 18:18:00 +0000
commit18d0a5dcd0d349669fd0b44c7d36e32c19230278 (patch)
treebc76629a2242a4e30300455ba1a8c4d1c3286543 /src/main/java/com/google/devtools
parenta3c053bf957587e09b22db6f3547934bcbdb574d (diff)
Re-use the precomputed universe key in WalkableGraphFactory#prepareAndGet.
-- MOS_MIGRATED_REVID=139357569
Diffstat (limited to 'src/main/java/com/google/devtools')
-rw-r--r--src/main/java/com/google/devtools/build/lib/query2/SkyQueryEnvironment.java4
-rw-r--r--src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java13
-rw-r--r--src/main/java/com/google/devtools/build/skyframe/WalkableGraph.java4
3 files changed, 9 insertions, 12 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 9e33d50bf6..1ed21a08c7 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
@@ -205,9 +205,7 @@ public class SkyQueryEnvironment extends AbstractBlazeQueryEnvironment<Target>
private void beforeEvaluateQuery() throws InterruptedException {
EvaluationResult<SkyValue> result;
try (AutoProfiler p = AutoProfiler.logged("evaluation and walkable graph", LOG)) {
- result =
- graphFactory.prepareAndGet(
- universeScope, parserPrefix, loadingPhaseThreads, eventHandler);
+ result = graphFactory.prepareAndGet(universeKey, loadingPhaseThreads, eventHandler);
}
checkEvaluationResult(result);
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java
index 96b84a86a2..2c38f6d924 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java
@@ -1530,20 +1530,19 @@ public abstract class SkyframeExecutor implements WalkableGraphFactory {
}
/**
- * For internal use in queries: performs a graph update to make sure the transitive closure of
- * the specified target {@code patterns} is present in the graph, and returns the {@link
+ * For internal use in queries: performs a graph update to make sure the transitive closure of the
+ * specified {@code universeKey} is present in the graph, and returns the {@link
* EvaluationResult}.
*
* <p>The graph update is unconditionally done in keep-going mode, so that the query is guaranteed
* a complete graph to work on.
*/
@Override
- public EvaluationResult<SkyValue> prepareAndGet(Collection<String> patterns, String offset,
- int numThreads, EventHandler eventHandler) throws InterruptedException {
- SkyKey skyKey = getUniverseKey(patterns, offset);
+ public EvaluationResult<SkyValue> prepareAndGet(
+ SkyKey universeKey, int numThreads, EventHandler eventHandler) throws InterruptedException {
EvaluationResult<SkyValue> evaluationResult =
- buildDriver.evaluate(ImmutableList.of(skyKey), true, numThreads, eventHandler);
- Preconditions.checkNotNull(evaluationResult.getWalkableGraph(), patterns);
+ buildDriver.evaluate(ImmutableList.of(universeKey), true, numThreads, eventHandler);
+ Preconditions.checkNotNull(evaluationResult.getWalkableGraph(), universeKey);
return evaluationResult;
}
diff --git a/src/main/java/com/google/devtools/build/skyframe/WalkableGraph.java b/src/main/java/com/google/devtools/build/skyframe/WalkableGraph.java
index 240ea7c0a8..50de277be9 100644
--- a/src/main/java/com/google/devtools/build/skyframe/WalkableGraph.java
+++ b/src/main/java/com/google/devtools/build/skyframe/WalkableGraph.java
@@ -92,8 +92,8 @@ public interface WalkableGraph {
/** Provides a WalkableGraph on demand after preparing it. */
interface WalkableGraphFactory {
- EvaluationResult<SkyValue> prepareAndGet(Collection<String> roots, String offset,
- int numThreads, EventHandler eventHandler) throws InterruptedException;
+ EvaluationResult<SkyValue> prepareAndGet(
+ SkyKey universeKey, int numThreads, EventHandler eventHandler) throws InterruptedException;
/** Returns the {@link SkyKey} that defines this universe. */
SkyKey getUniverseKey(Collection<String> roots, String offset);