diff options
author | 2017-05-08 14:49:00 -0400 | |
---|---|---|
committer | 2017-05-09 10:52:36 -0400 | |
commit | 1f75476f7a2f1abb449d538ef865f51ac138d013 (patch) | |
tree | 7335b500ba5bb34b5f97fb4cd30917376a38810e /src/main/java/com/google/devtools/build/lib/query2/LabelVisitor.java | |
parent | cc0f6a62d5262760d34937547470a213f6bd5b72 (diff) |
Clean up AbstractQueueVisitor's constructors.
The "concurrent" bit was supposedly around for testing purposes, but who knows if it even works anymore. Making other callsites explicitly state their ErrorClassifier gets us down to two constructors, one of which can delegate to the other.
I think having both these constructors is useful because there's a linkage between creating a new executor service and specifying that the AQV should shut down the service at the end of the visitation. And using a static create() method doesn't work because of AQV's inheritance model.
PiperOrigin-RevId: 155406771
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/query2/LabelVisitor.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/query2/LabelVisitor.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/query2/LabelVisitor.java b/src/main/java/com/google/devtools/build/lib/query2/LabelVisitor.java index fc51c9a9d6..d3b2c140f4 100644 --- a/src/main/java/com/google/devtools/build/lib/query2/LabelVisitor.java +++ b/src/main/java/com/google/devtools/build/lib/query2/LabelVisitor.java @@ -23,6 +23,7 @@ import com.google.common.collect.Multimaps; import com.google.common.collect.SetMultimap; import com.google.devtools.build.lib.cmdline.Label; import com.google.devtools.build.lib.concurrent.AbstractQueueVisitor; +import com.google.devtools.build.lib.concurrent.ErrorClassifier; import com.google.devtools.build.lib.concurrent.ThreadSafety.ThreadSafe; import com.google.devtools.build.lib.events.ExtendedEventHandler; import com.google.devtools.build.lib.packages.AggregatingAttributeMapper; @@ -240,8 +241,6 @@ final class LabelVisitor { private final Iterable<TargetEdgeObserver> observers; private final TargetEdgeErrorObserver errorObserver; private final AtomicBoolean stopNewActions = new AtomicBoolean(false); - private static final boolean CONCURRENT = true; - public Visitor( ExtendedEventHandler eventHandler, @@ -252,7 +251,14 @@ final class LabelVisitor { // Observing the loading phase of a typical large package (with all subpackages) shows // maximum thread-level concurrency of ~20. Limiting the total number of threads to 200 is // therefore conservative and should help us avoid hitting native limits. - super(CONCURRENT, parallelThreads, 1L, TimeUnit.SECONDS, !keepGoing, THREAD_NAME); + super( + parallelThreads, + 1L, + TimeUnit.SECONDS, + !keepGoing, + THREAD_NAME, + AbstractQueueVisitor.EXECUTOR_FACTORY, + ErrorClassifier.DEFAULT); this.eventHandler = eventHandler; this.maxDepth = maxDepth; this.errorObserver = new TargetEdgeErrorObserver(); |