Package org.opensearch.core.compress
Class CompressorRegistry
java.lang.Object
org.opensearch.core.compress.CompressorRegistry
A registry that wraps a static Map singleton which holds a mapping of unique String names (typically the
compressor header as a string) to registerd
Compressor implementations.
This enables plugins, modules, extensions to register their own compression implementations through SPI
- Opensearch.internal:
- Opensearch.experimental:
-
Method Summary
Modifier and TypeMethodDescriptionstatic Compressorcompressor(BytesReference bytes) static Compressorstatic CompressorReturns the default compressorstatic CompressorgetCompressor(String name) Returns a registered compressor by its registered namestatic booleanisCompressed(BytesReference bytes) static Compressornone()static Map<String, Compressor> Returns the registered compressors as an Immutable collectionstatic BytesReferenceuncompress(BytesReference bytes) Decompress the providedBytesReference.static BytesReferenceuncompressIfNeeded(BytesReference bytes) Uncompress the provided data, data can be detected as compressed usingisCompressed(BytesReference).
-
Method Details
-
defaultCompressor
Returns the default compressor -
none
-
isCompressed
-
compressor
-
compressorForWritable
- Parameters:
bytes- The bytes to check the compression for- Returns:
- The detected compressor. If no compressor detected then return NoneCompressor.
-
uncompress
Decompress the providedBytesReference.- Throws:
IOException
-
uncompressIfNeeded
Uncompress the provided data, data can be detected as compressed usingisCompressed(BytesReference).- Throws:
IOException
-
getCompressor
Returns a registered compressor by its registered name -
registeredCompressors
Returns the registered compressors as an Immutable collectionnote: used for testing
-