aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/skyframe/RecursiveFilesystemTraversalFunction.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/RecursiveFilesystemTraversalFunction.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/RecursiveFilesystemTraversalFunction.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/skyframe/RecursiveFilesystemTraversalFunction.java21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/RecursiveFilesystemTraversalFunction.java b/src/main/java/com/google/devtools/build/lib/skyframe/RecursiveFilesystemTraversalFunction.java
index b7f7b921d6..e122307ee7 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/RecursiveFilesystemTraversalFunction.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/RecursiveFilesystemTraversalFunction.java
@@ -31,12 +31,10 @@ import com.google.devtools.build.skyframe.SkyFunction;
import com.google.devtools.build.skyframe.SkyFunctionException;
import com.google.devtools.build.skyframe.SkyKey;
import com.google.devtools.build.skyframe.SkyValue;
-
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
-
import javax.annotation.Nullable;
/** A {@link SkyFunction} to build {@link RecursiveFilesystemTraversalValue}s. */
@@ -109,7 +107,7 @@ public final class RecursiveFilesystemTraversalFunction implements SkyFunction {
@Override
public SkyValue compute(SkyKey skyKey, Environment env)
- throws RecursiveFilesystemTraversalFunctionException {
+ throws RecursiveFilesystemTraversalFunctionException, InterruptedException {
TraversalRequest traversal = (TraversalRequest) skyKey.argument();
try {
// Stat the traversal root.
@@ -204,7 +202,7 @@ public final class RecursiveFilesystemTraversalFunction implements SkyFunction {
}
private static FileInfo lookUpFileInfo(Environment env, TraversalRequest traversal)
- throws MissingDepException {
+ throws MissingDepException, InterruptedException {
// Stat the file.
FileValue fileValue = (FileValue) getDependentSkyValue(env, FileValue.key(traversal.path));
if (fileValue.exists()) {
@@ -279,8 +277,9 @@ public final class RecursiveFilesystemTraversalFunction implements SkyFunction {
* {@link FileInfo} so the caller should use these instead of the old ones (this happens when
* a package is found, but under a different root than expected)
*/
- private static PkgLookupResult checkIfPackage(Environment env, TraversalRequest traversal,
- FileInfo rootInfo) throws MissingDepException {
+ private static PkgLookupResult checkIfPackage(
+ Environment env, TraversalRequest traversal, FileInfo rootInfo)
+ throws MissingDepException, InterruptedException {
Preconditions.checkArgument(rootInfo.type.exists() && !rootInfo.type.isFile(),
"{%s} {%s}", traversal, rootInfo);
PackageLookupValue pkgLookup = (PackageLookupValue) getDependentSkyValue(env,
@@ -315,8 +314,9 @@ public final class RecursiveFilesystemTraversalFunction implements SkyFunction {
*
* <p>The returned keys are of type {@link SkyFunctions#RECURSIVE_FILESYSTEM_TRAVERSAL}.
*/
- private static Collection<SkyKey> createRecursiveTraversalKeys(Environment env,
- TraversalRequest traversal) throws MissingDepException {
+ private static Collection<SkyKey> createRecursiveTraversalKeys(
+ Environment env, TraversalRequest traversal)
+ throws MissingDepException, InterruptedException {
// Use the traversal's path, even if it's a symlink. The contents of the directory, as listed
// in the result, must be relative to it.
DirectoryListingValue dirListing = (DirectoryListingValue) getDependentSkyValue(env,
@@ -405,7 +405,7 @@ public final class RecursiveFilesystemTraversalFunction implements SkyFunction {
}
private static SkyValue getDependentSkyValue(Environment env, SkyKey key)
- throws MissingDepException {
+ throws MissingDepException, InterruptedException {
SkyValue value = env.getValue(key);
if (env.valuesMissing()) {
throw new MissingDepException();
@@ -419,8 +419,7 @@ public final class RecursiveFilesystemTraversalFunction implements SkyFunction {
* <p>The keys must all be {@link SkyFunctions#RECURSIVE_FILESYSTEM_TRAVERSAL} keys.
*/
private static Collection<RecursiveFilesystemTraversalValue> traverseChildren(
- Environment env, Iterable<SkyKey> keys)
- throws MissingDepException {
+ Environment env, Iterable<SkyKey> keys) throws MissingDepException, InterruptedException {
Map<SkyKey, SkyValue> values = env.getValues(keys);
if (env.valuesMissing()) {
throw new MissingDepException();