aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/skyframe/SkylarkImportLookupFunction.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/SkylarkImportLookupFunction.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/SkylarkImportLookupFunction.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/skyframe/SkylarkImportLookupFunction.java24
1 files changed, 10 insertions, 14 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/SkylarkImportLookupFunction.java b/src/main/java/com/google/devtools/build/lib/skyframe/SkylarkImportLookupFunction.java
index c4889fa7d8..951d8a78b9 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/SkylarkImportLookupFunction.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/SkylarkImportLookupFunction.java
@@ -47,13 +47,11 @@ import com.google.devtools.build.skyframe.SkyFunctionException.Transience;
import com.google.devtools.build.skyframe.SkyKey;
import com.google.devtools.build.skyframe.SkyValue;
import com.google.devtools.build.skyframe.ValueOrException2;
-
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
-
import javax.annotation.Nullable;
/**
@@ -211,17 +209,17 @@ public class SkylarkImportLookupFunction implements SkyFunction {
}
/**
- * Computes the set of Labels corresponding to a collection of PathFragments representing
- * absolute import paths.
- *
+ * Computes the set of Labels corresponding to a collection of PathFragments representing absolute
+ * import paths.
+ *
* @return a map from the computed {@link Label}s to the corresponding {@link PathFragment}s;
- * {@code null} if any Skyframe dependencies are unavailable.
+ * {@code null} if any Skyframe dependencies are unavailable.
* @throws SkylarkImportFailedException
*/
@Nullable
static ImmutableMap<PathFragment, Label> labelsForAbsoluteImports(
ImmutableSet<PathFragment> pathsToLookup, Environment env)
- throws SkylarkImportFailedException {
+ throws SkylarkImportFailedException, InterruptedException {
// Import PathFragments are absolute, so there is a 1-1 mapping from corresponding Labels.
ImmutableMap.Builder<PathFragment, Label> outputMap = new ImmutableMap.Builder<>();
@@ -290,19 +288,17 @@ public class SkylarkImportLookupFunction implements SkyFunction {
/**
* Computes the set of {@link Label}s corresponding to a set of Skylark {@link LoadStatement}s.
- *
+ *
* @param imports a collection of Skylark {@link LoadStatement}s
* @param containingFileLabel the {@link Label} of the file containing the load statements
- * @return an {@link ImmutableMap} which maps a {@link String} used in the load statement to
- * its corresponding {@Label}. Returns {@code null} if any Skyframe dependencies are
- * unavailable.
- * @throws SkylarkImportFailedException if no package can be found that contains the
- * loaded file
+ * @return an {@link ImmutableMap} which maps a {@link String} used in the load statement to its
+ * corresponding {@Label}. Returns {@code null} if any Skyframe dependencies are unavailable.
+ * @throws SkylarkImportFailedException if no package can be found that contains the loaded file
*/
@Nullable
static ImmutableMap<String, Label> findLabelsForLoadStatements(
ImmutableCollection<SkylarkImport> imports, Label containingFileLabel, Environment env)
- throws SkylarkImportFailedException {
+ throws SkylarkImportFailedException, InterruptedException {
Preconditions.checkArgument(
!containingFileLabel.getPackageIdentifier().getRepository().isDefault());
Map<String, Label> outputMap = Maps.newHashMapWithExpectedSize(imports.size());