public class JobDirectoryManifestCreatorServiceImpl extends java.lang.Object implements JobDirectoryManifestCreatorService
JobDirectoryManifestCreatorService that caches manifests produced by the factory for a few
seconds, thus avoiding re-calculating the same for subsequent requests (e.g. a user navigating a tree true the UI).| Constructor and Description |
|---|
JobDirectoryManifestCreatorServiceImpl(DirectoryManifest.Factory factory,
com.github.benmanes.caffeine.cache.Cache<java.nio.file.Path,DirectoryManifest> cache,
boolean includeChecksum)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
DirectoryManifest |
getDirectoryManifest(java.nio.file.Path jobDirectoryPath)
Produces a
DirectoryManifest for the given job. |
void |
invalidateCachedDirectoryManifest(java.nio.file.Path jobDirectoryPath)
If the implementation caches manifests to avoid excessive I/O, then demand the given cache entry be dropped,
thus forcing a re-creation of manifest from scratch.
|
public JobDirectoryManifestCreatorServiceImpl(DirectoryManifest.Factory factory, com.github.benmanes.caffeine.cache.Cache<java.nio.file.Path,DirectoryManifest> cache, boolean includeChecksum)
factory - the directory manifest factorycache - the loading cache to useincludeChecksum - whether to produce manifests that include checksumspublic DirectoryManifest getDirectoryManifest(java.nio.file.Path jobDirectoryPath) throws java.io.IOException
DirectoryManifest for the given job.getDirectoryManifest in interface JobDirectoryManifestCreatorServicejobDirectoryPath - the job directoryDirectoryManifestjava.io.IOException - if the manifest cannot be created.public void invalidateCachedDirectoryManifest(java.nio.file.Path jobDirectoryPath)
invalidateCachedDirectoryManifest in interface JobDirectoryManifestCreatorServicejobDirectoryPath - the job directory