diff options
author | 2015-04-06 17:26:59 +0000 | |
---|---|---|
committer | 2015-04-06 18:48:57 +0000 | |
commit | c2dd80f773174e496dd53c40d287a7e7b705b960 (patch) | |
tree | 4817b64b62239b6604d9d3354d3f25a2f74acf87 /src/main/java/com/google/devtools/build/lib/actions/ActionInputFileCache.java | |
parent | 06f446a697d9f0eefad3b5e5bf070a751e3c5efc (diff) |
Mostly-automated roll-forward to return ActionInput objects from the ActionInputFileCache when given a digest to do a reverse lookup so that metadata can be more easily retrieved.
Discovered inputs are no longer ever put into SingleBuildFileCache, so it is safe to roll this forward now
Because of code changes (meant to ensure the safety of this change), there were conflicts that had to be manually resolved.
--
MOS_MIGRATED_REVID=90425783
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/actions/ActionInputFileCache.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/actions/ActionInputFileCache.java | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/actions/ActionInputFileCache.java b/src/main/java/com/google/devtools/build/lib/actions/ActionInputFileCache.java index b45e9cd65a..79c8785e92 100644 --- a/src/main/java/com/google/devtools/build/lib/actions/ActionInputFileCache.java +++ b/src/main/java/com/google/devtools/build/lib/actions/ActionInputFileCache.java @@ -13,9 +13,9 @@ // limitations under the License. package com.google.devtools.build.lib.actions; +import com.google.devtools.build.lib.vfs.Path; import com.google.protobuf.ByteString; -import java.io.File; import java.io.IOException; import javax.annotation.Nullable; @@ -70,8 +70,16 @@ public interface ActionInputFileCache { * based on files previously seen as inputs. * * @param digest the digest. - * @return a File path. + * @return an ActionInput corresponding to the given digest. */ @Nullable - File getFileFromDigest(ByteString digest) throws IOException; + ActionInput getInputFromDigest(ByteString digest) throws IOException; + + /** + * The absolute path that this input is located at. The usual {@link ActionInput} implementation + * is {@link Artifact}, which currently embeds its full path, so implementations should just + * return this path if {@code input} is an {@link Artifact}. Otherwise, implementations should + * resolve the relative path into an absolute one and return that. + */ + Path getInputPath(ActionInput input); } |