private NodeEntry getEntryForValue(SkyKey key) { NodeEntry entry = Preconditions.checkNotNull( graph.getBatch(null, Reason.WALKABLE_GRAPH_VALUE, ImmutableList.of(key)).get(key), key); Preconditions.checkState(entry.isDone(), "%s %s", key, entry); return entry; }
@Override public Map<SkyKey, Exception> getMissingAndExceptions(Iterable<SkyKey> keys) { Map<SkyKey, Exception> result = new HashMap<>(); Map<SkyKey, NodeEntry> graphResult = graph.getBatch(null, Reason.WALKABLE_GRAPH_VALUE, keys); for (SkyKey key : keys) { NodeEntry nodeEntry = graphResult.get(key); if (nodeEntry == null || !nodeEntry.isDone()) { result.put(key, null); } else { ErrorInfo errorInfo = nodeEntry.getErrorInfo(); if (errorInfo != null) { result.put(key, errorInfo.getException()); } } } return result; }
@Nullable @Override public SkyValue apply(NodeEntry entry) { return entry.isDone() ? entry.getValue() : null; }
@Override public boolean exists(SkyKey key) { NodeEntry entry = graph.getBatch(null, Reason.EXISTENCE_CHECKING, ImmutableList.of(key)).get(key); return entry != null && entry.isDone(); }