Class JobDirectoryManifestCreatorServiceImpl
java.lang.Object
com.netflix.genie.common.internal.services.impl.JobDirectoryManifestCreatorServiceImpl
- All Implemented Interfaces:
JobDirectoryManifestCreatorService
public class JobDirectoryManifestCreatorServiceImpl
extends Object
implements JobDirectoryManifestCreatorService
Implementation of
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).- Since:
- 4.0.0
-
Constructor Summary
ConstructorsConstructorDescriptionJobDirectoryManifestCreatorServiceImpl
(DirectoryManifest.Factory factory, com.github.benmanes.caffeine.cache.Cache<Path, DirectoryManifest> cache, boolean includeChecksum) Constructor. -
Method Summary
Modifier and TypeMethodDescriptiongetDirectoryManifest
(Path jobDirectoryPath) Produces aDirectoryManifest
for the given job.void
invalidateCachedDirectoryManifest
(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 Details
-
JobDirectoryManifestCreatorServiceImpl
public JobDirectoryManifestCreatorServiceImpl(DirectoryManifest.Factory factory, com.github.benmanes.caffeine.cache.Cache<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 Details
-
getDirectoryManifest
Produces aDirectoryManifest
for the given job.- Specified by:
getDirectoryManifest
in interfaceJobDirectoryManifestCreatorService
- Parameters:
jobDirectoryPath
- the job directory- Returns:
- a
DirectoryManifest
- Throws:
IOException
- if the manifest cannot be created.
-
invalidateCachedDirectoryManifest
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
-