Skip to content

Commit

Permalink
Update aircompressor v3 to 3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
wendigo committed Oct 3, 2024
1 parent bdc8432 commit 8bf23b4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

import com.google.common.base.VerifyException;
import io.airlift.compress.v3.Compressor;
import io.airlift.compress.v3.lz4.Lz4Compressor;
import io.airlift.slice.Slice;
import io.airlift.slice.SliceOutput;
import io.airlift.slice.Slices;
Expand Down Expand Up @@ -95,9 +94,6 @@ private static class SerializedPageOutput
extends SliceOutput
{
private static final int INSTANCE_SIZE = instanceSize(SerializedPageOutput.class);
// TODO: implement getRetainedSizeInBytes in Lz4Compressor
// TODO: need a fix
private static final int COMPRESSOR_RETAINED_SIZE = toIntExact(instanceSize(Lz4Compressor.class));
private static final int ENCRYPTION_KEY_RETAINED_SIZE = toIntExact(instanceSize(SecretKeySpec.class) + sizeOfByteArray(256 / 8));

private static final double MINIMUM_COMPRESSION_RATIO = 0.8;
Expand Down Expand Up @@ -483,7 +479,8 @@ private Cipher initCipher(SecretKey key)
public long getRetainedSize()
{
long size = INSTANCE_SIZE;
size += sizeOf(compressor, compressor -> COMPRESSOR_RETAINED_SIZE);
size += sizeOf(compressor, compressor -> instanceSize(compressor.getClass())
+ compressor.getRetainedSizeInBytes(uncompressedSize));
size += sizeOf(encryptionKey, encryptionKey -> ENCRYPTION_KEY_RETAINED_SIZE);
size += sizeOf(cipher, cipher -> ESTIMATED_AES_CIPHER_RETAINED_SIZE);
for (WriteBuffer buffer : buffers) {
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@
<dependency>
<groupId>io.airlift</groupId>
<artifactId>aircompressor-v3</artifactId>
<version>3.0</version>
<version>3.1</version>
</dependency>

<dependency>
Expand Down

0 comments on commit 8bf23b4

Please sign in to comment.