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:
  • Constructor Details

    • StreamCompressionDecorator

      public StreamCompressionDecorator()
  • Method Details

    • 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