public abstract class ExecutorCompressor extends java.lang.Object implements Compressor
| Constructor and Description |
|---|
ExecutorCompressor(java.util.concurrent.Executor executor)
Compressor that delegates execution into the given executor.
|
| Modifier and Type | Method and Description |
|---|---|
com.google.common.util.concurrent.ListenableFuture<CompressionResult> |
compress(CloseableByteSource source,
ByteStorage storage)
Compresses an entry source.
|
protected abstract CompressionResult |
immediateCompress(CloseableByteSource source,
ByteStorage storage)
Immediately compresses a source.
|
public ExecutorCompressor(java.util.concurrent.Executor executor)
executor - the executor that will do the compresspublic com.google.common.util.concurrent.ListenableFuture<CompressionResult> compress(CloseableByteSource source, ByteStorage storage)
Compressorcompress in interface Compressorsource - the source to compressstorage - a byte storage from where the compressor can obtain byte sources to workprotected abstract CompressionResult immediateCompress(CloseableByteSource source, ByteStorage storage) throws java.lang.Exception
source - the source to compressstorage - a byte storage where the compressor can obtain data sources fromjava.lang.Exception - failed to compress