aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/actions/cache/MetadataHandler.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/actions/cache/MetadataHandler.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/actions/cache/MetadataHandler.java18
1 files changed, 17 insertions, 1 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 9d288dbbff..61a5d6d211 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
@@ -48,11 +48,27 @@ public interface MetadataHandler {
*/
void injectDigest(ActionInput output, FileStatus statNoFollow, byte[] digest);
- /** Returns true iff artifact exists. */
+ /**
+ * Marks an artifact as intentionally omitted. Acknowledges that this Artifact could have
+ * existed, but was intentionally not saved, most likely as an optimization.
+ */
+ void markOmitted(ActionInput output);
+
+ /**
+ * Returns true iff artifact exists.
+ *
+ * <p>It is important to note that implementations may cache non-existence as a side effect
+ * of this method. If there is a possibility an artifact was intentionally omitted then
+ * {@link #artifactOmitted(Artifact)} should be checked first to avoid the side effect.</p>
+ */
boolean artifactExists(Artifact artifact);
+
/** Returns true iff artifact is a regular file. */
boolean isRegularFile(Artifact artifact);
+ /** Returns true iff artifact was intentionally omitted (not saved). */
+ boolean artifactOmitted(Artifact artifact);
+
/**
* @return Whether the artifact's data was injected.
* @throws IOException if implementation tried to stat artifact which threw an exception.