CriticalPathComputer: make self-contained
We previously sub-classed this class in non-open source code, and now we
don't do this anymore.
PiperOrigin-RevId: 259706079
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/CriticalPathComputer.java b/src/main/java/com/google/devtools/build/lib/runtime/CriticalPathComputer.java
index feae635..9a8d798 100644
--- a/src/main/java/com/google/devtools/build/lib/runtime/CriticalPathComputer.java
+++ b/src/main/java/com/google/devtools/build/lib/runtime/CriticalPathComputer.java
@@ -37,6 +37,7 @@
import java.time.Duration;
import java.util.Comparator;
import java.util.List;
+import java.util.Map;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
@@ -65,7 +66,7 @@
private final AtomicInteger idGenerator = new AtomicInteger();
// outputArtifactToComponent is accessed from multiple event handlers.
- protected final ConcurrentMap<Artifact, CriticalPathComponent> outputArtifactToComponent =
+ private final ConcurrentMap<Artifact, CriticalPathComponent> outputArtifactToComponent =
Maps.newConcurrentMap();
private final ActionKeyContext actionKeyContext;
@@ -74,7 +75,7 @@
private final Clock clock;
private final boolean checkCriticalPathInconsistencies;
- protected CriticalPathComputer(
+ public CriticalPathComputer(
ActionKeyContext actionKeyContext, Clock clock, boolean checkCriticalPathInconsistencies) {
this.actionKeyContext = actionKeyContext;
this.clock = clock;
@@ -82,7 +83,7 @@
this.checkCriticalPathInconsistencies = checkCriticalPathInconsistencies;
}
- protected CriticalPathComputer(ActionKeyContext actionKeyContext, Clock clock) {
+ public CriticalPathComputer(ActionKeyContext actionKeyContext, Clock clock) {
this(actionKeyContext, clock, /*checkCriticalPathInconsistencies=*/ true);
}
@@ -164,6 +165,10 @@
components.build());
}
+ public Map<Artifact, CriticalPathComponent> getCriticalPathComponentsMap() {
+ return outputArtifactToComponent;
+ }
+
/** Adds spawn metrics to the action stats. */
@Subscribe
@AllowConcurrentEvents
diff --git a/third_party/ijar/BUILD b/third_party/ijar/BUILD
index 8f78c9c..466c7d4 100644
--- a/third_party/ijar/BUILD
+++ b/third_party/ijar/BUILD
@@ -7,7 +7,7 @@
licenses(["notice"]) # Apache 2.0
-load("@rules_pkg//:pkg.bzl", "pkg_tar")
+load("//tools/build_defs/pkg:pkg.bzl", "pkg_tar")
cc_library(
name = "zip",