Skip to content

Commit

Permalink
Fixes weird reference to LZ4Factory in TabletSerializer interface.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralph Gasser committed Mar 18, 2024
1 parent e489215 commit 17622ec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -22,10 +23,10 @@ import java.nio.ByteBuffer
class LZ4TabletSerializer<T: Value>(override val type: Types<T>, val size: Int): TabletSerializer<T> {

/** 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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ import org.vitrivr.cottontail.core.values.tablets.Tablet
*/
interface TabletSerializer<T: Value> {

companion object {
/** The [LZ4Factory] instance used. */
val FACTORY: LZ4Factory = LZ4Factory.fastestInstance()
}

/** The [Types] converted by this [TabletSerializer]. */
val type: Types<T>

Expand Down

0 comments on commit 17622ec

Please sign in to comment.