aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/skyframe/PrepareDepsOfTargetsUnderDirectoryValue.java
diff options
context:
space:
mode:
authorGravatar Mark Schaller <mschaller@google.com>2015-07-07 16:36:09 +0000
committerGravatar Han-Wen Nienhuys <hanwen@google.com>2015-07-08 11:40:48 +0000
commitd7311e0ddaf66857d5d7f332a6fad58e0bf7becb (patch)
treea011b8e8264d788e4d97baca22974edc3b2eb78f /src/main/java/com/google/devtools/build/lib/skyframe/PrepareDepsOfTargetsUnderDirectoryValue.java
parent1314570a4d9094c6157f8e1cfe4b31e61b01a1fb (diff)
Activate interleaved package and transitive target loading
Hooks up the recently introduced interleaved loading functions to normal graph loading. -- MOS_MIGRATED_REVID=97679451
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/PrepareDepsOfTargetsUnderDirectoryValue.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/skyframe/PrepareDepsOfTargetsUnderDirectoryValue.java26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/PrepareDepsOfTargetsUnderDirectoryValue.java b/src/main/java/com/google/devtools/build/lib/skyframe/PrepareDepsOfTargetsUnderDirectoryValue.java
index 840ce7b6c8..353bd5e18b 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/PrepareDepsOfTargetsUnderDirectoryValue.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/PrepareDepsOfTargetsUnderDirectoryValue.java
@@ -30,7 +30,7 @@ import java.util.Objects;
/**
* The value computed by {@link PrepareDepsOfTargetsUnderDirectoryFunction}. Contains a mapping for
- * all its non-excluded directories to the count of packages beneath them.
+ * all its non-excluded directories to whether there are packages beneath them.
*
* <p>This value is used by {@link GraphBackedRecursivePackageProvider#getPackagesUnderDirectory}
* to help it traverse the graph and find the set of packages under a directory, and recursively by
@@ -41,7 +41,7 @@ import java.util.Objects;
* part because of its side-effects (i.e. loading transitive dependencies of targets), this value
* interacts safely with change pruning, despite the fact that this value is a lossy representation
* of the packages beneath a directory (i.e. it doesn't care <b>which</b> packages are under a
- * directory, just the count of them). When the targets in a package change, the
+ * directory, just whether there are any). When the targets in a package change, the
* {@link PackageValue} that {@link PrepareDepsOfTargetsUnderDirectoryFunction} depends on will be
* invalidated, and the PrepareDeps function for that package's directory will be reevaluated,
* loading any new transitive dependencies. Change pruning may prevent the reevaluation of
@@ -49,15 +49,16 @@ import java.util.Objects;
*/
public final class PrepareDepsOfTargetsUnderDirectoryValue implements SkyValue {
public static final PrepareDepsOfTargetsUnderDirectoryValue EMPTY =
- new PrepareDepsOfTargetsUnderDirectoryValue(false, ImmutableMap.<RootedPath, Integer>of());
+ new PrepareDepsOfTargetsUnderDirectoryValue(false, ImmutableMap.<RootedPath, Boolean>of());
private final boolean isDirectoryPackage;
- private final ImmutableMap<RootedPath, Integer> subdirectoryPackageCount;
+ private final ImmutableMap<RootedPath, Boolean> subdirectoryTransitivelyContainsPackages;
public PrepareDepsOfTargetsUnderDirectoryValue(boolean isDirectoryPackage,
- ImmutableMap<RootedPath, Integer> subdirectoryPackageCount) {
+ ImmutableMap<RootedPath, Boolean> subdirectoryTransitivelyContainsPackages) {
this.isDirectoryPackage = isDirectoryPackage;
- this.subdirectoryPackageCount = Preconditions.checkNotNull(subdirectoryPackageCount);
+ this.subdirectoryTransitivelyContainsPackages = Preconditions.checkNotNull(
+ subdirectoryTransitivelyContainsPackages);
}
/** Whether the directory is a package (i.e. contains a BUILD file). */
@@ -66,11 +67,11 @@ public final class PrepareDepsOfTargetsUnderDirectoryValue implements SkyValue {
}
/**
- * Returns a map from non-excluded immediate subdirectories of this directory to the number of
- * non-excluded packages under them.
+ * Returns a map from non-excluded immediate subdirectories of this directory to whether there
+ * are non-excluded packages under them.
*/
- public ImmutableMap<RootedPath, Integer> getSubdirectoryPackageCount() {
- return subdirectoryPackageCount;
+ public ImmutableMap<RootedPath, Boolean> getSubdirectoryTransitivelyContainsPackages() {
+ return subdirectoryTransitivelyContainsPackages;
}
@Override
@@ -83,12 +84,13 @@ public final class PrepareDepsOfTargetsUnderDirectoryValue implements SkyValue {
}
PrepareDepsOfTargetsUnderDirectoryValue that = (PrepareDepsOfTargetsUnderDirectoryValue) o;
return isDirectoryPackage == that.isDirectoryPackage
- && Objects.equals(subdirectoryPackageCount, that.subdirectoryPackageCount);
+ && Objects.equals(subdirectoryTransitivelyContainsPackages,
+ that.subdirectoryTransitivelyContainsPackages);
}
@Override
public int hashCode() {
- return Objects.hash(isDirectoryPackage, subdirectoryPackageCount);
+ return Objects.hash(isDirectoryPackage, subdirectoryTransitivelyContainsPackages);
}
/** Create a prepare deps of targets under directory request. */