aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/actions
diff options
context:
space:
mode:
authorGravatar ulfjack <ulfjack@google.com>2018-07-23 01:54:13 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-07-23 01:55:37 -0700
commita6255612e4892729d3758775c76085b26b9bc584 (patch)
tree07b074a71605107757c1500fa63ea909f3590756 /src/main/java/com/google/devtools/build/lib/actions
parent5af3eeb44c4b387c02a5d1e4afc5d6c03d6274c3 (diff)
Remove PerActionFileCache
Instead, make ActionMetadataHandler implement the MetadataProvider interface. This fixes an issue where an action that runs two spawns where one depends on an output of the other was unable to get the metadata for the intermediate output. We don't currently have actions that do this, but we will have in a future change (which will also implicitly act as a regression test). PiperOrigin-RevId: 205629237
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/actions')
-rw-r--r--src/main/java/com/google/devtools/build/lib/actions/cache/MetadataHandler.java13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/actions/cache/MetadataHandler.java b/src/main/java/com/google/devtools/build/lib/actions/cache/MetadataHandler.java
index 62d03fd372..fc61397318 100644
--- a/src/main/java/com/google/devtools/build/lib/actions/cache/MetadataHandler.java
+++ b/src/main/java/com/google/devtools/build/lib/actions/cache/MetadataHandler.java
@@ -17,6 +17,7 @@ import com.google.devtools.build.lib.actions.ActionInput;
import com.google.devtools.build.lib.actions.Artifact;
import com.google.devtools.build.lib.actions.Artifact.TreeFileArtifact;
import com.google.devtools.build.lib.actions.FileArtifactValue;
+import com.google.devtools.build.lib.actions.MetadataProvider;
import com.google.devtools.build.lib.vfs.FileStatus;
import java.io.IOException;
@@ -30,15 +31,9 @@ import java.io.IOException;
* <p>Note that implementations of this interface call chmod on output files if {@link
* #discardOutputMetadata} has been called.
*/
-public interface MetadataHandler {
- /**
- * Returns metadata for the given artifact or throws an exception if the metadata could not be
- * obtained.
- *
- * @return metadata instance
- * @throws IOException if metadata could not be obtained.
- */
- FileArtifactValue getMetadata(Artifact artifact) throws IOException;
+public interface MetadataHandler extends MetadataProvider {
+ @Override
+ FileArtifactValue getMetadata(ActionInput actionInput) throws IOException;
/** Sets digest for virtual artifacts (e.g. middlemen). {@code md5Digest} must not be null. */
void setDigestForVirtualArtifact(Artifact artifact, Md5Digest md5Digest);