Skip to content

Commit

Permalink
Mark ArtifactNestedSetKey as never shareable.
Browse files Browse the repository at this point in the history
I'm working toward declaring shareability only from the key instead of having methods in each of the function, key, and value.

PiperOrigin-RevId: 416333534
  • Loading branch information
justinhorvitz authored and copybara-github committed Dec 14, 2021
1 parent 8470e43 commit 7b37eb6
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import com.google.devtools.build.lib.actions.Artifact;
import com.google.devtools.build.lib.collect.nestedset.NestedSet;
import com.google.devtools.build.skyframe.ExecutionPhaseSkyKey;
import com.google.devtools.build.skyframe.ShareabilityOfValue;
import com.google.devtools.build.skyframe.SkyFunctionName;

/** SkyKey for {@code NestedSet<Artifact>}. */
Expand Down Expand Up @@ -45,13 +46,23 @@ public NestedSet<Artifact> getSet() {
return set;
}

@Override
public ShareabilityOfValue getShareabilityOfValue() {
// ArtifactNestedSetValue is just a promise that data is available in memory. Not meant for
// cross-server sharing.
return ShareabilityOfValue.NEVER;
}

@Override
public int hashCode() {
return node.hashCode();
}

@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
return that instanceof ArtifactNestedSetKey
&& this.node.equals(((ArtifactNestedSetKey) that).node);
}
Expand Down

0 comments on commit 7b37eb6

Please sign in to comment.