Add method getCurrentlyAvailableNodes to QueryableGraph and Walkable Graph
It allows all graph implementations to return the list of nodes which are
immediately available to be fetched. NOTE: Not-currently-available here does
not mean the nodes do not exist in the graph. It simply means they are not
ready to be fetched immediately yet.
--
MOS_MIGRATED_REVID=137701432
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 9f71f1f..240ea7c 100644
--- a/src/main/java/com/google/devtools/build/skyframe/WalkableGraph.java
+++ b/src/main/java/com/google/devtools/build/skyframe/WalkableGraph.java
@@ -15,6 +15,7 @@
import com.google.devtools.build.lib.concurrent.ThreadSafety.ThreadSafe;
import com.google.devtools.build.lib.events.EventHandler;
+import com.google.devtools.build.skyframe.QueryableGraph.Reason;
import java.util.Collection;
import java.util.Map;
import javax.annotation.Nullable;
@@ -80,6 +81,15 @@
*/
Map<SkyKey, Iterable<SkyKey>> getReverseDeps(Iterable<SkyKey> keys) throws InterruptedException;
+ /**
+ * Examines all the given keys. Returns an iterable of keys whose corresponding nodes are
+ * currently available to be fetched.
+ *
+ * <p>Note: An unavailable node does not mean it is not in the graph. It only means it's not ready
+ * to be fetched immediately.
+ */
+ Iterable<SkyKey> getCurrentlyAvailableNodes(Iterable<SkyKey> keys, Reason reason);
+
/** Provides a WalkableGraph on demand after preparing it. */
interface WalkableGraphFactory {
EvaluationResult<SkyValue> prepareAndGet(Collection<String> roots, String offset,