aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/skyframe/WalkableGraphUtils.java
diff options
context:
space:
mode:
authorGravatar Janak Ramakrishnan <janakr@google.com>2016-12-29 21:49:56 +0000
committerGravatar John Cater <jcater@google.com>2017-01-03 15:03:05 +0000
commit112840b4d6fafd04e2381a2e52fbad848a818ea6 (patch)
treef82825c5b02480612178f8238812590925c67909 /src/test/java/com/google/devtools/build/skyframe/WalkableGraphUtils.java
parentc31f351a191d6927a6483384826297e5549cf426 (diff)
Remove WalkableGraph#exists and allow WalkableGraph#getValue and WalkableGraph#getException to be given non-existent keys without crashing. Add WalkableGraph#isCycle to fill the gap in testing for the difference between non-existence and depending on a cycle.
-- PiperOrigin-RevId: 143205289 MOS_MIGRATED_REVID=143205289
Diffstat (limited to 'src/test/java/com/google/devtools/build/skyframe/WalkableGraphUtils.java')
-rw-r--r--src/test/java/com/google/devtools/build/skyframe/WalkableGraphUtils.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/test/java/com/google/devtools/build/skyframe/WalkableGraphUtils.java b/src/test/java/com/google/devtools/build/skyframe/WalkableGraphUtils.java
index 7095371508..05d11bf274 100644
--- a/src/test/java/com/google/devtools/build/skyframe/WalkableGraphUtils.java
+++ b/src/test/java/com/google/devtools/build/skyframe/WalkableGraphUtils.java
@@ -16,7 +16,7 @@ package com.google.devtools.build.skyframe;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Iterables;
-/** Utility methods for querying (r)deps of nodes from {@link WalkableGraph}s more concisely. */
+/** Utility methods for querying {@link WalkableGraph}s more concisely. */
public class WalkableGraphUtils {
public static Iterable<SkyKey> getDirectDeps(WalkableGraph graph, SkyKey key)
@@ -28,4 +28,8 @@ public class WalkableGraphUtils {
throws InterruptedException {
return Iterables.getOnlyElement(graph.getReverseDeps(ImmutableList.of(key)).values());
}
+
+ public static boolean exists(SkyKey key, WalkableGraph graph) throws InterruptedException {
+ return graph.getValue(key) != null || graph.getException(key) != null || graph.isCycle(key);
+ }
}