@Internal public interface JobResultStore
dirty
- indicating that the corresponding job is not properly cleaned up, yet.
clean
- indicating that the cleanup of the corresponding job is performed and no
further actions need to be applied.
Modifier and Type | Method and Description |
---|---|
void |
createDirtyResult(JobResultEntry jobResultEntry)
Registers the passed
JobResultEntry instance as dirty which indicates that
clean-up operations still need to be performed. |
Set<JobResult> |
getDirtyResults()
Get the persisted
JobResult instances that are marked as dirty . |
boolean |
hasCleanJobResultEntry(JobID jobId)
Returns whether the store already contains a
clean entry for the given JobID . |
boolean |
hasDirtyJobResultEntry(JobID jobId)
Returns whether the store already contains a
dirty entry for the given JobID . |
default boolean |
hasJobResultEntry(JobID jobId)
Returns whether the store already contains an entry for a job.
|
void |
markResultAsClean(JobID jobId)
Marks an existing
JobResultEntry as clean . |
void createDirtyResult(JobResultEntry jobResultEntry) throws IOException, IllegalStateException
JobResultEntry
instance as dirty
which indicates that
clean-up operations still need to be performed. Once the job resource cleanup has been
finalized, we can mark the JobResultEntry
as clean
result using markResultAsClean(JobID)
.jobResultEntry
- The job result we wish to persist.IOException
- if the creation of the dirty result failed for IO reasons.IllegalStateException
- if the passed jobResultEntry
has a JobID
attached that is already registered in this JobResultStore
.void markResultAsClean(JobID jobId) throws IOException, NoSuchElementException
JobResultEntry
as clean
. This indicates that no more
resource cleanup steps need to be performed. No actions should be triggered if the passed
JobID
belongs to a job that was already marked as clean.jobId
- Ident of the job we wish to mark as clean.IOException
- if marking the dirty
JobResultEntry
as clean
failed for IO reasons.NoSuchElementException
- if there is no corresponding dirty
job present in the
store for the given JobID
.default boolean hasJobResultEntry(JobID jobId) throws IOException
jobId
- Ident of the job we wish to check the store for.true
if a dirty
or clean
JobResultEntry
exists for
the given JobID
; otherwise false
.IOException
- if determining whether a job entry is present in the store failed for IO
reasons.boolean hasDirtyJobResultEntry(JobID jobId) throws IOException
dirty
entry for the given JobID
.jobId
- Ident of the job we wish to check the store for.true
, if a dirty
entry exists for the given JobID
; otherwise
false
.IOException
- if determining whether a job entry is present in the store failed for IO
reasons.boolean hasCleanJobResultEntry(JobID jobId) throws IOException
clean
entry for the given JobID
.jobId
- Ident of the job we wish to check the store for.true
, if a clean
entry exists for the given JobID
; otherwise
false
.IOException
- if determining whether a job entry is present in the store failed for IO
reasons.Set<JobResult> getDirtyResults() throws IOException
JobResult
instances that are marked as dirty
. This is
useful for recovery of finalization steps.JobResults
from the store.IOException
- if collecting the set of dirty results failed for IO reasons.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.