Class JobDirectoryManifestCreatorServiceImpl
- java.lang.Object
-
- com.netflix.genie.common.internal.services.impl.JobDirectoryManifestCreatorServiceImpl
-
- All Implemented Interfaces:
JobDirectoryManifestCreatorService
public class JobDirectoryManifestCreatorServiceImpl extends java.lang.Object implements JobDirectoryManifestCreatorService
Implementation ofJobDirectoryManifestCreatorService
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).- Since:
- 4.0.0
-
-
Constructor Summary
Constructors Constructor Description JobDirectoryManifestCreatorServiceImpl(DirectoryManifest.Factory factory, com.github.benmanes.caffeine.cache.Cache<java.nio.file.Path,DirectoryManifest> cache, boolean includeChecksum)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DirectoryManifest
getDirectoryManifest(java.nio.file.Path jobDirectoryPath)
Produces aDirectoryManifest
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.
-
-
-
Constructor Detail
-
JobDirectoryManifestCreatorServiceImpl
public JobDirectoryManifestCreatorServiceImpl(DirectoryManifest.Factory factory, com.github.benmanes.caffeine.cache.Cache<java.nio.file.Path,DirectoryManifest> cache, boolean includeChecksum)
Constructor.- Parameters:
factory
- the directory manifest factorycache
- the loading cache to useincludeChecksum
- whether to produce manifests that include checksums
-
-
Method Detail
-
getDirectoryManifest
public DirectoryManifest getDirectoryManifest(java.nio.file.Path jobDirectoryPath) throws java.io.IOException
Produces aDirectoryManifest
for the given job.- Specified by:
getDirectoryManifest
in interfaceJobDirectoryManifestCreatorService
- Parameters:
jobDirectoryPath
- the job directory- Returns:
- a
DirectoryManifest
- Throws:
java.io.IOException
- if the manifest cannot be created.
-
invalidateCachedDirectoryManifest
public 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.- Specified by:
invalidateCachedDirectoryManifest
in interfaceJobDirectoryManifestCreatorService
- Parameters:
jobDirectoryPath
- the job directory
-
-