Class ExecutorCompressor

    • Constructor Detail

      • ExecutorCompressor

        public ExecutorCompressor​(java.util.concurrent.Executor executor)
        Compressor that delegates execution into the given executor.
        Parameters:
        executor - the executor that will do the compress
    • Method Detail

      • compress

        public com.google.common.util.concurrent.ListenableFuture<CompressionResult> compress​(CloseableByteSource source,
                                                                                              ByteStorage storage)
        Description copied from interface: Compressor
        Compresses an entry source.
        Specified by:
        compress in interface Compressor
        Parameters:
        source - the source to compress
        storage - a byte storage from where the compressor can obtain byte sources to work
        Returns:
        a future that will eventually contain the compression result
      • immediateCompress

        protected abstract CompressionResult immediateCompress​(CloseableByteSource source,
                                                               ByteStorage storage)
                                                        throws java.lang.Exception
        Immediately compresses a source.
        Parameters:
        source - the source to compress
        storage - a byte storage where the compressor can obtain data sources from
        Returns:
        the result of compression
        Throws:
        java.lang.Exception - failed to compress