aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/skyframe/PrepareDepsOfPatternsValue.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/PrepareDepsOfPatternsValue.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/PrepareDepsOfPatternsValue.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/skyframe/PrepareDepsOfPatternsValue.java56
1 files changed, 29 insertions, 27 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/PrepareDepsOfPatternsValue.java b/src/main/java/com/google/devtools/build/lib/skyframe/PrepareDepsOfPatternsValue.java
index eac1b89e22..ec9435b651 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/PrepareDepsOfPatternsValue.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/PrepareDepsOfPatternsValue.java
@@ -13,10 +13,11 @@
// limitations under the License.
package com.google.devtools.build.lib.skyframe;
+import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import com.google.devtools.build.lib.concurrent.ThreadSafety.Immutable;
import com.google.devtools.build.lib.concurrent.ThreadSafety.ThreadSafe;
-import com.google.devtools.build.lib.pkgcache.FilteringPolicy;
+import com.google.devtools.build.lib.skyframe.TargetPatternValue.TargetPatternKey;
import com.google.devtools.build.skyframe.SkyKey;
import com.google.devtools.build.skyframe.SkyValue;
@@ -24,53 +25,55 @@ import java.io.Serializable;
import java.util.Objects;
/**
- * The value returned by {@link PrepareDepsOfPatternsFunction}. Because that function is
- * invoked only for its side effect (i.e. ensuring the graph contains targets matching the
- * pattern sequence and their transitive dependencies), this value carries no information.
+ * The value returned by {@link PrepareDepsOfPatternsFunction}. Although that function is
+ * invoked primarily for its side effect (i.e. ensuring the graph contains targets matching the
+ * pattern sequence and their transitive dependencies), this value contains the
+ * {@link TargetPatternKey} arguments of the {@link PrepareDepsOfPatternFunction}s evaluated in
+ * service of it.
*
- * <p>Because the returned value is always the same object, this value and the
- * {@link PrepareDepsOfPatternsFunction} which computes it are incompatible with change pruning. It
- * should only be requested by consumers who do not require reevaluation when
- * {@link PrepareDepsOfPatternsFunction} is reevaluated. Safe consumers include, e.g., top-level
- * consumers, and other functions which invoke {@link PrepareDepsOfPatternsFunction} solely for its
- * side-effects.
+ * <p>Because the returned value may remain the same when the side-effects of this function
+ * evaluation change, this value and the {@link PrepareDepsOfPatternsFunction} which computes it
+ * are incompatible with change pruning. It should only be requested by consumers who do not
+ * require reevaluation when {@link PrepareDepsOfPatternsFunction} is reevaluated. Safe consumers
+ * include, e.g., top-level consumers, and other functions which invoke {@link
+ * PrepareDepsOfPatternsFunction} solely for its side-effects and which do not behave differently
+ * depending on those side-effects.
*/
@Immutable
@ThreadSafe
public final class PrepareDepsOfPatternsValue implements SkyValue {
- public static final PrepareDepsOfPatternsValue INSTANCE = new PrepareDepsOfPatternsValue();
- private PrepareDepsOfPatternsValue() {
+ private final ImmutableList<TargetPatternKey> targetPatternKeys;
+
+ PrepareDepsOfPatternsValue(ImmutableList<TargetPatternKey> targetPatternKeys) {
+ this.targetPatternKeys = targetPatternKeys;
+ }
+
+ public ImmutableList<TargetPatternKey> getTargetPatternKeys() {
+ return targetPatternKeys;
}
@ThreadSafe
- public static SkyKey key(ImmutableList<String> patterns, FilteringPolicy policy, String offset) {
+ public static SkyKey key(ImmutableList<String> patterns, String offset) {
return new SkyKey(SkyFunctions.PREPARE_DEPS_OF_PATTERNS,
- new TargetPatternSequence(patterns, policy, offset));
+ new TargetPatternSequence(patterns, offset));
}
/** The argument value for {@link SkyKey}s of {@link PrepareDepsOfPatternsFunction}. */
@ThreadSafe
public static class TargetPatternSequence implements Serializable {
private final ImmutableList<String> patterns;
- private final FilteringPolicy policy;
private final String offset;
- private TargetPatternSequence(ImmutableList<String> patterns, FilteringPolicy policy,
- String offset) {
- this.patterns = patterns;
- this.policy = policy;
- this.offset = offset;
+ private TargetPatternSequence(ImmutableList<String> patterns, String offset) {
+ this.patterns = Preconditions.checkNotNull(patterns);
+ this.offset = Preconditions.checkNotNull(offset);
}
public ImmutableList<String> getPatterns() {
return patterns;
}
- public FilteringPolicy getPolicy() {
- return policy;
- }
-
public String getOffset() {
return offset;
}
@@ -84,13 +87,12 @@ public final class PrepareDepsOfPatternsValue implements SkyValue {
return false;
}
TargetPatternSequence that = (TargetPatternSequence) o;
- return offset.equals(that.offset) && patterns.equals(that.patterns)
- && policy.equals(that.policy);
+ return Objects.equals(offset, that.offset) && Objects.equals(patterns, that.patterns);
}
@Override
public int hashCode() {
- return Objects.hash(patterns, policy, offset);
+ return Objects.hash(patterns, offset);
}
}
}