aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/skyframe/CompletionFunction.java
diff options
context:
space:
mode:
authorGravatar Janak Ramakrishnan <janakr@google.com>2016-08-15 21:54:55 +0000
committerGravatar Philipp Wollermann <philwo@google.com>2016-08-16 15:21:17 +0000
commit3c0adb26bac6d756fb97e4bcc6d4e5b2cefa5eeb (patch)
treec77f6438711f4b23d6c528907a81e23dc9e6dc91 /src/main/java/com/google/devtools/build/lib/skyframe/CompletionFunction.java
parent89125d5ee83f562c309a792a7c56ce24452e61ea (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/skyframe/CompletionFunction.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/skyframe/CompletionFunction.java21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/CompletionFunction.java b/src/main/java/com/google/devtools/build/lib/skyframe/CompletionFunction.java
index db9ab97534..6a3e6e45b7 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/CompletionFunction.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/CompletionFunction.java
@@ -46,15 +46,11 @@ import javax.annotation.Nullable;
public final class CompletionFunction<TValue extends SkyValue, TResult extends SkyValue>
implements SkyFunction {
- /**
- * A strategy for completing the build.
- */
- public interface Completor<TValue, TResult extends SkyValue> {
+ /** A strategy for completing the build. */
+ interface Completor<TValue, TResult extends SkyValue> {
- /**
- * Obtains an analysis result value from environment.
- */
- TValue getValueFromSkyKey(SkyKey skyKey, Environment env);
+ /** Obtains an analysis result value from environment. */
+ TValue getValueFromSkyKey(SkyKey skyKey, Environment env) throws InterruptedException;
/**
* Returns the options which determine the artifacts to build for the top-level targets.
@@ -104,7 +100,8 @@ public final class CompletionFunction<TValue extends SkyValue, TResult extends S
private static class TargetCompletor
implements Completor<ConfiguredTargetValue, TargetCompletionValue> {
@Override
- public ConfiguredTargetValue getValueFromSkyKey(SkyKey skyKey, Environment env) {
+ public ConfiguredTargetValue getValueFromSkyKey(SkyKey skyKey, Environment env)
+ throws InterruptedException {
TargetCompletionKey tcKey = (TargetCompletionKey) skyKey.argument();
LabelAndConfiguration lac = tcKey.labelAndConfiguration();
return (ConfiguredTargetValue)
@@ -162,7 +159,8 @@ public final class CompletionFunction<TValue extends SkyValue, TResult extends S
private static class AspectCompletor implements Completor<AspectValue, AspectCompletionValue> {
@Override
- public AspectValue getValueFromSkyKey(SkyKey skyKey, Environment env) {
+ public AspectValue getValueFromSkyKey(SkyKey skyKey, Environment env)
+ throws InterruptedException {
AspectCompletionKey acKey = (AspectCompletionKey) skyKey.argument();
AspectKey aspectKey = acKey.aspectKey();
return (AspectValue) env.getValue(AspectValue.key(aspectKey));
@@ -237,7 +235,8 @@ public final class CompletionFunction<TValue extends SkyValue, TResult extends S
@Nullable
@Override
- public SkyValue compute(SkyKey skyKey, Environment env) throws CompletionFunctionException {
+ public SkyValue compute(SkyKey skyKey, Environment env)
+ throws CompletionFunctionException, InterruptedException {
TValue value = completor.getValueFromSkyKey(skyKey, env);
TopLevelArtifactContext topLevelContext = completor.getTopLevelArtifactContext(skyKey);
if (env.valuesMissing()) {