public abstract class AbstractThreadsafeJobResultStore extends Object implements JobResultStore
JobResultStore
.Modifier | Constructor and Description |
---|---|
protected |
AbstractThreadsafeJobResultStore(Executor ioExecutor) |
Modifier and Type | Method and Description |
---|---|
CompletableFuture<Void> |
createDirtyResultAsync(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() |
CompletableFuture<Boolean> |
hasCleanJobResultEntryAsync(JobID jobId)
Returns the future of whether the store contains a
clean entry for the given JobID . |
protected abstract boolean |
hasCleanJobResultEntryInternal(JobID jobId) |
CompletableFuture<Boolean> |
hasDirtyJobResultEntryAsync(JobID jobId)
Returns the future of whether the store contains a
dirty entry for the given JobID . |
protected abstract boolean |
hasDirtyJobResultEntryInternal(JobID jobId) |
CompletableFuture<Boolean> |
hasJobResultEntryAsync(JobID jobId)
Returns the future of whether the store already contains an entry for a job.
|
CompletableFuture<Void> |
markResultAsCleanAsync(JobID jobId)
Marks an existing
JobResultEntry as clean . |
protected abstract void |
markResultAsCleanInternal(JobID jobId) |
protected AbstractThreadsafeJobResultStore(Executor ioExecutor)
public CompletableFuture<Void> createDirtyResultAsync(JobResultEntry jobResultEntry)
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.markResultAsCleanAsync(JobID)
.createDirtyResultAsync
in interface JobResultStore
jobResultEntry
- The job result we wish to persist.IllegalStateException
if the passed jobResultEntry
has a JobID
attached that is already registered in this JobResultStore
.protected abstract void createDirtyResultInternal(JobResultEntry jobResultEntry) throws IOException
IOException
public CompletableFuture<Void> markResultAsCleanAsync(JobID jobId)
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.markResultAsCleanAsync
in interface JobResultStore
jobId
- Ident of the job we wish to mark as clean.NoSuchElementException
. i.e. 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 CompletableFuture<Boolean> hasJobResultEntryAsync(JobID jobId)
JobResultStore
hasJobResultEntryAsync
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
.public CompletableFuture<Boolean> hasDirtyJobResultEntryAsync(JobID jobId)
JobResultStore
dirty
entry for the given JobID
.hasDirtyJobResultEntryAsync
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
.protected abstract boolean hasDirtyJobResultEntryInternal(JobID jobId) throws IOException
IOException
public CompletableFuture<Boolean> hasCleanJobResultEntryAsync(JobID jobId)
JobResultStore
clean
entry for the given JobID
.hasCleanJobResultEntryAsync
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 a successfully completed future with false
.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–2024 The Apache Software Foundation. All rights reserved.