Package org.apache.flink.runtime.state
Class StreamCompressionDecorator
java.lang.Object
org.apache.flink.runtime.state.StreamCompressionDecorator
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
SnappyStreamCompressionDecorator,UncompressedStreamCompressionDecorator
Implementations of this interface decorate streams with a compression scheme. Subclasses should
be stateless.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal InputStreamdecorateWithCompression(InputStream stream) IMPORTANT: For streams returned by this method,InputStream.close()is not propagated to the inner stream.final OutputStreamdecorateWithCompression(OutputStream stream) Decorates the stream by wrapping it into a stream that applies a compression.protected abstract InputStreamprotected abstract OutputStream
-
Constructor Details
-
StreamCompressionDecorator
public StreamCompressionDecorator()
-
-
Method Details
-
decorateWithCompression
Decorates the stream by wrapping it into a stream that applies a compression.IMPORTANT: For streams returned by this method,
OutputStream.close()is not propagated to the inner stream. The inner stream must be closed separately.- Parameters:
stream- the stream to decorate.- Returns:
- an output stream that is decorated by the compression scheme.
- Throws:
IOException
-
decorateWithCompression
IMPORTANT: For streams returned by this method,InputStream.close()is not propagated to the inner stream. The inner stream must be closed separately.- Parameters:
stream- the stream to decorate.- Returns:
- an input stream that is decorated by the compression scheme.
- Throws:
IOException
-
decorateWithCompression
protected abstract OutputStream decorateWithCompression(NonClosingOutputStreamDecorator stream) throws IOException - Parameters:
stream- the stream to decorate- Returns:
- an output stream that is decorated by the compression scheme.
- Throws:
IOException
-
decorateWithCompression
protected abstract InputStream decorateWithCompression(NonClosingInputStreamDecorator stream) throws IOException - Parameters:
stream- the stream to decorate.- Returns:
- an input stream that is decorated by the compression scheme.
- Throws:
IOException
-