public class JobDirectoryManifestServiceImpl extends java.lang.Object implements JobDirectoryManifestService
JobDirectoryManifestService
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 |
---|
JobDirectoryManifestServiceImpl(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 JobDirectoryManifestServiceImpl(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 JobDirectoryManifestService
jobDirectoryPath
- the job directoryDirectoryManifest
java.io.IOException
- if the manifest cannot be created.public void invalidateCachedDirectoryManifest(java.nio.file.Path jobDirectoryPath)
invalidateCachedDirectoryManifest
in interface JobDirectoryManifestService
jobDirectoryPath
- the job directory