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
@Internal public abstract class StreamCompressionDecorator extends Object implements Serializable
Implementations of this interface decorate streams with a compression scheme. Subclasses should be stateless.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description StreamCompressionDecorator()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description InputStreamdecorateWithCompression(InputStream stream)IMPORTANT: For streams returned by this method,InputStream.close()is not propagated to the inner stream.OutputStreamdecorateWithCompression(OutputStream stream)Decorates the stream by wrapping it into a stream that applies a compression.protected abstract InputStreamdecorateWithCompression(NonClosingInputStreamDecorator stream)protected abstract OutputStreamdecorateWithCompression(NonClosingOutputStreamDecorator stream)
-
-
-
Method Detail
-
decorateWithCompression
public final OutputStream decorateWithCompression(OutputStream stream) throws IOException
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
public final InputStream decorateWithCompression(InputStream stream) throws IOException
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
-
-