public abstract class AbstractThreadsafeJobResultStore extends Object implements JobResultStore
JobResultStore
.Constructor and Description |
---|
AbstractThreadsafeJobResultStore() |
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. |
protected abstract void |
createDirtyResultInternal(JobResultEntry jobResultEntry) |
Set<JobResult> |
getDirtyResults()
Get the persisted
JobResult instances that are marked as dirty . |
protected abstract Set<JobResult> |
getDirtyResultsInternal() |
boolean |
hasCleanJobResultEntry(JobID jobId)
Returns whether the store already contains a
clean entry for the given JobID . |
protected abstract boolean |
hasCleanJobResultEntryInternal(JobID jobId) |
boolean |
hasDirtyJobResultEntry(JobID jobId)
Returns whether the store already contains a
dirty entry for the given JobID . |
protected abstract boolean |
hasDirtyJobResultEntryInternal(JobID jobId) |
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 . |
protected abstract void |
markResultAsCleanInternal(JobID jobId) |
public void createDirtyResult(JobResultEntry jobResultEntry) throws IOException
JobResultStore
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 JobResultStore.markResultAsClean(JobID)
.createDirtyResult
in interface JobResultStore
jobResultEntry
- The job result we wish to persist.IOException
- if the creation of the dirty result failed for IO reasons.protected abstract void createDirtyResultInternal(JobResultEntry jobResultEntry) throws IOException
IOException
public void markResultAsClean(JobID jobId) throws IOException, NoSuchElementException
JobResultStore
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.markResultAsClean
in interface JobResultStore
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
.protected abstract void markResultAsCleanInternal(JobID jobId) throws IOException, NoSuchElementException
IOException
NoSuchElementException
public boolean hasJobResultEntry(JobID jobId) throws IOException
JobResultStore
hasJobResultEntry
in interface JobResultStore
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.public boolean hasDirtyJobResultEntry(JobID jobId) throws IOException
JobResultStore
dirty
entry for the given JobID
.hasDirtyJobResultEntry
in interface JobResultStore
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.protected abstract boolean hasDirtyJobResultEntryInternal(JobID jobId) throws IOException
IOException
public boolean hasCleanJobResultEntry(JobID jobId) throws IOException
JobResultStore
clean
entry for the given JobID
.hasCleanJobResultEntry
in interface JobResultStore
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.protected abstract boolean hasCleanJobResultEntryInternal(JobID jobId) throws IOException
IOException
public Set<JobResult> getDirtyResults() throws IOException
JobResultStore
JobResult
instances that are marked as dirty
. This is
useful for recovery of finalization steps.getDirtyResults
in interface JobResultStore
JobResults
from the store.IOException
- if collecting the set of dirty results failed for IO reasons.protected abstract Set<JobResult> getDirtyResultsInternal() throws IOException
IOException
Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.