Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
ppanopticon committed Mar 28, 2024
2 parents 21e5229 + d03add3 commit 6814ccf
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 12 deletions.
2 changes: 1 addition & 1 deletion cottontaildb-dbms/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ dependencies {
application {
applicationName = 'cottontaildb'
mainClassName = 'org.vitrivr.cottontail.CottontailKt'
applicationDefaultJvmArgs = ["-Xms2G", "-Xmx4G"]
applicationDefaultJvmArgs = ['--add-opens', 'java.base/sun.nio.ch=ALL-UNNAMED', "-Xms2G", "-Xmx4G"]
}

/* Publication of Cottontail DB to Maven Central. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ import org.vitrivr.cottontail.dbms.queries.operators.physical.definition.*
import org.vitrivr.cottontail.dbms.queries.operators.physical.sort.InMemorySortPhysicalOperatorNode
import org.vitrivr.cottontail.dbms.schema.Schema
import org.vitrivr.cottontail.grpc.CottontailGrpc
import org.vitrivr.cottontail.grpc.CottontailGrpc.ColumnDefinition.Compression.NONE
import org.vitrivr.cottontail.grpc.CottontailGrpc.ColumnDefinition.Compression.SNAPPY
import org.vitrivr.cottontail.grpc.CottontailGrpc.ColumnDefinition.Compression.*
import org.vitrivr.cottontail.grpc.DDLGrpcKt
import org.vitrivr.cottontail.storage.serializers.tablets.Compression
import kotlin.time.ExperimentalTime
Expand Down Expand Up @@ -69,9 +68,9 @@ class DDLService(override val catalogue: DefaultCatalogue, val autoRebuilderServ
val type = Types.forName(it.type.name, it.length)
val name = entityName.column(it.name.name) /* To make sure that columns belongs to entity. */
val compression = when (it.compression) {
NONE -> Compression.NONE
SNAPPY -> Compression.SNAPPY
else -> Compression.LZ4
LZ4 -> Compression.LZ4
else -> Compression.NONE
}
name to ColumnMetadata(type, compression, it.nullable, it.primary, it.autoIncrement)
}
Expand Down
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 6814ccf

Please sign in to comment.