Class AbstractThreadsafeJobResultStore
java.lang.Object
org.apache.flink.runtime.highavailability.AbstractThreadsafeJobResultStore
- All Implemented Interfaces:
JobResultStore
- Direct Known Subclasses:
EmbeddedJobResultStore,FileSystemJobResultStore
An abstract class for threadsafe implementations of the
JobResultStore.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateDirtyResultAsync(JobResultEntry jobResultEntry) Registers the passedJobResultEntryinstance asdirtywhich indicates that clean-up operations still need to be performed.protected abstract voidcreateDirtyResultInternal(JobResultEntry jobResultEntry) Get the persistedJobResultinstances that are marked asdirty.hasCleanJobResultEntryAsync(org.apache.flink.api.common.JobID jobId) Returns the future of whether the store contains acleanentry for the givenJobID.protected abstract booleanhasCleanJobResultEntryInternal(org.apache.flink.api.common.JobID jobId) hasDirtyJobResultEntryAsync(org.apache.flink.api.common.JobID jobId) Returns the future of whether the store contains adirtyentry for the givenJobID.protected abstract booleanhasDirtyJobResultEntryInternal(org.apache.flink.api.common.JobID jobId) hasJobResultEntryAsync(org.apache.flink.api.common.JobID jobId) Returns the future of whether the store already contains an entry for a job.markResultAsCleanAsync(org.apache.flink.api.common.JobID jobId) Marks an existingJobResultEntryasclean.protected abstract voidmarkResultAsCleanInternal(org.apache.flink.api.common.JobID jobId)
-
Constructor Details
-
AbstractThreadsafeJobResultStore
-
-
Method Details
-
createDirtyResultAsync
Description copied from interface:JobResultStoreRegisters the passedJobResultEntryinstance asdirtywhich indicates that clean-up operations still need to be performed. Once the job resource cleanup has been finalized, we can mark theJobResultEntryascleanresult usingJobResultStore.markResultAsCleanAsync(JobID).- Specified by:
createDirtyResultAsyncin interfaceJobResultStore- Parameters:
jobResultEntry- The job result we wish to persist.- Returns:
- a successfully completed future if the dirty result is created successfully. The
future will be completed with
IllegalStateExceptionif the passedjobResultEntryhas aJobIDattached that is already registered in thisJobResultStore.
-
createDirtyResultInternal
- Throws:
IOException
-
markResultAsCleanAsync
Description copied from interface:JobResultStoreMarks an existingJobResultEntryasclean. This indicates that no more resource cleanup steps need to be performed. No actions should be triggered if the passedJobIDbelongs to a job that was already marked as clean.- Specified by:
markResultAsCleanAsyncin interfaceJobResultStore- Parameters:
jobId- Ident of the job we wish to mark as clean.- Returns:
- a successfully completed future if the result is marked successfully. The future can
complete exceptionally with a
NoSuchElementException. i.e. there is no correspondingdirtyjob present in the store for the givenJobID.
-
markResultAsCleanInternal
protected abstract void markResultAsCleanInternal(org.apache.flink.api.common.JobID jobId) throws IOException, NoSuchElementException - Throws:
IOExceptionNoSuchElementException
-
hasJobResultEntryAsync
Description copied from interface:JobResultStoreReturns the future of whether the store already contains an entry for a job.- Specified by:
hasJobResultEntryAsyncin interfaceJobResultStore- Parameters:
jobId- Ident of the job we wish to check the store for.- Returns:
- a successfully completed future with
trueif adirtyorcleanJobResultEntryexists for the givenJobID; otherwisefalse.
-
hasDirtyJobResultEntryAsync
public CompletableFuture<Boolean> hasDirtyJobResultEntryAsync(org.apache.flink.api.common.JobID jobId) Description copied from interface:JobResultStoreReturns the future of whether the store contains adirtyentry for the givenJobID.- Specified by:
hasDirtyJobResultEntryAsyncin interfaceJobResultStore- Parameters:
jobId- Ident of the job we wish to check the store for.- Returns:
- a successfully completed future with
true, if adirtyentry exists for the givenJobID; otherwisefalse.
-
hasDirtyJobResultEntryInternal
protected abstract boolean hasDirtyJobResultEntryInternal(org.apache.flink.api.common.JobID jobId) throws IOException - Throws:
IOException
-
hasCleanJobResultEntryAsync
public CompletableFuture<Boolean> hasCleanJobResultEntryAsync(org.apache.flink.api.common.JobID jobId) Description copied from interface:JobResultStoreReturns the future of whether the store contains acleanentry for the givenJobID.- Specified by:
hasCleanJobResultEntryAsyncin interfaceJobResultStore- Parameters:
jobId- Ident of the job we wish to check the store for.- Returns:
- a successfully completed future with
true, if acleanentry exists for the givenJobID; otherwise a successfully completed future withfalse.
-
hasCleanJobResultEntryInternal
protected abstract boolean hasCleanJobResultEntryInternal(org.apache.flink.api.common.JobID jobId) throws IOException - Throws:
IOException
-
getDirtyResults
Description copied from interface:JobResultStoreGet the persistedJobResultinstances that are marked asdirty. This is useful for recovery of finalization steps.- Specified by:
getDirtyResultsin interfaceJobResultStore- Returns:
- A set of dirty
JobResultsfrom the store. - Throws:
IOException- if collecting the set of dirty results failed for IO reasons.
-
getDirtyResultsInternal
- Throws:
IOException
-