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 CheckpointStateOutputStream
delegate
-
Constructor Summary
Constructors Constructor Description NonClosingCheckpointOutputStream(CheckpointStateOutputStream delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResourceGuard.Lease
acquireLease()
Returns aResourceGuard.Lease
that prevents closing this stream.void
close()
void
flush()
void
write(byte[] b)
void
write(byte[] b, int off, int len)
void
write(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:
flush
in interfaceFlushable
- Overrides:
flush
in classOutputStream
- Throws:
IOException
-
write
public void write(int b) throws IOException
- Specified by:
write
in classOutputStream
- Throws:
IOException
-
write
public void write(byte[] b) throws IOException
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
write
public void write(byte[] b, int off, int len) throws IOException
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStream
- Throws:
IOException
-
acquireLease
public final ResourceGuard.Lease acquireLease() throws IOException
Returns aResourceGuard.Lease
that 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
-
-