Package org.apache.flink.runtime.state
Class NonClosingCheckpointOutputStream<T extends StreamStateHandle>
- java.lang.Object
-
- java.io.OutputStream
-
- org.apache.flink.runtime.state.NonClosingCheckpointOutputStream<T>
-
- Type Parameters:
T- type of the returned state handle.
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
- Direct Known Subclasses:
KeyedStateCheckpointOutputStream,OperatorStateCheckpointOutputStream
public abstract class NonClosingCheckpointOutputStream<T extends StreamStateHandle> extends OutputStream
Abstract class to implement custom checkpoint output streams which should not be closable for user code.
-
-
Field Summary
Fields Modifier and Type Field Description protected CheckpointStateOutputStreamdelegate
-
Constructor Summary
Constructors Constructor Description NonClosingCheckpointOutputStream(CheckpointStateOutputStream delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.flink.util.ResourceGuard.LeaseacquireLease()Returns aResourceGuard.Leasethat prevents closing this stream.voidclose()voidflush()voidwrite(byte[] b)voidwrite(byte[] b, int off, int len)voidwrite(int b)-
Methods inherited from class java.io.OutputStream
nullOutputStream
-
-
-
-
Field Detail
-
delegate
protected final CheckpointStateOutputStream delegate
-
-
Constructor Detail
-
NonClosingCheckpointOutputStream
public NonClosingCheckpointOutputStream(CheckpointStateOutputStream delegate)
-
-
Method Detail
-
flush
public void flush() throws IOException- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream- Throws:
IOException
-
write
public void write(int b) throws IOException- Specified by:
writein classOutputStream- Throws:
IOException
-
write
public void write(byte[] b) throws IOException- Overrides:
writein classOutputStream- Throws:
IOException
-
write
public void write(byte[] b, int off, int len) throws IOException- Overrides:
writein classOutputStream- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-
acquireLease
public final org.apache.flink.util.ResourceGuard.Lease acquireLease() throws IOExceptionReturns aResourceGuard.Leasethat prevents closing this stream. To allow the system to close this stream, each of the acquired leases need to callResourceGuard.Lease.close(), on their acquired leases.- Throws:
IOException
-
-