public class DefaultOnDiskBuildInfo extends Object implements OnDiskBuildInfo
BuildInfoRecorder
when the rule was built initially.
Such metadata is stored as key/value pairs.
Constructor and Description |
---|
DefaultOnDiskBuildInfo(BuildTarget target,
ProjectFilesystem projectFilesystem,
BuildInfoStore buildInfoStore) |
Modifier and Type | Method and Description |
---|---|
void |
calculateOutputSizeAndWriteMetadata(FileHashLoader fileHashLoader,
com.google.common.collect.ImmutableSortedSet<Path> recordedPaths,
com.google.common.base.Predicate<Long> shouldWriteOutputHashes) |
void |
deleteExistingMetadata()
Deletes both "artifact" and "build" metadata.
|
Optional<String> |
getBuildValue(String key) |
Optional<com.google.common.collect.ImmutableMap<String,String>> |
getMap(String key) |
com.google.common.collect.ImmutableSortedMap<String,String> |
getMetadataForArtifact()
Returns the "build" metadata that is stored with a cache artifact ("artifact" metadata is
stored within the artifact itself).
|
com.google.common.collect.ImmutableSortedSet<Path> |
getOutputPaths() |
com.google.common.collect.ImmutableSortedSet<Path> |
getPathsForArtifact()
Returns the recorded output paths of the rule for creating a cache artifact.
|
Optional<RuleKey> |
getRuleKey(String key)
Returns the
RuleKey for the rule whose output is currently stored on disk. |
Either<String,Exception> |
getValue(String key) |
Optional<com.google.common.collect.ImmutableList<String>> |
getValues(String key) |
com.google.common.collect.ImmutableList<String> |
getValuesOrThrow(String key)
Tries to read the "artifact" values and if it fails it logs the attributes of the file it tried
to read.
|
void |
validateArtifact(Set<Path> extractedFiles) |
public DefaultOnDiskBuildInfo(BuildTarget target, ProjectFilesystem projectFilesystem, BuildInfoStore buildInfoStore)
public Either<String,Exception> getValue(String key)
getValue
in interface OnDiskBuildInfo
public Optional<String> getBuildValue(String key)
getBuildValue
in interface OnDiskBuildInfo
public Optional<com.google.common.collect.ImmutableList<String>> getValues(String key)
getValues
in interface OnDiskBuildInfo
public com.google.common.collect.ImmutableList<String> getValuesOrThrow(String key) throws IOException
OnDiskBuildInfo
getValuesOrThrow
in interface OnDiskBuildInfo
IOException
public Optional<com.google.common.collect.ImmutableMap<String,String>> getMap(String key)
getMap
in interface OnDiskBuildInfo
public com.google.common.collect.ImmutableSortedSet<Path> getOutputPaths()
getOutputPaths
in interface OnDiskBuildInfo
public com.google.common.collect.ImmutableSortedSet<Path> getPathsForArtifact() throws IOException
OnDiskBuildInfo
getPathsForArtifact
in interface OnDiskBuildInfo
IOException
public com.google.common.collect.ImmutableSortedMap<String,String> getMetadataForArtifact() throws IOException
OnDiskBuildInfo
getMetadataForArtifact
in interface OnDiskBuildInfo
IOException
public Optional<RuleKey> getRuleKey(String key)
OnDiskBuildInfo
RuleKey
for the rule whose output is currently stored on disk.
This value would have been written the last time the rule was built successfully.
getRuleKey
in interface OnDiskBuildInfo
public void deleteExistingMetadata() throws IOException
OnDiskBuildInfo
deleteExistingMetadata
in interface OnDiskBuildInfo
IOException
public void calculateOutputSizeAndWriteMetadata(FileHashLoader fileHashLoader, com.google.common.collect.ImmutableSortedSet<Path> recordedPaths, com.google.common.base.Predicate<Long> shouldWriteOutputHashes) throws IOException
calculateOutputSizeAndWriteMetadata
in interface OnDiskBuildInfo
IOException
public void validateArtifact(Set<Path> extractedFiles) throws IOException
validateArtifact
in interface OnDiskBuildInfo
IOException