public abstract class AbstractAsyncSnapshotIOCallable<H extends StateObject> extends AbstractAsyncIOCallable<H,CheckpointStreamFactory.CheckpointStateOutputStream>
CheckedOutputStream
. This includes participating in lifecycle management
through a CloseableRegistry
.Modifier and Type | Field and Description |
---|---|
protected long |
checkpointId |
protected CloseableRegistry |
closeStreamOnCancelRegistry |
protected AtomicBoolean |
open |
protected CheckpointStreamFactory |
streamFactory |
protected long |
timestamp |
Constructor and Description |
---|
AbstractAsyncSnapshotIOCallable(long checkpointId,
long timestamp,
CheckpointStreamFactory streamFactory,
CloseableRegistry closeStreamOnCancelRegistry) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
checkStreamClosedAndDoTransitionToOpen() |
protected boolean |
checkStreamOpenAndDoTransitionToClose() |
protected StreamStateHandle |
closeStreamAndGetStateHandle() |
void |
done(boolean canceled)
Optional callback that subclasses can implement.
|
CheckpointStreamFactory.CheckpointStateOutputStream |
openIOHandle()
Open the IO Handle (e.g.
|
call, getIoHandle, getStopException, isStopped, performOperation, stop
protected final long checkpointId
protected final long timestamp
protected final CheckpointStreamFactory streamFactory
protected final CloseableRegistry closeStreamOnCancelRegistry
protected final AtomicBoolean open
public AbstractAsyncSnapshotIOCallable(long checkpointId, long timestamp, CheckpointStreamFactory streamFactory, CloseableRegistry closeStreamOnCancelRegistry)
public CheckpointStreamFactory.CheckpointStateOutputStream openIOHandle() throws Exception
AbstractAsyncIOCallable
openIOHandle
in class AbstractAsyncIOCallable<H extends StateObject,CheckpointStreamFactory.CheckpointStateOutputStream>
Exception
public void done(boolean canceled)
AbstractAsyncIOCallable
done
in interface AsyncDoneCallback
done
in class AbstractAsyncIOCallable<H extends StateObject,CheckpointStreamFactory.CheckpointStateOutputStream>
canceled
- true if the callback is done, but was canceledprotected boolean checkStreamClosedAndDoTransitionToOpen()
protected boolean checkStreamOpenAndDoTransitionToClose()
protected StreamStateHandle closeStreamAndGetStateHandle() throws IOException
IOException
Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.