aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/skyframe/WalkableGraph.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/google/devtools/build/skyframe/WalkableGraph.java')
-rw-r--r--src/main/java/com/google/devtools/build/skyframe/WalkableGraph.java25
1 files changed, 14 insertions, 11 deletions
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 7c7a7e8954..9f71f1fdb1 100644
--- a/src/main/java/com/google/devtools/build/skyframe/WalkableGraph.java
+++ b/src/main/java/com/google/devtools/build/skyframe/WalkableGraph.java
@@ -15,15 +15,17 @@ package com.google.devtools.build.skyframe;
import com.google.devtools.build.lib.concurrent.ThreadSafety.ThreadSafe;
import com.google.devtools.build.lib.events.EventHandler;
-
import java.util.Collection;
import java.util.Map;
-
import javax.annotation.Nullable;
/**
* Read-only graph that exposes the dependents, dependencies (reverse dependents), and value and
* exception (if any) of a given node.
+ *
+ * <p>Certain graph implementations can throw {@link InterruptedException} when trying to retrieve
+ * node entries. Such exceptions should not be caught locally -- they should be allowed to propagate
+ * up.
*/
@ThreadSafe
public interface WalkableGraph {
@@ -33,21 +35,21 @@ public interface WalkableGraph {
* given node does not exist, this method should be called before any others, since the others
* throw a {@link RuntimeException} on failure to access a node.
*/
- boolean exists(SkyKey key);
+ boolean exists(SkyKey key) throws InterruptedException;
/**
* Returns the value of the given key, or {@code null} if it has no value due to an error during
* its computation. A node with this key must exist in the graph.
*/
@Nullable
- SkyValue getValue(SkyKey key);
+ SkyValue getValue(SkyKey key) throws InterruptedException;
/**
* Returns a map giving the values of the given keys for done keys that were successfully
- * computed. Or in other words, it filters out non-existent nodes, pending nodes and nodes
- * that produced an exception.
+ * computed. Or in other words, it filters out non-existent nodes, pending nodes and nodes that
+ * produced an exception.
*/
- Map<SkyKey, SkyValue> getSuccessfulValues(Iterable<SkyKey> keys);
+ Map<SkyKey, SkyValue> getSuccessfulValues(Iterable<SkyKey> keys) throws InterruptedException;
/**
* Returns a map giving exceptions associated to the given keys for done keys. Keys not present in
@@ -56,26 +58,27 @@ public interface WalkableGraph {
* for {@code key} if and only if the node for {@code key} did <i>not</i> evaluate successfully
* without error.
*/
- Map<SkyKey, Exception> getMissingAndExceptions(Iterable<SkyKey> keys);
+ Map<SkyKey, Exception> getMissingAndExceptions(Iterable<SkyKey> keys) throws InterruptedException;
/**
* Returns the exception thrown when computing the node with the given key, if any. If the node
* was computed successfully, returns null. A node with this key must exist and be done in the
* graph.
*/
- @Nullable Exception getException(SkyKey key);
+ @Nullable
+ Exception getException(SkyKey key) throws InterruptedException;
/**
* Returns a map giving the direct dependencies of the nodes with the given keys. A node for each
* given key must exist and be done in the graph.
*/
- Map<SkyKey, Iterable<SkyKey>> getDirectDeps(Iterable<SkyKey> keys);
+ Map<SkyKey, Iterable<SkyKey>> getDirectDeps(Iterable<SkyKey> keys) throws InterruptedException;
/**
* Returns a map giving the reverse dependencies of the nodes with the given keys. A node for each
* given key must exist and be done in the graph.
*/
- Map<SkyKey, Iterable<SkyKey>> getReverseDeps(Iterable<SkyKey> keys);
+ Map<SkyKey, Iterable<SkyKey>> getReverseDeps(Iterable<SkyKey> keys) throws InterruptedException;
/** Provides a WalkableGraph on demand after preparing it. */
interface WalkableGraphFactory {