diff options
author | 2016-08-15 21:54:55 +0000 | |
---|---|---|
committer | 2016-08-16 15:21:17 +0000 | |
commit | 3c0adb26bac6d756fb97e4bcc6d4e5b2cefa5eeb (patch) | |
tree | c77f6438711f4b23d6c528907a81e23dc9e6dc91 /src/main/java/com/google/devtools/build/lib/rules/genquery/GenQuery.java | |
parent | 89125d5ee83f562c309a792a7c56ce24452e61ea (diff) |
Allow Skyframe graph lookups and value retrievals to throw InterruptedException.
The only place we now don't handle InterruptedException is in the action graph created after analysis, since I'm not sure that will be around for that much longer.
--
MOS_MIGRATED_REVID=130327770
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/genquery/GenQuery.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/genquery/GenQuery.java | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/genquery/GenQuery.java b/src/main/java/com/google/devtools/build/lib/rules/genquery/GenQuery.java index c5ebb6f8b3..2a336da0bf 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/genquery/GenQuery.java +++ b/src/main/java/com/google/devtools/build/lib/rules/genquery/GenQuery.java @@ -44,7 +44,6 @@ import com.google.devtools.build.lib.packages.BuildType; import com.google.devtools.build.lib.packages.NoSuchPackageException; import com.google.devtools.build.lib.packages.NoSuchTargetException; import com.google.devtools.build.lib.packages.Package; -import com.google.devtools.build.lib.packages.RuleClass.ConfiguredTargetFactory.RuleErrorException; import com.google.devtools.build.lib.packages.Target; import com.google.devtools.build.lib.pkgcache.FilteringPolicies; import com.google.devtools.build.lib.pkgcache.FilteringPolicy; @@ -78,7 +77,6 @@ import com.google.devtools.build.skyframe.SkyKey; import com.google.devtools.build.skyframe.ValueOrException; import com.google.devtools.common.options.OptionsParser; import com.google.devtools.common.options.OptionsParsingException; - import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.OutputStream; @@ -89,7 +87,6 @@ import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; - import javax.annotation.Nullable; /** @@ -168,7 +165,7 @@ public class GenQuery implements RuleConfiguredTargetFactory { // The transitive closure of these targets is an upper estimate on the labels // the query will touch - private Set<Target> getScope(RuleContext context) { + private static Set<Target> getScope(RuleContext context) throws InterruptedException { List<Label> scopeLabels = context.attributes().get("scope", BuildType.LABEL_LIST); Set<Target> scope = Sets.newHashSetWithExpectedSize(scopeLabels.size()); for (Label scopePart : scopeLabels) { @@ -199,8 +196,9 @@ public class GenQuery implements RuleConfiguredTargetFactory { } @Nullable - private Pair<ImmutableMap<PackageIdentifier, Package>, ImmutableMap<Label, Target>> - constructPackageMap(SkyFunction.Environment env, Collection<Target> scope) { + private static Pair<ImmutableMap<PackageIdentifier, Package>, ImmutableMap<Label, Target>> + constructPackageMap(SkyFunction.Environment env, Collection<Target> scope) + throws InterruptedException { // It is not necessary for correctness to construct intermediate NestedSets; we could iterate // over individual targets in scope immediately. However, creating a composite NestedSet first // saves us from iterating over the same sub-NestedSets multiple times. @@ -374,10 +372,9 @@ public class GenQuery implements RuleConfiguredTargetFactory { } @Override - public Map<String, ResolvedTargets<Target>> preloadTargetPatterns(EventHandler eventHandler, - Collection<String> patterns, - boolean keepGoing) - throws TargetParsingException { + public Map<String, ResolvedTargets<Target>> preloadTargetPatterns( + EventHandler eventHandler, Collection<String> patterns, boolean keepGoing) + throws TargetParsingException, InterruptedException { Preconditions.checkArgument(!keepGoing); boolean ok = true; Map<String, ResolvedTargets<Target>> preloadedPatterns = |