Class AbstractThreadsafeJobResultStore
- java.lang.Object
-
- org.apache.flink.runtime.highavailability.AbstractThreadsafeJobResultStore
-
- All Implemented Interfaces:
JobResultStore
- Direct Known Subclasses:
EmbeddedJobResultStore,FileSystemJobResultStore
public abstract class AbstractThreadsafeJobResultStore extends Object implements JobResultStore
An abstract class for threadsafe implementations of theJobResultStore.
-
-
Constructor Summary
Constructors Constructor Description AbstractThreadsafeJobResultStore()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidcreateDirtyResult(JobResultEntry jobResultEntry)Registers the passedJobResultEntryinstance asdirtywhich indicates that clean-up operations still need to be performed.protected abstract voidcreateDirtyResultInternal(JobResultEntry jobResultEntry)Set<JobResult>getDirtyResults()Get the persistedJobResultinstances that are marked asdirty.protected abstract Set<JobResult>getDirtyResultsInternal()booleanhasCleanJobResultEntry(org.apache.flink.api.common.JobID jobId)Returns whether the store already contains acleanentry for the givenJobID.protected abstract booleanhasCleanJobResultEntryInternal(org.apache.flink.api.common.JobID jobId)booleanhasDirtyJobResultEntry(org.apache.flink.api.common.JobID jobId)Returns whether the store already contains adirtyentry for the givenJobID.protected abstract booleanhasDirtyJobResultEntryInternal(org.apache.flink.api.common.JobID jobId)booleanhasJobResultEntry(org.apache.flink.api.common.JobID jobId)Returns whether the store already contains an entry for a job.voidmarkResultAsClean(org.apache.flink.api.common.JobID jobId)Marks an existingJobResultEntryasclean.protected abstract voidmarkResultAsCleanInternal(org.apache.flink.api.common.JobID jobId)
-
-
-
Method Detail
-
createDirtyResult
public void createDirtyResult(JobResultEntry jobResultEntry) throws IOException
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.markResultAsClean(JobID).- Specified by:
createDirtyResultin interfaceJobResultStore- Parameters:
jobResultEntry- The job result we wish to persist.- Throws:
IOException- if the creation of the dirty result failed for IO reasons.
-
createDirtyResultInternal
protected abstract void createDirtyResultInternal(JobResultEntry jobResultEntry) throws IOException
- Throws:
IOException
-
markResultAsClean
public void markResultAsClean(org.apache.flink.api.common.JobID jobId) throws IOException, NoSuchElementExceptionDescription 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:
markResultAsCleanin interfaceJobResultStore- Parameters:
jobId- Ident of the job we wish to mark as clean.- Throws:
IOException- if marking thedirtyJobResultEntryascleanfailed for IO reasons.NoSuchElementException- if 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
-
hasJobResultEntry
public boolean hasJobResultEntry(org.apache.flink.api.common.JobID jobId) throws IOExceptionDescription copied from interface:JobResultStoreReturns whether the store already contains an entry for a job.- Specified by:
hasJobResultEntryin interfaceJobResultStore- Parameters:
jobId- Ident of the job we wish to check the store for.- Returns:
trueif adirtyorcleanJobResultEntryexists for the givenJobID; otherwisefalse.- Throws:
IOException- if determining whether a job entry is present in the store failed for IO reasons.
-
hasDirtyJobResultEntry
public boolean hasDirtyJobResultEntry(org.apache.flink.api.common.JobID jobId) throws IOExceptionDescription copied from interface:JobResultStoreReturns whether the store already contains adirtyentry for the givenJobID.- Specified by:
hasDirtyJobResultEntryin interfaceJobResultStore- Parameters:
jobId- Ident of the job we wish to check the store for.- Returns:
true, if adirtyentry exists for the givenJobID; otherwisefalse.- Throws:
IOException- if determining whether a job entry is present in the store failed for IO reasons.
-
hasDirtyJobResultEntryInternal
protected abstract boolean hasDirtyJobResultEntryInternal(org.apache.flink.api.common.JobID jobId) throws IOException- Throws:
IOException
-
hasCleanJobResultEntry
public boolean hasCleanJobResultEntry(org.apache.flink.api.common.JobID jobId) throws IOExceptionDescription copied from interface:JobResultStoreReturns whether the store already contains acleanentry for the givenJobID.- Specified by:
hasCleanJobResultEntryin interfaceJobResultStore- Parameters:
jobId- Ident of the job we wish to check the store for.- Returns:
true, if acleanentry exists for the givenJobID; otherwisefalse.- Throws:
IOException- if determining whether a job entry is present in the store failed for IO reasons.
-
hasCleanJobResultEntryInternal
protected abstract boolean hasCleanJobResultEntryInternal(org.apache.flink.api.common.JobID jobId) throws IOException- Throws:
IOException
-
getDirtyResults
public Set<JobResult> getDirtyResults() throws IOException
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
protected abstract Set<JobResult> getDirtyResultsInternal() throws IOException
- Throws:
IOException
-
-