aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/skyframe
diff options
context:
space:
mode:
authorGravatar janakr <janakr@google.com>2018-06-04 15:56:35 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-06-04 15:57:44 -0700
commit745232b1428062e506e6d548d6a3cc03721a3ea7 (patch)
tree91078d4d01a0e6034dc8ee5608dfd5bc3151d958 /src/main/java/com/google/devtools/build/skyframe
parent95010e41d44161244fbd30bc729c3e55b5417a47 (diff)
Add hacky method to InMemoryNodeEntry for fast but unsafe iteration over in-progress reverse deps.
PiperOrigin-RevId: 199209256
Diffstat (limited to 'src/main/java/com/google/devtools/build/skyframe')
-rw-r--r--src/main/java/com/google/devtools/build/skyframe/InMemoryNodeEntry.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/skyframe/InMemoryNodeEntry.java b/src/main/java/com/google/devtools/build/skyframe/InMemoryNodeEntry.java
index 5a13c57ce0..00f52dd73d 100644
--- a/src/main/java/com/google/devtools/build/skyframe/InMemoryNodeEntry.java
+++ b/src/main/java/com/google/devtools/build/skyframe/InMemoryNodeEntry.java
@@ -275,6 +275,22 @@ public class InMemoryNodeEntry implements NodeEntry {
return ReverseDepsUtility.returnNewElements(this, getOpToStoreBare());
}
+ /**
+ * Highly dangerous method. Used only for testing/debugging. Can only be called on an in-progress
+ * entry that is not dirty and that will not keep edges. Returns all the entry's reverse deps,
+ * which must all be {@link SkyKey}s representing {@link Op#ADD} operations, since that is the
+ * operation that is stored bare. Used for speed, since it avoids making any copies, so should be
+ * much faster than {@link #getInProgressReverseDeps}.
+ */
+ @SuppressWarnings("unchecked")
+ public synchronized Iterable<SkyKey> unsafeGetUnconsolidatedRdeps() {
+ Preconditions.checkState(!isDone(), this);
+ Preconditions.checkState(!isDirty(), this);
+ Preconditions.checkState(keepEdges().equals(KeepEdgesPolicy.NONE), this);
+ Preconditions.checkState(getOpToStoreBare() == OpToStoreBare.ADD, this);
+ return (Iterable<SkyKey>) (List<?>) reverseDepsDataToConsolidate;
+ }
+
@Override
public synchronized Set<SkyKey> setValue(SkyValue value, Version version)
throws InterruptedException {