From 17622ec39dc9137a29a99162f09aa739447515a5 Mon Sep 17 00:00:00 2001 From: Ralph Gasser Date: Mon, 18 Mar 2024 14:43:22 +0100 Subject: [PATCH] Fixes weird reference to LZ4Factory in TabletSerializer interface. --- .../storage/serializers/tablets/LZ4TabletSerializer.kt | 5 +++-- .../storage/serializers/tablets/TabletSerializer.kt | 5 ----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/cottontaildb-dbms/src/main/kotlin/org/vitrivr/cottontail/storage/serializers/tablets/LZ4TabletSerializer.kt b/cottontaildb-dbms/src/main/kotlin/org/vitrivr/cottontail/storage/serializers/tablets/LZ4TabletSerializer.kt index d67af6038..d1b21df48 100644 --- a/cottontaildb-dbms/src/main/kotlin/org/vitrivr/cottontail/storage/serializers/tablets/LZ4TabletSerializer.kt +++ b/cottontaildb-dbms/src/main/kotlin/org/vitrivr/cottontail/storage/serializers/tablets/LZ4TabletSerializer.kt @@ -3,6 +3,7 @@ package org.vitrivr.cottontail.storage.serializers.tablets import jetbrains.exodus.ArrayByteIterable import jetbrains.exodus.ByteIterable import net.jpountz.lz4.LZ4Compressor +import net.jpountz.lz4.LZ4Factory import org.vitrivr.cottontail.core.types.Types import org.vitrivr.cottontail.core.types.Value import org.vitrivr.cottontail.core.values.DoubleVectorValue @@ -22,10 +23,10 @@ import java.nio.ByteBuffer class LZ4TabletSerializer(override val type: Types, val size: Int): TabletSerializer { /** The [LZ4Compressor] instance used by this [LZ4TabletSerializer]. */ - private val compressor: LZ4Compressor = TabletSerializer.FACTORY.highCompressor() + private val compressor: LZ4Compressor = LZ4Factory.fastestInstance().highCompressor() /** The [LZ4Compressor] instance used by this [LZ4TabletSerializer]. */ - private val decompressor = TabletSerializer.FACTORY.fastDecompressor() + private val decompressor = LZ4Factory.fastestInstance().fastDecompressor() /** Internal buffer used to store compressed data. */ private val compressBuffer: ByteBuffer = ByteBuffer.allocate(this.compressor.maxCompressedLength( this.size.shr(3) + when(type) { diff --git a/cottontaildb-dbms/src/main/kotlin/org/vitrivr/cottontail/storage/serializers/tablets/TabletSerializer.kt b/cottontaildb-dbms/src/main/kotlin/org/vitrivr/cottontail/storage/serializers/tablets/TabletSerializer.kt index 2bca53742..158587d28 100644 --- a/cottontaildb-dbms/src/main/kotlin/org/vitrivr/cottontail/storage/serializers/tablets/TabletSerializer.kt +++ b/cottontaildb-dbms/src/main/kotlin/org/vitrivr/cottontail/storage/serializers/tablets/TabletSerializer.kt @@ -15,11 +15,6 @@ import org.vitrivr.cottontail.core.values.tablets.Tablet */ interface TabletSerializer { - companion object { - /** The [LZ4Factory] instance used. */ - val FACTORY: LZ4Factory = LZ4Factory.fastestInstance() - } - /** The [Types] converted by this [TabletSerializer]. */ val type: Types