Package com.linkedin.venice.compression
Class NoopCompressor
- java.lang.Object
-
- com.linkedin.venice.compression.VeniceCompressor
-
- com.linkedin.venice.compression.NoopCompressor
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class NoopCompressor extends VeniceCompressor
Locking is not necessary forNoopCompressor
, so this class overrides all the public APIs to avoid locking.
-
-
Field Summary
-
Fields inherited from class com.linkedin.venice.compression.VeniceCompressor
SCHEMA_HEADER_LENGTH
-
-
Constructor Summary
Constructors Constructor Description NoopCompressor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
protected void
closeInternal()
byte[]
compress(byte[] data)
java.nio.ByteBuffer
compress(java.nio.ByteBuffer data, int startPositionOfOutput)
protected byte[]
compressInternal(byte[] data)
protected java.nio.ByteBuffer
compressInternal(java.nio.ByteBuffer src, int startPositionOfOutput)
java.nio.ByteBuffer
decompress(byte[] data, int offset, int length)
java.io.InputStream
decompress(java.io.InputStream inputStream)
java.nio.ByteBuffer
decompress(java.nio.ByteBuffer data)
java.nio.ByteBuffer
decompressAndPrependSchemaHeader(byte[] data, int offset, int length, int schemaHeader)
This method tries to decompress data and maybe prepend the schema header.protected java.nio.ByteBuffer
decompressAndPrependSchemaHeaderInternal(byte[] data, int offset, int length, int schemaHeader)
protected java.nio.ByteBuffer
decompressInternal(byte[] data, int offset, int length)
protected java.io.InputStream
decompressInternal(java.io.InputStream inputStream)
protected java.nio.ByteBuffer
decompressInternal(java.nio.ByteBuffer data)
boolean
equals(java.lang.Object o)
int
hashCode()
-
Methods inherited from class com.linkedin.venice.compression.VeniceCompressor
getCompressionStrategy
-
-
-
-
Method Detail
-
compress
public byte[] compress(byte[] data) throws java.io.IOException
- Overrides:
compress
in classVeniceCompressor
- Throws:
java.io.IOException
-
compressInternal
protected byte[] compressInternal(byte[] data) throws java.io.IOException
- Specified by:
compressInternal
in classVeniceCompressor
- Throws:
java.io.IOException
-
compress
public java.nio.ByteBuffer compress(java.nio.ByteBuffer data, int startPositionOfOutput) throws java.io.IOException
- Overrides:
compress
in classVeniceCompressor
- Throws:
java.io.IOException
-
compressInternal
protected java.nio.ByteBuffer compressInternal(java.nio.ByteBuffer src, int startPositionOfOutput) throws java.io.IOException
- Specified by:
compressInternal
in classVeniceCompressor
- Throws:
java.io.IOException
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
decompress
public java.nio.ByteBuffer decompress(java.nio.ByteBuffer data) throws java.io.IOException
- Overrides:
decompress
in classVeniceCompressor
- Throws:
java.io.IOException
-
decompressInternal
protected java.nio.ByteBuffer decompressInternal(java.nio.ByteBuffer data) throws java.io.IOException
- Specified by:
decompressInternal
in classVeniceCompressor
- Throws:
java.io.IOException
-
decompress
public java.nio.ByteBuffer decompress(byte[] data, int offset, int length) throws java.io.IOException
- Overrides:
decompress
in classVeniceCompressor
- Throws:
java.io.IOException
-
decompressInternal
protected java.nio.ByteBuffer decompressInternal(byte[] data, int offset, int length) throws java.io.IOException
- Specified by:
decompressInternal
in classVeniceCompressor
- Throws:
java.io.IOException
-
decompressAndPrependSchemaHeader
public java.nio.ByteBuffer decompressAndPrependSchemaHeader(byte[] data, int offset, int length, int schemaHeader) throws java.io.IOException
Description copied from class:VeniceCompressor
This method tries to decompress data and maybe prepend the schema header. The returned ByteBuffer will be backed by byte array that starts with schema header, followed by the decompressed data. The ByteBuffer will be positioned at the beginning of the decompressed data and the remaining of the ByteBuffer will be the length of the decompressed data.- Overrides:
decompressAndPrependSchemaHeader
in classVeniceCompressor
- Throws:
java.io.IOException
-
decompressAndPrependSchemaHeaderInternal
protected java.nio.ByteBuffer decompressAndPrependSchemaHeaderInternal(byte[] data, int offset, int length, int schemaHeader) throws java.io.IOException
- Specified by:
decompressAndPrependSchemaHeaderInternal
in classVeniceCompressor
- Throws:
java.io.IOException
-
decompress
public java.io.InputStream decompress(java.io.InputStream inputStream) throws java.io.IOException
- Overrides:
decompress
in classVeniceCompressor
- Throws:
java.io.IOException
-
decompressInternal
protected java.io.InputStream decompressInternal(java.io.InputStream inputStream) throws java.io.IOException
- Specified by:
decompressInternal
in classVeniceCompressor
- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in classVeniceCompressor
- Throws:
java.io.IOException
-
closeInternal
protected void closeInternal() throws java.io.IOException
- Specified by:
closeInternal
in classVeniceCompressor
- Throws:
java.io.IOException
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
-