Update lucene and netty 5
This commit is contained in:
parent
b33bafec21
commit
78ba98c8c4
4
pom.xml
4
pom.xml
@ -13,7 +13,7 @@
|
|||||||
<revision>0-SNAPSHOT</revision>
|
<revision>0-SNAPSHOT</revision>
|
||||||
<dbengine.ci>false</dbengine.ci>
|
<dbengine.ci>false</dbengine.ci>
|
||||||
<micrometer.version>1.9.3</micrometer.version>
|
<micrometer.version>1.9.3</micrometer.version>
|
||||||
<lucene.version>9.3.0</lucene.version>
|
<lucene.version>9.4.0</lucene.version>
|
||||||
<junit.jupiter.version>5.9.0</junit.jupiter.version>
|
<junit.jupiter.version>5.9.0</junit.jupiter.version>
|
||||||
</properties>
|
</properties>
|
||||||
<repositories>
|
<repositories>
|
||||||
@ -120,7 +120,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.netty</groupId>
|
<groupId>io.netty</groupId>
|
||||||
<artifactId>netty5-buffer</artifactId>
|
<artifactId>netty5-buffer</artifactId>
|
||||||
<version>5.0.0.Alpha4</version>
|
<version>5.0.0.Alpha5</version>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>io.netty</groupId>
|
<groupId>io.netty</groupId>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package it.cavallium.dbengine;
|
package it.cavallium.dbengine;
|
||||||
|
|
||||||
import io.netty5.buffer.api.pool.PoolArenaMetric;
|
import io.netty5.buffer.pool.PoolArenaMetric;
|
||||||
import io.netty5.buffer.api.pool.PooledBufferAllocator;
|
import io.netty5.buffer.pool.PooledBufferAllocator;
|
||||||
import java.lang.invoke.MethodHandle;
|
import java.lang.invoke.MethodHandle;
|
||||||
import java.lang.invoke.MethodHandles;
|
import java.lang.invoke.MethodHandles;
|
||||||
import java.lang.invoke.MethodType;
|
import java.lang.invoke.MethodType;
|
||||||
@ -24,7 +24,7 @@ public class MetricUtils {
|
|||||||
MethodHandle handle = null;
|
MethodHandle handle = null;
|
||||||
try {
|
try {
|
||||||
// Find the class
|
// Find the class
|
||||||
var pooledBufferClass = Class.forName("io.netty5.buffer.api.pool.PooledBufferAllocatorMetric");
|
var pooledBufferClass = Class.forName("io.netty5.buffer.pool.PooledBufferAllocatorMetric");
|
||||||
// Find the handle of the method
|
// Find the handle of the method
|
||||||
handle = lookup.findVirtual(pooledBufferClass, "arenaMetrics", MethodType.methodType(List.class));
|
handle = lookup.findVirtual(pooledBufferClass, "arenaMetrics", MethodType.methodType(List.class));
|
||||||
} catch (NoSuchMethodException | IllegalAccessException | ClassNotFoundException ex) {
|
} catch (NoSuchMethodException | IllegalAccessException | ClassNotFoundException ex) {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package it.cavallium.dbengine.client;
|
package it.cavallium.dbengine.client;
|
||||||
|
|
||||||
import io.micrometer.core.instrument.MeterRegistry;
|
import io.micrometer.core.instrument.MeterRegistry;
|
||||||
import io.netty5.buffer.api.BufferAllocator;
|
import io.netty5.buffer.BufferAllocator;
|
||||||
import it.cavallium.dbengine.database.DatabaseProperties;
|
import it.cavallium.dbengine.database.DatabaseProperties;
|
||||||
import reactor.core.publisher.Flux;
|
import reactor.core.publisher.Flux;
|
||||||
import reactor.core.publisher.Mono;
|
import reactor.core.publisher.Mono;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package it.cavallium.dbengine.client;
|
package it.cavallium.dbengine.client;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import io.netty5.util.Send;
|
import io.netty5.util.Send;
|
||||||
import it.cavallium.dbengine.database.serialization.SerializationException;
|
import it.cavallium.dbengine.database.serialization.SerializationException;
|
||||||
import it.cavallium.dbengine.database.serialization.Serializer;
|
import it.cavallium.dbengine.database.serialization.Serializer;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package it.cavallium.dbengine.client;
|
package it.cavallium.dbengine.client;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import io.netty5.util.Send;
|
import io.netty5.util.Send;
|
||||||
import it.cavallium.dbengine.database.serialization.SerializationException;
|
import it.cavallium.dbengine.database.serialization.SerializationException;
|
||||||
import it.cavallium.dbengine.database.serialization.SerializerFixedBinaryLength;
|
import it.cavallium.dbengine.database.serialization.SerializerFixedBinaryLength;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package it.cavallium.dbengine.database;
|
package it.cavallium.dbengine.database;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import io.netty5.util.Send;
|
import io.netty5.util.Send;
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package it.cavallium.dbengine.database;
|
package it.cavallium.dbengine.database;
|
||||||
|
|
||||||
import io.micrometer.core.instrument.MeterRegistry;
|
import io.micrometer.core.instrument.MeterRegistry;
|
||||||
import io.netty5.buffer.api.BufferAllocator;
|
import io.netty5.buffer.BufferAllocator;
|
||||||
import it.cavallium.dbengine.lucene.LuceneHacks;
|
import it.cavallium.dbengine.lucene.LuceneHacks;
|
||||||
import it.cavallium.dbengine.lucene.LuceneRocksDBManager;
|
import it.cavallium.dbengine.lucene.LuceneRocksDBManager;
|
||||||
import it.cavallium.dbengine.rpc.current.data.Column;
|
import it.cavallium.dbengine.rpc.current.data.Column;
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
package it.cavallium.dbengine.database;
|
package it.cavallium.dbengine.database;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import io.netty5.buffer.api.Drop;
|
import io.netty5.buffer.Drop;
|
||||||
import io.netty5.buffer.api.Owned;
|
import io.netty5.buffer.Owned;
|
||||||
import io.netty5.util.Send;
|
import io.netty5.util.Send;
|
||||||
import io.netty5.buffer.api.internal.ResourceSupport;
|
import io.netty5.buffer.internal.ResourceSupport;
|
||||||
import it.cavallium.dbengine.utils.SimpleResource;
|
import it.cavallium.dbengine.utils.SimpleResource;
|
||||||
import java.util.StringJoiner;
|
import java.util.StringJoiner;
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package it.cavallium.dbengine.database;
|
package it.cavallium.dbengine.database;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import io.netty5.buffer.api.BufferAllocator;
|
import io.netty5.buffer.BufferAllocator;
|
||||||
import io.netty5.util.Send;
|
import io.netty5.util.Send;
|
||||||
import it.cavallium.dbengine.client.BadBlock;
|
import it.cavallium.dbengine.client.BadBlock;
|
||||||
import it.cavallium.dbengine.database.disk.BinarySerializationFunction;
|
import it.cavallium.dbengine.database.disk.BinarySerializationFunction;
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
package it.cavallium.dbengine.database;
|
package it.cavallium.dbengine.database;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import io.netty5.buffer.api.Drop;
|
import io.netty5.buffer.Drop;
|
||||||
import io.netty5.buffer.api.Owned;
|
import io.netty5.buffer.Owned;
|
||||||
import io.netty5.util.Resource;
|
import io.netty5.util.Resource;
|
||||||
import io.netty5.util.Send;
|
import io.netty5.util.Send;
|
||||||
import io.netty5.buffer.api.internal.ResourceSupport;
|
import io.netty5.buffer.internal.ResourceSupport;
|
||||||
import it.cavallium.dbengine.utils.SimpleResource;
|
import it.cavallium.dbengine.utils.SimpleResource;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.StringJoiner;
|
import java.util.StringJoiner;
|
||||||
|
@ -3,7 +3,7 @@ package it.cavallium.dbengine.database;
|
|||||||
import com.google.common.primitives.Ints;
|
import com.google.common.primitives.Ints;
|
||||||
import com.google.common.primitives.Longs;
|
import com.google.common.primitives.Longs;
|
||||||
import io.micrometer.core.instrument.MeterRegistry;
|
import io.micrometer.core.instrument.MeterRegistry;
|
||||||
import io.netty5.buffer.api.BufferAllocator;
|
import io.netty5.buffer.BufferAllocator;
|
||||||
import it.cavallium.dbengine.client.IBackuppable;
|
import it.cavallium.dbengine.client.IBackuppable;
|
||||||
import it.cavallium.dbengine.client.MemoryStats;
|
import it.cavallium.dbengine.client.MemoryStats;
|
||||||
import it.cavallium.dbengine.database.collections.DatabaseInt;
|
import it.cavallium.dbengine.database.collections.DatabaseInt;
|
||||||
|
@ -2,7 +2,7 @@ package it.cavallium.dbengine.database;
|
|||||||
|
|
||||||
import com.google.common.collect.Multimap;
|
import com.google.common.collect.Multimap;
|
||||||
import io.micrometer.core.instrument.MeterRegistry;
|
import io.micrometer.core.instrument.MeterRegistry;
|
||||||
import io.netty5.buffer.api.BufferAllocator;
|
import io.netty5.buffer.BufferAllocator;
|
||||||
import it.cavallium.dbengine.client.ConnectionSettings.ConnectionPart;
|
import it.cavallium.dbengine.client.ConnectionSettings.ConnectionPart;
|
||||||
import it.cavallium.dbengine.client.ConnectionSettings.ConnectionPart.ConnectionPartLucene;
|
import it.cavallium.dbengine.client.ConnectionSettings.ConnectionPart.ConnectionPartLucene;
|
||||||
import it.cavallium.dbengine.client.ConnectionSettings.ConnectionPart.ConnectionPartRocksDB;
|
import it.cavallium.dbengine.client.ConnectionSettings.ConnectionPart.ConnectionPartRocksDB;
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
package it.cavallium.dbengine.database;
|
package it.cavallium.dbengine.database;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import io.netty5.buffer.api.Drop;
|
import io.netty5.buffer.Drop;
|
||||||
import io.netty5.buffer.api.Owned;
|
import io.netty5.buffer.Owned;
|
||||||
import io.netty5.util.Send;
|
import io.netty5.util.Send;
|
||||||
import io.netty5.buffer.api.internal.ResourceSupport;
|
import io.netty5.buffer.internal.ResourceSupport;
|
||||||
import it.cavallium.dbengine.utils.SimpleResource;
|
import it.cavallium.dbengine.utils.SimpleResource;
|
||||||
import java.util.StringJoiner;
|
import java.util.StringJoiner;
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package it.cavallium.dbengine.database;
|
package it.cavallium.dbengine.database;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Drop;
|
import io.netty5.buffer.Drop;
|
||||||
import io.netty5.buffer.api.Owned;
|
import io.netty5.buffer.Owned;
|
||||||
import io.netty5.buffer.api.internal.ResourceSupport;
|
import io.netty5.buffer.internal.ResourceSupport;
|
||||||
import it.cavallium.dbengine.client.LuceneIndexImpl;
|
import it.cavallium.dbengine.client.LuceneIndexImpl;
|
||||||
import it.cavallium.dbengine.client.query.current.data.TotalHitsCount;
|
import it.cavallium.dbengine.client.query.current.data.TotalHitsCount;
|
||||||
import it.cavallium.dbengine.lucene.LuceneCloseable;
|
import it.cavallium.dbengine.lucene.LuceneCloseable;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package it.cavallium.dbengine.database;
|
package it.cavallium.dbengine.database;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import io.netty5.buffer.api.BufferAllocator;
|
import io.netty5.buffer.BufferAllocator;
|
||||||
import io.netty5.util.Send;
|
import io.netty5.util.Send;
|
||||||
import it.cavallium.dbengine.database.disk.BinarySerializationFunction;
|
import it.cavallium.dbengine.database.disk.BinarySerializationFunction;
|
||||||
import it.cavallium.dbengine.database.serialization.SerializationFunction;
|
import it.cavallium.dbengine.database.serialization.SerializationFunction;
|
||||||
|
@ -1,21 +1,20 @@
|
|||||||
package it.cavallium.dbengine.database;
|
package it.cavallium.dbengine.database;
|
||||||
|
|
||||||
import static io.netty5.buffer.api.StandardAllocationTypes.OFF_HEAP;
|
import static io.netty5.buffer.StandardAllocationTypes.OFF_HEAP;
|
||||||
|
import static io.netty5.buffer.internal.InternalBufferUtils.NO_OP_DROP;
|
||||||
import static it.cavallium.dbengine.lucene.LuceneUtils.luceneScheduler;
|
import static it.cavallium.dbengine.lucene.LuceneUtils.luceneScheduler;
|
||||||
import static org.apache.commons.lang3.ArrayUtils.EMPTY_BYTE_ARRAY;
|
import static org.apache.commons.lang3.ArrayUtils.EMPTY_BYTE_ARRAY;
|
||||||
|
|
||||||
import com.google.common.primitives.Ints;
|
import com.google.common.primitives.Ints;
|
||||||
import com.google.common.primitives.Longs;
|
import com.google.common.primitives.Longs;
|
||||||
import io.netty5.buffer.api.AllocatorControl;
|
import io.netty5.buffer.AllocatorControl;
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import io.netty5.buffer.api.BufferAllocator;
|
import io.netty5.buffer.BufferAllocator;
|
||||||
import io.netty5.buffer.api.CompositeBuffer;
|
import io.netty5.buffer.BufferComponent;
|
||||||
import io.netty5.buffer.api.Drop;
|
import io.netty5.buffer.CompositeBuffer;
|
||||||
import io.netty5.buffer.api.ReadableComponent;
|
import io.netty5.buffer.Drop;
|
||||||
import io.netty5.util.Resource;
|
import io.netty5.util.Resource;
|
||||||
import io.netty5.util.Send;
|
import io.netty5.util.Send;
|
||||||
import io.netty5.buffer.api.WritableComponent;
|
|
||||||
import io.netty5.buffer.api.internal.Statics;
|
|
||||||
import io.netty5.util.IllegalReferenceCountException;
|
import io.netty5.util.IllegalReferenceCountException;
|
||||||
import it.cavallium.dbengine.database.serialization.SerializationException;
|
import it.cavallium.dbengine.database.serialization.SerializationException;
|
||||||
import it.cavallium.dbengine.database.serialization.SerializationFunction;
|
import it.cavallium.dbengine.database.serialization.SerializationFunction;
|
||||||
@ -534,7 +533,7 @@ public class LLUtils {
|
|||||||
try {
|
try {
|
||||||
assert directBuffer.readerOffset() == 0;
|
assert directBuffer.readerOffset() == 0;
|
||||||
assert directBuffer.writerOffset() == 0;
|
assert directBuffer.writerOffset() == 0;
|
||||||
var directBufferWriter = ((WritableComponent) directBuffer).writableBuffer();
|
var directBufferWriter = ((BufferComponent) directBuffer).writableBuffer();
|
||||||
assert directBufferWriter.position() == 0;
|
assert directBufferWriter.position() == 0;
|
||||||
assert directBufferWriter.capacity() >= directBuffer.capacity();
|
assert directBufferWriter.capacity() >= directBuffer.capacity();
|
||||||
assert directBufferWriter.isDirect();
|
assert directBufferWriter.isDirect();
|
||||||
@ -552,7 +551,7 @@ public class LLUtils {
|
|||||||
assert directBuffer.readerOffset() == 0;
|
assert directBuffer.readerOffset() == 0;
|
||||||
directBuffer.ensureWritable(trueSize);
|
directBuffer.ensureWritable(trueSize);
|
||||||
assert directBuffer.writerOffset() == 0;
|
assert directBuffer.writerOffset() == 0;
|
||||||
directBufferWriter = ((WritableComponent) directBuffer).writableBuffer();
|
directBufferWriter = ((BufferComponent) directBuffer).writableBuffer();
|
||||||
assert directBufferWriter.position() == 0;
|
assert directBufferWriter.position() == 0;
|
||||||
assert directBufferWriter.isDirect();
|
assert directBufferWriter.isDirect();
|
||||||
reader.applyAsInt(directBufferWriter.position(0));
|
reader.applyAsInt(directBufferWriter.position(0));
|
||||||
@ -783,16 +782,16 @@ public class LLUtils {
|
|||||||
|
|
||||||
private static Drop<Buffer> drop() {
|
private static Drop<Buffer> drop() {
|
||||||
// We cannot reliably drop unsafe memory. We have to rely on the cleaner to do that.
|
// We cannot reliably drop unsafe memory. We have to rely on the cleaner to do that.
|
||||||
return Statics.NO_OP_DROP;
|
return NO_OP_DROP;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isReadOnlyDirect(Buffer inputBuffer) {
|
public static boolean isReadOnlyDirect(Buffer inputBuffer) {
|
||||||
return inputBuffer.isDirect() && inputBuffer instanceof ReadableComponent;
|
return inputBuffer instanceof BufferComponent component && component.readableNativeAddress() != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ByteBuffer getReadOnlyDirect(Buffer inputBuffer) {
|
public static ByteBuffer getReadOnlyDirect(Buffer inputBuffer) {
|
||||||
assert isReadOnlyDirect(inputBuffer);
|
assert isReadOnlyDirect(inputBuffer);
|
||||||
return ((ReadableComponent) inputBuffer).readableBuffer();
|
return ((BufferComponent) inputBuffer).readableBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Buffer fromByteArray(BufferAllocator alloc, byte[] array) {
|
public static Buffer fromByteArray(BufferAllocator alloc, byte[] array) {
|
||||||
@ -967,7 +966,7 @@ public class LLUtils {
|
|||||||
if (readableComponents == 0) {
|
if (readableComponents == 0) {
|
||||||
return true;
|
return true;
|
||||||
} else if (readableComponents == 1) {
|
} else if (readableComponents == 1) {
|
||||||
return key.forEachReadable(0, (index, component) -> component.readableBuffer().isDirect()) >= 0;
|
return key.isDirect();
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package it.cavallium.dbengine.database;
|
package it.cavallium.dbengine.database;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import java.util.NoSuchElementException;
|
import java.util.NoSuchElementException;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package it.cavallium.dbengine.database.collections;
|
package it.cavallium.dbengine.database.collections;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import io.netty5.buffer.api.BufferAllocator;
|
import io.netty5.buffer.BufferAllocator;
|
||||||
import it.cavallium.dbengine.database.BufSupplier;
|
import it.cavallium.dbengine.database.BufSupplier;
|
||||||
import it.cavallium.dbengine.database.LLDictionary;
|
import it.cavallium.dbengine.database.LLDictionary;
|
||||||
import it.cavallium.dbengine.database.serialization.Serializer;
|
import it.cavallium.dbengine.database.serialization.Serializer;
|
||||||
|
@ -2,9 +2,9 @@ package it.cavallium.dbengine.database.collections;
|
|||||||
|
|
||||||
import static java.util.Objects.requireNonNullElseGet;
|
import static java.util.Objects.requireNonNullElseGet;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import io.netty5.util.Resource;
|
import io.netty5.util.Resource;
|
||||||
import io.netty5.buffer.api.internal.ResourceSupport;
|
import io.netty5.buffer.internal.ResourceSupport;
|
||||||
import it.cavallium.dbengine.client.CompositeSnapshot;
|
import it.cavallium.dbengine.client.CompositeSnapshot;
|
||||||
import it.cavallium.dbengine.database.BufSupplier;
|
import it.cavallium.dbengine.database.BufSupplier;
|
||||||
import it.cavallium.dbengine.database.Delta;
|
import it.cavallium.dbengine.database.Delta;
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
package it.cavallium.dbengine.database.collections;
|
package it.cavallium.dbengine.database.collections;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import io.netty5.buffer.api.BufferAllocator;
|
import io.netty5.buffer.BufferAllocator;
|
||||||
import io.netty5.buffer.api.DefaultBufferAllocators;
|
import io.netty5.buffer.DefaultBufferAllocators;
|
||||||
import io.netty5.buffer.api.Drop;
|
import io.netty5.buffer.Drop;
|
||||||
import io.netty5.buffer.api.Owned;
|
import io.netty5.buffer.Owned;
|
||||||
import io.netty5.util.Resource;
|
import io.netty5.util.Resource;
|
||||||
import io.netty5.buffer.api.internal.ResourceSupport;
|
import io.netty5.buffer.internal.ResourceSupport;
|
||||||
import it.cavallium.dbengine.client.BadBlock;
|
import it.cavallium.dbengine.client.BadBlock;
|
||||||
import it.cavallium.dbengine.client.CompositeSnapshot;
|
import it.cavallium.dbengine.client.CompositeSnapshot;
|
||||||
import it.cavallium.dbengine.database.BufSupplier;
|
import it.cavallium.dbengine.database.BufSupplier;
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
package it.cavallium.dbengine.database.collections;
|
package it.cavallium.dbengine.database.collections;
|
||||||
|
|
||||||
import io.netty5.buffer.api.BufferAllocator;
|
import io.netty5.buffer.BufferAllocator;
|
||||||
import io.netty5.buffer.api.Drop;
|
import io.netty5.buffer.Drop;
|
||||||
import io.netty5.buffer.api.Owned;
|
import io.netty5.buffer.Owned;
|
||||||
import io.netty5.util.Send;
|
import io.netty5.util.Send;
|
||||||
import it.cavallium.dbengine.client.BadBlock;
|
import it.cavallium.dbengine.client.BadBlock;
|
||||||
import it.cavallium.dbengine.client.CompositeSnapshot;
|
import it.cavallium.dbengine.client.CompositeSnapshot;
|
||||||
import it.cavallium.dbengine.database.BufSupplier;
|
import it.cavallium.dbengine.database.BufSupplier;
|
||||||
import it.cavallium.dbengine.database.LLDictionary;
|
import it.cavallium.dbengine.database.LLDictionary;
|
||||||
import it.cavallium.dbengine.database.LLUtils;
|
import it.cavallium.dbengine.database.LLUtils;
|
||||||
import io.netty5.buffer.api.internal.ResourceSupport;
|
import io.netty5.buffer.internal.ResourceSupport;
|
||||||
import it.cavallium.dbengine.database.SubStageEntry;
|
import it.cavallium.dbengine.database.SubStageEntry;
|
||||||
import it.cavallium.dbengine.database.UpdateMode;
|
import it.cavallium.dbengine.database.UpdateMode;
|
||||||
import it.cavallium.dbengine.database.serialization.Serializer;
|
import it.cavallium.dbengine.database.serialization.Serializer;
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
package it.cavallium.dbengine.database.collections;
|
package it.cavallium.dbengine.database.collections;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import io.netty5.buffer.api.Drop;
|
import io.netty5.buffer.Drop;
|
||||||
import io.netty5.buffer.api.Owned;
|
import io.netty5.buffer.Owned;
|
||||||
import io.netty5.buffer.api.internal.ResourceSupport;
|
import io.netty5.buffer.internal.ResourceSupport;
|
||||||
import it.cavallium.dbengine.client.BadBlock;
|
import it.cavallium.dbengine.client.BadBlock;
|
||||||
import it.cavallium.dbengine.client.CompositeSnapshot;
|
import it.cavallium.dbengine.client.CompositeSnapshot;
|
||||||
import it.cavallium.dbengine.database.BufSupplier;
|
import it.cavallium.dbengine.database.BufSupplier;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package it.cavallium.dbengine.database.collections;
|
package it.cavallium.dbengine.database.collections;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import io.netty5.buffer.api.Drop;
|
import io.netty5.buffer.Drop;
|
||||||
import io.netty5.util.Send;
|
import io.netty5.util.Send;
|
||||||
import it.cavallium.dbengine.client.CompositeSnapshot;
|
import it.cavallium.dbengine.client.CompositeSnapshot;
|
||||||
import it.cavallium.dbengine.database.BufSupplier;
|
import it.cavallium.dbengine.database.BufSupplier;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package it.cavallium.dbengine.database.collections;
|
package it.cavallium.dbengine.database.collections;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import io.netty5.buffer.api.Drop;
|
import io.netty5.buffer.Drop;
|
||||||
import io.netty5.util.Send;
|
import io.netty5.util.Send;
|
||||||
import it.cavallium.dbengine.client.CompositeSnapshot;
|
import it.cavallium.dbengine.client.CompositeSnapshot;
|
||||||
import it.cavallium.dbengine.database.BufSupplier;
|
import it.cavallium.dbengine.database.BufSupplier;
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
package it.cavallium.dbengine.database.collections;
|
package it.cavallium.dbengine.database.collections;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Drop;
|
import io.netty5.buffer.Drop;
|
||||||
import io.netty5.buffer.api.Owned;
|
import io.netty5.buffer.Owned;
|
||||||
import io.netty5.util.Send;
|
import io.netty5.util.Send;
|
||||||
import it.cavallium.dbengine.client.BadBlock;
|
import it.cavallium.dbengine.client.BadBlock;
|
||||||
import it.cavallium.dbengine.client.CompositeSnapshot;
|
import it.cavallium.dbengine.client.CompositeSnapshot;
|
||||||
import it.cavallium.dbengine.database.Delta;
|
import it.cavallium.dbengine.database.Delta;
|
||||||
import it.cavallium.dbengine.database.LLUtils;
|
import it.cavallium.dbengine.database.LLUtils;
|
||||||
import io.netty5.buffer.api.internal.ResourceSupport;
|
import io.netty5.buffer.internal.ResourceSupport;
|
||||||
import it.cavallium.dbengine.database.UpdateReturnMode;
|
import it.cavallium.dbengine.database.UpdateReturnMode;
|
||||||
import it.cavallium.dbengine.database.serialization.SerializationFunction;
|
import it.cavallium.dbengine.database.serialization.SerializationFunction;
|
||||||
import it.cavallium.dbengine.utils.SimpleResource;
|
import it.cavallium.dbengine.utils.SimpleResource;
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
package it.cavallium.dbengine.database.collections;
|
package it.cavallium.dbengine.database.collections;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Drop;
|
import io.netty5.buffer.Drop;
|
||||||
import io.netty5.buffer.api.Owned;
|
import io.netty5.buffer.Owned;
|
||||||
import io.netty5.util.Send;
|
import io.netty5.util.Send;
|
||||||
import io.netty5.buffer.api.internal.ResourceSupport;
|
import io.netty5.buffer.internal.ResourceSupport;
|
||||||
import it.cavallium.dbengine.client.BadBlock;
|
import it.cavallium.dbengine.client.BadBlock;
|
||||||
import it.cavallium.dbengine.client.CompositeSnapshot;
|
import it.cavallium.dbengine.client.CompositeSnapshot;
|
||||||
import it.cavallium.dbengine.client.Mapper;
|
import it.cavallium.dbengine.client.Mapper;
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
package it.cavallium.dbengine.database.collections;
|
package it.cavallium.dbengine.database.collections;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import io.netty5.buffer.api.Drop;
|
import io.netty5.buffer.Drop;
|
||||||
import io.netty5.buffer.api.Owned;
|
import io.netty5.buffer.Owned;
|
||||||
import io.netty5.buffer.api.internal.ResourceSupport;
|
import io.netty5.buffer.internal.ResourceSupport;
|
||||||
import it.cavallium.dbengine.client.BadBlock;
|
import it.cavallium.dbengine.client.BadBlock;
|
||||||
import it.cavallium.dbengine.client.CompositeSnapshot;
|
import it.cavallium.dbengine.client.CompositeSnapshot;
|
||||||
import it.cavallium.dbengine.database.Delta;
|
import it.cavallium.dbengine.database.Delta;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package it.cavallium.dbengine.database.collections;
|
package it.cavallium.dbengine.database.collections;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import io.netty5.util.Send;
|
import io.netty5.util.Send;
|
||||||
import it.cavallium.dbengine.client.CompositeSnapshot;
|
import it.cavallium.dbengine.client.CompositeSnapshot;
|
||||||
import it.cavallium.dbengine.database.LLDictionary;
|
import it.cavallium.dbengine.database.LLDictionary;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package it.cavallium.dbengine.database.collections;
|
package it.cavallium.dbengine.database.collections;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import io.netty5.util.Resource;
|
import io.netty5.util.Resource;
|
||||||
import io.netty5.util.Send;
|
import io.netty5.util.Send;
|
||||||
import it.cavallium.dbengine.client.CompositeSnapshot;
|
import it.cavallium.dbengine.client.CompositeSnapshot;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package it.cavallium.dbengine.database.collections;
|
package it.cavallium.dbengine.database.collections;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import io.netty5.util.Resource;
|
import io.netty5.util.Resource;
|
||||||
import io.netty5.util.Send;
|
import io.netty5.util.Send;
|
||||||
import it.cavallium.dbengine.client.CompositeSnapshot;
|
import it.cavallium.dbengine.client.CompositeSnapshot;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package it.cavallium.dbengine.database.collections;
|
package it.cavallium.dbengine.database.collections;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import it.cavallium.dbengine.client.CompositeSnapshot;
|
import it.cavallium.dbengine.client.CompositeSnapshot;
|
||||||
import it.cavallium.dbengine.database.BufSupplier;
|
import it.cavallium.dbengine.database.BufSupplier;
|
||||||
import it.cavallium.dbengine.database.LLDictionary;
|
import it.cavallium.dbengine.database.LLDictionary;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package it.cavallium.dbengine.database.collections;
|
package it.cavallium.dbengine.database.collections;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import io.netty5.util.Resource;
|
import io.netty5.util.Resource;
|
||||||
import io.netty5.util.Send;
|
import io.netty5.util.Send;
|
||||||
import it.cavallium.dbengine.client.CompositeSnapshot;
|
import it.cavallium.dbengine.client.CompositeSnapshot;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package it.cavallium.dbengine.database.collections;
|
package it.cavallium.dbengine.database.collections;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import io.netty5.util.Resource;
|
import io.netty5.util.Resource;
|
||||||
import io.netty5.util.Send;
|
import io.netty5.util.Send;
|
||||||
import it.cavallium.dbengine.client.CompositeSnapshot;
|
import it.cavallium.dbengine.client.CompositeSnapshot;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package it.cavallium.dbengine.database.collections;
|
package it.cavallium.dbengine.database.collections;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import io.netty5.util.Send;
|
import io.netty5.util.Send;
|
||||||
import it.cavallium.dbengine.client.CompositeSnapshot;
|
import it.cavallium.dbengine.client.CompositeSnapshot;
|
||||||
import it.cavallium.dbengine.database.BufSupplier;
|
import it.cavallium.dbengine.database.BufSupplier;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package it.cavallium.dbengine.database.collections;
|
package it.cavallium.dbengine.database.collections;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import io.netty5.util.Send;
|
import io.netty5.util.Send;
|
||||||
import it.cavallium.dbengine.database.serialization.Serializer;
|
import it.cavallium.dbengine.database.serialization.Serializer;
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package it.cavallium.dbengine.database.collections;
|
package it.cavallium.dbengine.database.collections;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import io.netty5.buffer.api.BufferAllocator;
|
import io.netty5.buffer.BufferAllocator;
|
||||||
import io.netty5.buffer.api.CompositeBuffer;
|
import io.netty5.buffer.CompositeBuffer;
|
||||||
import io.netty5.util.Send;
|
import io.netty5.util.Send;
|
||||||
import it.cavallium.dbengine.database.LLUtils;
|
import it.cavallium.dbengine.database.LLUtils;
|
||||||
import it.cavallium.dbengine.database.serialization.SerializationException;
|
import it.cavallium.dbengine.database.serialization.SerializationException;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package it.cavallium.dbengine.database.collections;
|
package it.cavallium.dbengine.database.collections;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import io.netty5.buffer.api.BufferAllocator;
|
import io.netty5.buffer.BufferAllocator;
|
||||||
import io.netty5.util.Send;
|
import io.netty5.util.Send;
|
||||||
import it.cavallium.dbengine.database.serialization.SerializationException;
|
import it.cavallium.dbengine.database.serialization.SerializationException;
|
||||||
import it.cavallium.dbengine.database.serialization.Serializer;
|
import it.cavallium.dbengine.database.serialization.Serializer;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package it.cavallium.dbengine.database.disk;
|
package it.cavallium.dbengine.database.disk;
|
||||||
|
|
||||||
import static io.netty5.buffer.api.StandardAllocationTypes.OFF_HEAP;
|
import static io.netty5.buffer.StandardAllocationTypes.OFF_HEAP;
|
||||||
import static it.cavallium.dbengine.database.LLUtils.INITIAL_DIRECT_READ_BYTE_BUF_SIZE_BYTES;
|
import static it.cavallium.dbengine.database.LLUtils.INITIAL_DIRECT_READ_BYTE_BUF_SIZE_BYTES;
|
||||||
import static it.cavallium.dbengine.database.LLUtils.isReadOnlyDirect;
|
import static it.cavallium.dbengine.database.LLUtils.isReadOnlyDirect;
|
||||||
import static java.lang.Boolean.parseBoolean;
|
import static java.lang.Boolean.parseBoolean;
|
||||||
@ -13,11 +13,10 @@ import io.micrometer.core.instrument.Counter;
|
|||||||
import io.micrometer.core.instrument.DistributionSummary;
|
import io.micrometer.core.instrument.DistributionSummary;
|
||||||
import io.micrometer.core.instrument.MeterRegistry;
|
import io.micrometer.core.instrument.MeterRegistry;
|
||||||
import io.micrometer.core.instrument.Timer;
|
import io.micrometer.core.instrument.Timer;
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import io.netty5.buffer.api.BufferAllocator;
|
import io.netty5.buffer.BufferAllocator;
|
||||||
import io.netty5.buffer.api.DefaultBufferAllocators;
|
import io.netty5.buffer.BufferComponent;
|
||||||
import io.netty5.buffer.api.ReadableComponent;
|
import io.netty5.buffer.DefaultBufferAllocators;
|
||||||
import io.netty5.buffer.api.WritableComponent;
|
|
||||||
import it.cavallium.dbengine.database.LLRange;
|
import it.cavallium.dbengine.database.LLRange;
|
||||||
import it.cavallium.dbengine.database.LLUtils;
|
import it.cavallium.dbengine.database.LLUtils;
|
||||||
import it.cavallium.dbengine.database.RepeatedElementList;
|
import it.cavallium.dbengine.database.RepeatedElementList;
|
||||||
@ -256,7 +255,7 @@ public sealed abstract class AbstractRocksDBColumn<T extends RocksDB> implements
|
|||||||
requireNonNull(key);
|
requireNonNull(key);
|
||||||
AbstractSlice<?> slice;
|
AbstractSlice<?> slice;
|
||||||
if (allowNettyDirect && USE_DIRECT_BUFFER_BOUNDS && isReadOnlyDirect(key)) {
|
if (allowNettyDirect && USE_DIRECT_BUFFER_BOUNDS && isReadOnlyDirect(key)) {
|
||||||
ByteBuffer keyInternalByteBuffer = ((ReadableComponent) key).readableBuffer();
|
ByteBuffer keyInternalByteBuffer = ((BufferComponent) key).readableBuffer();
|
||||||
assert keyInternalByteBuffer.position() == 0;
|
assert keyInternalByteBuffer.position() == 0;
|
||||||
slice = new DirectSlice(keyInternalByteBuffer, key.readableBytes());
|
slice = new DirectSlice(keyInternalByteBuffer, key.readableBytes());
|
||||||
assert slice.size() == key.readableBytes();
|
assert slice.size() == key.readableBytes();
|
||||||
@ -371,7 +370,7 @@ public sealed abstract class AbstractRocksDBColumn<T extends RocksDB> implements
|
|||||||
} else {
|
} else {
|
||||||
mustCloseKey = false;
|
mustCloseKey = false;
|
||||||
}
|
}
|
||||||
keyNioBuffer = ((ReadableComponent) key).readableBuffer();
|
keyNioBuffer = ((BufferComponent) key).readableBuffer();
|
||||||
assert keyNioBuffer.isDirect();
|
assert keyNioBuffer.isDirect();
|
||||||
assert keyNioBuffer.limit() == key.readableBytes();
|
assert keyNioBuffer.limit() == key.readableBytes();
|
||||||
}
|
}
|
||||||
@ -389,7 +388,7 @@ public sealed abstract class AbstractRocksDBColumn<T extends RocksDB> implements
|
|||||||
} else {
|
} else {
|
||||||
mustCloseValue = false;
|
mustCloseValue = false;
|
||||||
}
|
}
|
||||||
valueNioBuffer = ((ReadableComponent) value).readableBuffer();
|
valueNioBuffer = ((BufferComponent) value).readableBuffer();
|
||||||
assert valueNioBuffer.isDirect();
|
assert valueNioBuffer.isDirect();
|
||||||
assert valueNioBuffer.limit() == value.readableBytes();
|
assert valueNioBuffer.limit() == value.readableBytes();
|
||||||
}
|
}
|
||||||
@ -434,7 +433,7 @@ public sealed abstract class AbstractRocksDBColumn<T extends RocksDB> implements
|
|||||||
} else {
|
} else {
|
||||||
mustCloseKey = false;
|
mustCloseKey = false;
|
||||||
}
|
}
|
||||||
keyNioBuffer = ((ReadableComponent) key).readableBuffer();
|
keyNioBuffer = ((BufferComponent) key).readableBuffer();
|
||||||
assert keyNioBuffer.isDirect();
|
assert keyNioBuffer.isDirect();
|
||||||
assert keyNioBuffer.limit() == key.readableBytes();
|
assert keyNioBuffer.limit() == key.readableBytes();
|
||||||
}
|
}
|
||||||
@ -508,7 +507,7 @@ public sealed abstract class AbstractRocksDBColumn<T extends RocksDB> implements
|
|||||||
} else {
|
} else {
|
||||||
mustCloseKey = false;
|
mustCloseKey = false;
|
||||||
}
|
}
|
||||||
keyNioBuffer = ((ReadableComponent) key).readableBuffer();
|
keyNioBuffer = ((BufferComponent) key).readableBuffer();
|
||||||
assert keyNioBuffer.isDirect();
|
assert keyNioBuffer.isDirect();
|
||||||
assert keyNioBuffer.limit() == key.readableBytes();
|
assert keyNioBuffer.limit() == key.readableBytes();
|
||||||
}
|
}
|
||||||
@ -549,7 +548,7 @@ public sealed abstract class AbstractRocksDBColumn<T extends RocksDB> implements
|
|||||||
} else {
|
} else {
|
||||||
mustCloseKey = false;
|
mustCloseKey = false;
|
||||||
}
|
}
|
||||||
keyNioBuffer = ((ReadableComponent) key).readableBuffer();
|
keyNioBuffer = ((BufferComponent) key).readableBuffer();
|
||||||
assert keyNioBuffer.isDirect();
|
assert keyNioBuffer.isDirect();
|
||||||
assert keyNioBuffer.limit() == key.readableBytes();
|
assert keyNioBuffer.limit() == key.readableBytes();
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package it.cavallium.dbengine.database.disk;
|
package it.cavallium.dbengine.database.disk;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import it.cavallium.dbengine.database.serialization.SerializationFunction;
|
import it.cavallium.dbengine.database.serialization.SerializationFunction;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
|
@ -3,9 +3,9 @@ package it.cavallium.dbengine.database.disk;
|
|||||||
import static it.cavallium.dbengine.database.LLUtils.isDirect;
|
import static it.cavallium.dbengine.database.LLUtils.isDirect;
|
||||||
import static it.cavallium.dbengine.database.LLUtils.isReadOnlyDirect;
|
import static it.cavallium.dbengine.database.LLUtils.isReadOnlyDirect;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import io.netty5.buffer.api.BufferAllocator;
|
import io.netty5.buffer.BufferAllocator;
|
||||||
import io.netty5.buffer.api.ReadableComponent;
|
import io.netty5.buffer.BufferComponent;
|
||||||
import io.netty5.util.Send;
|
import io.netty5.util.Send;
|
||||||
import io.netty5.util.internal.PlatformDependent;
|
import io.netty5.util.internal.PlatformDependent;
|
||||||
import it.cavallium.dbengine.database.LLUtils;
|
import it.cavallium.dbengine.database.LLUtils;
|
||||||
@ -116,8 +116,8 @@ public class CappedWriteBatch extends WriteBatch {
|
|||||||
if (USE_FAST_DIRECT_BUFFERS
|
if (USE_FAST_DIRECT_BUFFERS
|
||||||
&& (isReadOnlyDirect(key))
|
&& (isReadOnlyDirect(key))
|
||||||
&& (isReadOnlyDirect(value))) {
|
&& (isReadOnlyDirect(value))) {
|
||||||
ByteBuffer keyNioBuffer = ((ReadableComponent) key).readableBuffer();
|
ByteBuffer keyNioBuffer = ((BufferComponent) key).readableBuffer();
|
||||||
ByteBuffer valueNioBuffer = ((ReadableComponent) value).readableBuffer();
|
ByteBuffer valueNioBuffer = ((BufferComponent) value).readableBuffer();
|
||||||
buffersToRelease.add(value);
|
buffersToRelease.add(value);
|
||||||
buffersToRelease.add(key);
|
buffersToRelease.add(key);
|
||||||
|
|
||||||
@ -162,7 +162,7 @@ public class CappedWriteBatch extends WriteBatch {
|
|||||||
public synchronized void delete(ColumnFamilyHandle columnFamilyHandle, Send<Buffer> keyToReceive) throws RocksDBException {
|
public synchronized void delete(ColumnFamilyHandle columnFamilyHandle, Send<Buffer> keyToReceive) throws RocksDBException {
|
||||||
var key = keyToReceive.receive();
|
var key = keyToReceive.receive();
|
||||||
if (USE_FAST_DIRECT_BUFFERS && isReadOnlyDirect(key)) {
|
if (USE_FAST_DIRECT_BUFFERS && isReadOnlyDirect(key)) {
|
||||||
ByteBuffer keyNioBuffer = ((ReadableComponent) key).readableBuffer();
|
ByteBuffer keyNioBuffer = ((BufferComponent) key).readableBuffer();
|
||||||
buffersToRelease.add(key);
|
buffersToRelease.add(key);
|
||||||
delete(columnFamilyHandle, keyNioBuffer);
|
delete(columnFamilyHandle, keyNioBuffer);
|
||||||
} else {
|
} else {
|
||||||
|
@ -4,7 +4,7 @@ import static it.cavallium.dbengine.database.disk.LLTempHugePqEnv.getColumnOptio
|
|||||||
|
|
||||||
import com.google.common.primitives.Ints;
|
import com.google.common.primitives.Ints;
|
||||||
import io.micrometer.core.instrument.composite.CompositeMeterRegistry;
|
import io.micrometer.core.instrument.composite.CompositeMeterRegistry;
|
||||||
import io.netty5.buffer.api.BufferAllocator;
|
import io.netty5.buffer.BufferAllocator;
|
||||||
import it.cavallium.dbengine.utils.SimpleResource;
|
import it.cavallium.dbengine.utils.SimpleResource;
|
||||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||||
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
||||||
|
@ -8,11 +8,10 @@ import static org.rocksdb.KeyMayExist.KeyMayExistEnum.kExistsWithValue;
|
|||||||
import static org.rocksdb.KeyMayExist.KeyMayExistEnum.kExistsWithoutValue;
|
import static org.rocksdb.KeyMayExist.KeyMayExistEnum.kExistsWithoutValue;
|
||||||
import static org.rocksdb.KeyMayExist.KeyMayExistEnum.kNotExist;
|
import static org.rocksdb.KeyMayExist.KeyMayExistEnum.kNotExist;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import io.netty5.buffer.api.BufferAllocator;
|
import io.netty5.buffer.BufferAllocator;
|
||||||
import io.netty5.buffer.api.DefaultBufferAllocators;
|
import io.netty5.buffer.BufferComponent;
|
||||||
import io.netty5.buffer.api.ReadableComponent;
|
import io.netty5.buffer.DefaultBufferAllocators;
|
||||||
import io.netty5.buffer.api.WritableComponent;
|
|
||||||
import it.cavallium.dbengine.database.LLUtils;
|
import it.cavallium.dbengine.database.LLUtils;
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
@ -75,7 +74,7 @@ public abstract class KeyMayExistGetter {
|
|||||||
} else {
|
} else {
|
||||||
mustCloseKey = false;
|
mustCloseKey = false;
|
||||||
}
|
}
|
||||||
keyNioBuffer = ((ReadableComponent) key).readableBuffer();
|
keyNioBuffer = ((BufferComponent) key).readableBuffer();
|
||||||
assert keyNioBuffer.isDirect();
|
assert keyNioBuffer.isDirect();
|
||||||
assert keyNioBuffer.limit() == key.readableBytes();
|
assert keyNioBuffer.limit() == key.readableBytes();
|
||||||
}
|
}
|
||||||
@ -86,14 +85,14 @@ public abstract class KeyMayExistGetter {
|
|||||||
try {
|
try {
|
||||||
assert resultBuffer.readerOffset() == 0;
|
assert resultBuffer.readerOffset() == 0;
|
||||||
assert resultBuffer.writerOffset() == 0;
|
assert resultBuffer.writerOffset() == 0;
|
||||||
var resultWritable = ((WritableComponent) resultBuffer).writableBuffer();
|
var resultWritable = ((BufferComponent) resultBuffer).writableBuffer();
|
||||||
|
|
||||||
var keyMayExist = keyMayExist(readOptions, keyNioBuffer.rewind(), resultWritable.clear());
|
var keyMayExist = keyMayExist(readOptions, keyNioBuffer.rewind(), resultWritable.clear());
|
||||||
if (STRICT_MAYEXIST_NO_VALUE && keyMayExist.exists != kExistsWithValue && keyMayExist.valueLength != 0) {
|
if (STRICT_MAYEXIST_NO_VALUE && keyMayExist.exists != kExistsWithValue && keyMayExist.valueLength != 0) {
|
||||||
// Create a direct result buffer because RocksDB works only with direct buffers
|
// Create a direct result buffer because RocksDB works only with direct buffers
|
||||||
try (var realResultBuffer = bufferAllocator.allocate(INITIAL_DIRECT_READ_BYTE_BUF_SIZE_BYTES)) {
|
try (var realResultBuffer = bufferAllocator.allocate(INITIAL_DIRECT_READ_BYTE_BUF_SIZE_BYTES)) {
|
||||||
var resultWritableF = resultWritable;
|
var resultWritableF = resultWritable;
|
||||||
var realResultWritable = ((WritableComponent) realResultBuffer).writableBuffer();
|
var realResultWritable = ((BufferComponent) realResultBuffer).writableBuffer();
|
||||||
var realSize = get(readOptions, keyNioBuffer.rewind(), realResultWritable);
|
var realSize = get(readOptions, keyNioBuffer.rewind(), realResultWritable);
|
||||||
var hexFormat = HexFormat.ofDelimiter(" ");
|
var hexFormat = HexFormat.ofDelimiter(" ");
|
||||||
LOG.error(
|
LOG.error(
|
||||||
@ -178,7 +177,7 @@ public abstract class KeyMayExistGetter {
|
|||||||
return resultBuffer.writerOffset(resultWritable.limit());
|
return resultBuffer.writerOffset(resultWritable.limit());
|
||||||
} else {
|
} else {
|
||||||
resultBuffer.ensureWritable(size);
|
resultBuffer.ensureWritable(size);
|
||||||
resultWritable = ((WritableComponent) resultBuffer).writableBuffer();
|
resultWritable = ((BufferComponent) resultBuffer).writableBuffer();
|
||||||
assert resultBuffer.readerOffset() == 0;
|
assert resultBuffer.readerOffset() == 0;
|
||||||
assert resultBuffer.writerOffset() == 0;
|
assert resultBuffer.writerOffset() == 0;
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package it.cavallium.dbengine.database.disk;
|
package it.cavallium.dbengine.database.disk;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Drop;
|
import io.netty5.buffer.Drop;
|
||||||
import io.netty5.buffer.api.Owned;
|
import io.netty5.buffer.Owned;
|
||||||
import io.netty5.buffer.api.internal.ResourceSupport;
|
import io.netty5.buffer.internal.ResourceSupport;
|
||||||
import it.cavallium.dbengine.database.DiscardingCloseable;
|
import it.cavallium.dbengine.database.DiscardingCloseable;
|
||||||
import it.cavallium.dbengine.database.SafeCloseable;
|
import it.cavallium.dbengine.database.SafeCloseable;
|
||||||
import it.cavallium.dbengine.utils.SimpleResource;
|
import it.cavallium.dbengine.utils.SimpleResource;
|
||||||
|
@ -3,7 +3,7 @@ package it.cavallium.dbengine.database.disk;
|
|||||||
import static it.cavallium.dbengine.lucene.LuceneUtils.luceneScheduler;
|
import static it.cavallium.dbengine.lucene.LuceneUtils.luceneScheduler;
|
||||||
|
|
||||||
import io.micrometer.core.instrument.MeterRegistry;
|
import io.micrometer.core.instrument.MeterRegistry;
|
||||||
import io.netty5.buffer.api.BufferAllocator;
|
import io.netty5.buffer.BufferAllocator;
|
||||||
import it.cavallium.dbengine.database.LLDatabaseConnection;
|
import it.cavallium.dbengine.database.LLDatabaseConnection;
|
||||||
import it.cavallium.dbengine.database.LLLuceneIndex;
|
import it.cavallium.dbengine.database.LLLuceneIndex;
|
||||||
import it.cavallium.dbengine.lucene.LuceneHacks;
|
import it.cavallium.dbengine.lucene.LuceneHacks;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package it.cavallium.dbengine.database.disk;
|
package it.cavallium.dbengine.database.disk;
|
||||||
|
|
||||||
import static io.netty5.buffer.api.StandardAllocationTypes.OFF_HEAP;
|
import static io.netty5.buffer.StandardAllocationTypes.OFF_HEAP;
|
||||||
import static it.cavallium.dbengine.database.LLUtils.ALLOW_STATIC_OPTIONS;
|
import static it.cavallium.dbengine.database.LLUtils.ALLOW_STATIC_OPTIONS;
|
||||||
import static it.cavallium.dbengine.database.LLUtils.MARKER_ROCKSDB;
|
import static it.cavallium.dbengine.database.LLUtils.MARKER_ROCKSDB;
|
||||||
import static it.cavallium.dbengine.database.LLUtils.fromByteArray;
|
import static it.cavallium.dbengine.database.LLUtils.fromByteArray;
|
||||||
@ -12,9 +12,9 @@ import static java.util.Objects.requireNonNull;
|
|||||||
|
|
||||||
import io.micrometer.core.instrument.Counter;
|
import io.micrometer.core.instrument.Counter;
|
||||||
import io.micrometer.core.instrument.Timer;
|
import io.micrometer.core.instrument.Timer;
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import io.netty5.buffer.api.BufferAllocator;
|
import io.netty5.buffer.BufferAllocator;
|
||||||
import io.netty5.buffer.api.ReadableComponent;
|
import io.netty5.buffer.BufferComponent;
|
||||||
import io.netty5.util.Resource;
|
import io.netty5.util.Resource;
|
||||||
import it.cavallium.dbengine.client.BadBlock;
|
import it.cavallium.dbengine.client.BadBlock;
|
||||||
import it.cavallium.dbengine.database.ColumnUtils;
|
import it.cavallium.dbengine.database.ColumnUtils;
|
||||||
@ -308,7 +308,7 @@ public class LLLocalDictionary implements LLDictionary {
|
|||||||
try (var rocksIterator = db.newIterator(readOpts, range.getMinUnsafe(), range.getMaxUnsafe())) {
|
try (var rocksIterator = db.newIterator(readOpts, range.getMinUnsafe(), range.getMaxUnsafe())) {
|
||||||
if (!LLLocalDictionary.PREFER_AUTO_SEEK_BOUND && range.hasMin()) {
|
if (!LLLocalDictionary.PREFER_AUTO_SEEK_BOUND && range.hasMin()) {
|
||||||
if (nettyDirect && isReadOnlyDirect(range.getMinUnsafe())) {
|
if (nettyDirect && isReadOnlyDirect(range.getMinUnsafe())) {
|
||||||
var seekBuf = ((ReadableComponent) range.getMinUnsafe()).readableBuffer();
|
var seekBuf = ((BufferComponent) range.getMinUnsafe()).readableBuffer();
|
||||||
rocksIterator.seek(seekBuf);
|
rocksIterator.seek(seekBuf);
|
||||||
} else {
|
} else {
|
||||||
var seekArray = LLUtils.toArray(range.getMinUnsafe());
|
var seekArray = LLUtils.toArray(range.getMinUnsafe());
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package it.cavallium.dbengine.database.disk;
|
package it.cavallium.dbengine.database.disk;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import io.netty5.util.Send;
|
import io.netty5.util.Send;
|
||||||
import it.cavallium.dbengine.database.LLEntry;
|
import it.cavallium.dbengine.database.LLEntry;
|
||||||
import it.cavallium.dbengine.database.LLRange;
|
import it.cavallium.dbengine.database.LLRange;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package it.cavallium.dbengine.database.disk;
|
package it.cavallium.dbengine.database.disk;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import io.netty5.util.Send;
|
import io.netty5.util.Send;
|
||||||
import it.cavallium.dbengine.database.LLEntry;
|
import it.cavallium.dbengine.database.LLEntry;
|
||||||
import it.cavallium.dbengine.database.LLRange;
|
import it.cavallium.dbengine.database.LLRange;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package it.cavallium.dbengine.database.disk;
|
package it.cavallium.dbengine.database.disk;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import io.netty5.util.Send;
|
import io.netty5.util.Send;
|
||||||
import it.cavallium.dbengine.database.LLRange;
|
import it.cavallium.dbengine.database.LLRange;
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
@ -4,7 +4,7 @@ import static it.cavallium.dbengine.database.LLUtils.MARKER_ROCKSDB;
|
|||||||
import static it.cavallium.dbengine.database.LLUtils.generateCustomReadOptions;
|
import static it.cavallium.dbengine.database.LLUtils.generateCustomReadOptions;
|
||||||
import static it.cavallium.dbengine.database.LLUtils.isBoundedRange;
|
import static it.cavallium.dbengine.database.LLUtils.isBoundedRange;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import it.cavallium.dbengine.database.LLRange;
|
import it.cavallium.dbengine.database.LLRange;
|
||||||
import it.cavallium.dbengine.database.LLUtils;
|
import it.cavallium.dbengine.database.LLUtils;
|
||||||
import it.unimi.dsi.fastutil.objects.ObjectArrayList;
|
import it.unimi.dsi.fastutil.objects.ObjectArrayList;
|
||||||
|
@ -4,11 +4,11 @@ import static it.cavallium.dbengine.database.LLUtils.MARKER_ROCKSDB;
|
|||||||
import static it.cavallium.dbengine.database.LLUtils.generateCustomReadOptions;
|
import static it.cavallium.dbengine.database.LLUtils.generateCustomReadOptions;
|
||||||
import static it.cavallium.dbengine.database.LLUtils.isBoundedRange;
|
import static it.cavallium.dbengine.database.LLUtils.isBoundedRange;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import io.netty5.buffer.api.Drop;
|
import io.netty5.buffer.Drop;
|
||||||
import io.netty5.buffer.api.Owned;
|
import io.netty5.buffer.Owned;
|
||||||
import io.netty5.util.Send;
|
import io.netty5.util.Send;
|
||||||
import io.netty5.buffer.api.internal.ResourceSupport;
|
import io.netty5.buffer.internal.ResourceSupport;
|
||||||
import it.cavallium.dbengine.database.LLRange;
|
import it.cavallium.dbengine.database.LLRange;
|
||||||
import it.cavallium.dbengine.database.LLUtils;
|
import it.cavallium.dbengine.database.LLUtils;
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package it.cavallium.dbengine.database.disk;
|
package it.cavallium.dbengine.database.disk;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import io.netty5.util.Send;
|
import io.netty5.util.Send;
|
||||||
import it.cavallium.dbengine.database.LLRange;
|
import it.cavallium.dbengine.database.LLRange;
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package it.cavallium.dbengine.database.disk;
|
package it.cavallium.dbengine.database.disk;
|
||||||
|
|
||||||
import static io.netty5.buffer.api.StandardAllocationTypes.OFF_HEAP;
|
import static io.netty5.buffer.StandardAllocationTypes.OFF_HEAP;
|
||||||
import static it.cavallium.dbengine.database.LLUtils.MARKER_ROCKSDB;
|
import static it.cavallium.dbengine.database.LLUtils.MARKER_ROCKSDB;
|
||||||
import static java.lang.Boolean.parseBoolean;
|
import static java.lang.Boolean.parseBoolean;
|
||||||
import static java.util.Objects.requireNonNull;
|
import static java.util.Objects.requireNonNull;
|
||||||
@ -9,7 +9,7 @@ import static org.rocksdb.ColumnFamilyOptionsInterface.DEFAULT_COMPACTION_MEMTAB
|
|||||||
import io.micrometer.core.instrument.MeterRegistry;
|
import io.micrometer.core.instrument.MeterRegistry;
|
||||||
import io.micrometer.core.instrument.Tag;
|
import io.micrometer.core.instrument.Tag;
|
||||||
import io.micrometer.core.instrument.Timer;
|
import io.micrometer.core.instrument.Timer;
|
||||||
import io.netty5.buffer.api.BufferAllocator;
|
import io.netty5.buffer.BufferAllocator;
|
||||||
import io.netty5.util.internal.PlatformDependent;
|
import io.netty5.util.internal.PlatformDependent;
|
||||||
import it.cavallium.data.generator.nativedata.NullableString;
|
import it.cavallium.data.generator.nativedata.NullableString;
|
||||||
import it.cavallium.dbengine.client.Backuppable;
|
import it.cavallium.dbengine.client.Backuppable;
|
||||||
|
@ -2,10 +2,10 @@ package it.cavallium.dbengine.database.disk;
|
|||||||
|
|
||||||
import static it.cavallium.dbengine.database.LLUtils.generateCustomReadOptions;
|
import static it.cavallium.dbengine.database.LLUtils.generateCustomReadOptions;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Drop;
|
import io.netty5.buffer.Drop;
|
||||||
import io.netty5.buffer.api.Owned;
|
import io.netty5.buffer.Owned;
|
||||||
import io.netty5.util.Send;
|
import io.netty5.util.Send;
|
||||||
import io.netty5.buffer.api.internal.ResourceSupport;
|
import io.netty5.buffer.internal.ResourceSupport;
|
||||||
import it.cavallium.dbengine.database.LLRange;
|
import it.cavallium.dbengine.database.LLRange;
|
||||||
import it.cavallium.dbengine.database.LLUtils;
|
import it.cavallium.dbengine.database.LLUtils;
|
||||||
import it.cavallium.dbengine.utils.SimpleResource;
|
import it.cavallium.dbengine.utils.SimpleResource;
|
||||||
|
@ -4,7 +4,7 @@ import static it.cavallium.dbengine.database.LLUtils.MARKER_ROCKSDB;
|
|||||||
import static it.cavallium.dbengine.database.LLUtils.generateCustomReadOptions;
|
import static it.cavallium.dbengine.database.LLUtils.generateCustomReadOptions;
|
||||||
import static it.cavallium.dbengine.database.LLUtils.isBoundedRange;
|
import static it.cavallium.dbengine.database.LLUtils.isBoundedRange;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import it.cavallium.dbengine.database.LLRange;
|
import it.cavallium.dbengine.database.LLRange;
|
||||||
import it.cavallium.dbengine.database.LLUtils;
|
import it.cavallium.dbengine.database.LLUtils;
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
@ -2,8 +2,8 @@ package it.cavallium.dbengine.database.disk;
|
|||||||
|
|
||||||
import static it.cavallium.dbengine.database.disk.UpdateAtomicResultMode.DELTA;
|
import static it.cavallium.dbengine.database.disk.UpdateAtomicResultMode.DELTA;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import io.netty5.buffer.api.BufferAllocator;
|
import io.netty5.buffer.BufferAllocator;
|
||||||
import io.netty5.util.Send;
|
import io.netty5.util.Send;
|
||||||
import it.cavallium.dbengine.database.LLDelta;
|
import it.cavallium.dbengine.database.LLDelta;
|
||||||
import it.cavallium.dbengine.database.LLSingleton;
|
import it.cavallium.dbengine.database.LLSingleton;
|
||||||
|
@ -4,9 +4,9 @@ import static it.cavallium.dbengine.database.LLUtils.MARKER_ROCKSDB;
|
|||||||
|
|
||||||
import io.micrometer.core.instrument.DistributionSummary;
|
import io.micrometer.core.instrument.DistributionSummary;
|
||||||
import io.micrometer.core.instrument.MeterRegistry;
|
import io.micrometer.core.instrument.MeterRegistry;
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import io.netty5.buffer.api.BufferAllocator;
|
import io.netty5.buffer.BufferAllocator;
|
||||||
import io.netty5.buffer.api.MemoryManager;
|
import io.netty5.buffer.MemoryManager;
|
||||||
import io.netty5.util.Send;
|
import io.netty5.util.Send;
|
||||||
import it.cavallium.dbengine.database.LLDelta;
|
import it.cavallium.dbengine.database.LLDelta;
|
||||||
import it.cavallium.dbengine.database.LLUtils;
|
import it.cavallium.dbengine.database.LLUtils;
|
||||||
|
@ -3,9 +3,9 @@ package it.cavallium.dbengine.database.disk;
|
|||||||
import static it.cavallium.dbengine.database.LLUtils.MARKER_ROCKSDB;
|
import static it.cavallium.dbengine.database.LLUtils.MARKER_ROCKSDB;
|
||||||
|
|
||||||
import io.micrometer.core.instrument.MeterRegistry;
|
import io.micrometer.core.instrument.MeterRegistry;
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import io.netty5.buffer.api.BufferAllocator;
|
import io.netty5.buffer.BufferAllocator;
|
||||||
import io.netty5.buffer.api.MemoryManager;
|
import io.netty5.buffer.MemoryManager;
|
||||||
import io.netty5.util.Send;
|
import io.netty5.util.Send;
|
||||||
import it.cavallium.dbengine.database.LLDelta;
|
import it.cavallium.dbengine.database.LLDelta;
|
||||||
import it.cavallium.dbengine.database.LLUtils;
|
import it.cavallium.dbengine.database.LLUtils;
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package it.cavallium.dbengine.database.disk;
|
package it.cavallium.dbengine.database.disk;
|
||||||
|
|
||||||
import io.micrometer.core.instrument.MeterRegistry;
|
import io.micrometer.core.instrument.MeterRegistry;
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import io.netty5.buffer.api.BufferAllocator;
|
import io.netty5.buffer.BufferAllocator;
|
||||||
import it.cavallium.dbengine.database.LLRange;
|
import it.cavallium.dbengine.database.LLRange;
|
||||||
import it.cavallium.dbengine.database.LLUtils;
|
import it.cavallium.dbengine.database.LLUtils;
|
||||||
import it.cavallium.dbengine.database.disk.rocksdb.RocksIteratorObj;
|
import it.cavallium.dbengine.database.disk.rocksdb.RocksIteratorObj;
|
||||||
|
@ -3,8 +3,8 @@ package it.cavallium.dbengine.database.disk;
|
|||||||
import static it.cavallium.dbengine.database.LLUtils.MARKER_ROCKSDB;
|
import static it.cavallium.dbengine.database.LLUtils.MARKER_ROCKSDB;
|
||||||
|
|
||||||
import io.micrometer.core.instrument.MeterRegistry;
|
import io.micrometer.core.instrument.MeterRegistry;
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import io.netty5.buffer.api.BufferAllocator;
|
import io.netty5.buffer.BufferAllocator;
|
||||||
import it.cavallium.dbengine.database.LLDelta;
|
import it.cavallium.dbengine.database.LLDelta;
|
||||||
import it.cavallium.dbengine.database.LLUtils;
|
import it.cavallium.dbengine.database.LLUtils;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package it.cavallium.dbengine.database.disk;
|
package it.cavallium.dbengine.database.disk;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import io.netty5.util.Send;
|
import io.netty5.util.Send;
|
||||||
|
|
||||||
public record UpdateAtomicResultCurrent(Buffer current) implements UpdateAtomicResult {
|
public record UpdateAtomicResultCurrent(Buffer current) implements UpdateAtomicResult {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package it.cavallium.dbengine.database.disk;
|
package it.cavallium.dbengine.database.disk;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import io.netty5.util.Send;
|
import io.netty5.util.Send;
|
||||||
|
|
||||||
public record UpdateAtomicResultPrevious(Buffer previous) implements UpdateAtomicResult {
|
public record UpdateAtomicResultPrevious(Buffer previous) implements UpdateAtomicResult {
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package it.cavallium.dbengine.database.disk.rocksdb;
|
package it.cavallium.dbengine.database.disk.rocksdb;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Drop;
|
import io.netty5.buffer.Drop;
|
||||||
import io.netty5.buffer.api.Owned;
|
import io.netty5.buffer.Owned;
|
||||||
import io.netty5.buffer.api.internal.ResourceSupport;
|
import io.netty5.buffer.internal.ResourceSupport;
|
||||||
import it.cavallium.dbengine.utils.SimpleResource;
|
import it.cavallium.dbengine.utils.SimpleResource;
|
||||||
import org.rocksdb.AbstractSlice;
|
import org.rocksdb.AbstractSlice;
|
||||||
import org.rocksdb.ColumnFamilyHandle;
|
import org.rocksdb.ColumnFamilyHandle;
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package it.cavallium.dbengine.database.disk.rocksdb;
|
package it.cavallium.dbengine.database.disk.rocksdb;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Drop;
|
import io.netty5.buffer.Drop;
|
||||||
import io.netty5.buffer.api.Owned;
|
import io.netty5.buffer.Owned;
|
||||||
import io.netty5.buffer.api.internal.ResourceSupport;
|
import io.netty5.buffer.internal.ResourceSupport;
|
||||||
import it.cavallium.dbengine.utils.SimpleResource;
|
import it.cavallium.dbengine.utils.SimpleResource;
|
||||||
import org.rocksdb.CompactionOptions;
|
import org.rocksdb.CompactionOptions;
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
package it.cavallium.dbengine.database.disk.rocksdb;
|
package it.cavallium.dbengine.database.disk.rocksdb;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import io.netty5.buffer.api.Drop;
|
import io.netty5.buffer.Drop;
|
||||||
import io.netty5.buffer.api.Owned;
|
import io.netty5.buffer.Owned;
|
||||||
import io.netty5.util.Send;
|
import io.netty5.util.Send;
|
||||||
import io.netty5.buffer.api.internal.ResourceSupport;
|
import io.netty5.buffer.internal.ResourceSupport;
|
||||||
import it.cavallium.dbengine.database.LLDelta;
|
import it.cavallium.dbengine.database.LLDelta;
|
||||||
import it.cavallium.dbengine.database.SafeCloseable;
|
import it.cavallium.dbengine.database.SafeCloseable;
|
||||||
import it.cavallium.dbengine.database.disk.LLLocalGroupedReactiveRocksIterator;
|
import it.cavallium.dbengine.database.disk.LLLocalGroupedReactiveRocksIterator;
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package it.cavallium.dbengine.database.disk.rocksdb;
|
package it.cavallium.dbengine.database.disk.rocksdb;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Drop;
|
import io.netty5.buffer.Drop;
|
||||||
import io.netty5.buffer.api.Owned;
|
import io.netty5.buffer.Owned;
|
||||||
import io.netty5.buffer.api.internal.ResourceSupport;
|
import io.netty5.buffer.internal.ResourceSupport;
|
||||||
import it.cavallium.dbengine.utils.SimpleResource;
|
import it.cavallium.dbengine.utils.SimpleResource;
|
||||||
import org.rocksdb.WriteOptions;
|
import org.rocksdb.WriteOptions;
|
||||||
|
|
||||||
|
@ -4,11 +4,11 @@ import static it.cavallium.dbengine.database.LLUtils.isReadOnlyDirect;
|
|||||||
|
|
||||||
import io.micrometer.core.instrument.Counter;
|
import io.micrometer.core.instrument.Counter;
|
||||||
import io.micrometer.core.instrument.Timer;
|
import io.micrometer.core.instrument.Timer;
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import io.netty5.buffer.api.Drop;
|
import io.netty5.buffer.BufferComponent;
|
||||||
import io.netty5.buffer.api.Owned;
|
import io.netty5.buffer.Drop;
|
||||||
import io.netty5.buffer.api.ReadableComponent;
|
import io.netty5.buffer.Owned;
|
||||||
import io.netty5.buffer.api.internal.ResourceSupport;
|
import io.netty5.buffer.internal.ResourceSupport;
|
||||||
import it.cavallium.dbengine.database.LLUtils;
|
import it.cavallium.dbengine.database.LLUtils;
|
||||||
import it.cavallium.dbengine.utils.SimpleResource;
|
import it.cavallium.dbengine.utils.SimpleResource;
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
@ -142,7 +142,7 @@ public class RocksIteratorObj extends SimpleResource {
|
|||||||
public void seekFrom(Buffer key) {
|
public void seekFrom(Buffer key) {
|
||||||
ensureOpen();
|
ensureOpen();
|
||||||
if (allowNettyDirect && isReadOnlyDirect(key)) {
|
if (allowNettyDirect && isReadOnlyDirect(key)) {
|
||||||
ByteBuffer keyInternalByteBuffer = ((ReadableComponent) key).readableBuffer();
|
ByteBuffer keyInternalByteBuffer = ((BufferComponent) key).readableBuffer();
|
||||||
assert keyInternalByteBuffer.position() == 0;
|
assert keyInternalByteBuffer.position() == 0;
|
||||||
rocksIterator.seekForPrev(keyInternalByteBuffer);
|
rocksIterator.seekForPrev(keyInternalByteBuffer);
|
||||||
// This is useful to retain the key buffer in memory and avoid deallocations
|
// This is useful to retain the key buffer in memory and avoid deallocations
|
||||||
@ -161,7 +161,7 @@ public class RocksIteratorObj extends SimpleResource {
|
|||||||
public void seekTo(Buffer key) {
|
public void seekTo(Buffer key) {
|
||||||
ensureOpen();
|
ensureOpen();
|
||||||
if (allowNettyDirect && isReadOnlyDirect(key)) {
|
if (allowNettyDirect && isReadOnlyDirect(key)) {
|
||||||
ByteBuffer keyInternalByteBuffer = ((ReadableComponent) key).readableBuffer();
|
ByteBuffer keyInternalByteBuffer = ((BufferComponent) key).readableBuffer();
|
||||||
assert keyInternalByteBuffer.position() == 0;
|
assert keyInternalByteBuffer.position() == 0;
|
||||||
startedIterSeek.increment();
|
startedIterSeek.increment();
|
||||||
iterSeekTime.record(() -> rocksIterator.seek(keyInternalByteBuffer));
|
iterSeekTime.record(() -> rocksIterator.seek(keyInternalByteBuffer));
|
||||||
|
@ -3,7 +3,7 @@ package it.cavallium.dbengine.database.memory;
|
|||||||
import static it.cavallium.dbengine.lucene.LuceneUtils.luceneScheduler;
|
import static it.cavallium.dbengine.lucene.LuceneUtils.luceneScheduler;
|
||||||
|
|
||||||
import io.micrometer.core.instrument.MeterRegistry;
|
import io.micrometer.core.instrument.MeterRegistry;
|
||||||
import io.netty5.buffer.api.BufferAllocator;
|
import io.netty5.buffer.BufferAllocator;
|
||||||
import it.cavallium.dbengine.database.LLDatabaseConnection;
|
import it.cavallium.dbengine.database.LLDatabaseConnection;
|
||||||
import it.cavallium.dbengine.database.LLKeyValueDatabase;
|
import it.cavallium.dbengine.database.LLKeyValueDatabase;
|
||||||
import it.cavallium.dbengine.database.LLLuceneIndex;
|
import it.cavallium.dbengine.database.LLLuceneIndex;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package it.cavallium.dbengine.database.memory;
|
package it.cavallium.dbengine.database.memory;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import io.netty5.buffer.api.BufferAllocator;
|
import io.netty5.buffer.BufferAllocator;
|
||||||
import io.netty5.util.Resource;
|
import io.netty5.util.Resource;
|
||||||
import io.netty5.util.Send;
|
import io.netty5.util.Send;
|
||||||
import it.cavallium.dbengine.client.BadBlock;
|
import it.cavallium.dbengine.client.BadBlock;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package it.cavallium.dbengine.database.memory;
|
package it.cavallium.dbengine.database.memory;
|
||||||
|
|
||||||
import io.micrometer.core.instrument.MeterRegistry;
|
import io.micrometer.core.instrument.MeterRegistry;
|
||||||
import io.netty5.buffer.api.BufferAllocator;
|
import io.netty5.buffer.BufferAllocator;
|
||||||
import it.cavallium.dbengine.client.MemoryStats;
|
import it.cavallium.dbengine.client.MemoryStats;
|
||||||
import it.cavallium.dbengine.database.ColumnProperty;
|
import it.cavallium.dbengine.database.ColumnProperty;
|
||||||
import it.cavallium.dbengine.database.LLDictionary;
|
import it.cavallium.dbengine.database.LLDictionary;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package it.cavallium.dbengine.database.memory;
|
package it.cavallium.dbengine.database.memory;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import io.netty5.buffer.api.BufferAllocator;
|
import io.netty5.buffer.BufferAllocator;
|
||||||
import io.netty5.util.Send;
|
import io.netty5.util.Send;
|
||||||
import it.cavallium.dbengine.database.LLDelta;
|
import it.cavallium.dbengine.database.LLDelta;
|
||||||
import it.cavallium.dbengine.database.LLDictionaryResultType;
|
import it.cavallium.dbengine.database.LLDictionaryResultType;
|
||||||
|
@ -4,8 +4,8 @@ import com.google.common.collect.Multimap;
|
|||||||
import io.micrometer.core.instrument.MeterRegistry;
|
import io.micrometer.core.instrument.MeterRegistry;
|
||||||
import io.netty.handler.ssl.util.InsecureTrustManagerFactory;
|
import io.netty.handler.ssl.util.InsecureTrustManagerFactory;
|
||||||
import io.netty.incubator.codec.quic.QuicSslContextBuilder;
|
import io.netty.incubator.codec.quic.QuicSslContextBuilder;
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import io.netty5.buffer.api.BufferAllocator;
|
import io.netty5.buffer.BufferAllocator;
|
||||||
import io.netty5.util.Send;
|
import io.netty5.util.Send;
|
||||||
import it.cavallium.dbengine.client.MemoryStats;
|
import it.cavallium.dbengine.client.MemoryStats;
|
||||||
import it.cavallium.dbengine.client.query.current.data.Query;
|
import it.cavallium.dbengine.client.query.current.data.Query;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package it.cavallium.dbengine.database.remote;
|
package it.cavallium.dbengine.database.remote;
|
||||||
|
|
||||||
import io.netty.handler.codec.ByteToMessageCodec;
|
import io.netty.handler.codec.ByteToMessageCodec;
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import io.netty5.util.Send;
|
import io.netty5.util.Send;
|
||||||
import it.cavallium.data.generator.nativedata.NullableString;
|
import it.cavallium.data.generator.nativedata.NullableString;
|
||||||
import it.cavallium.dbengine.database.OptionalBuf;
|
import it.cavallium.dbengine.database.OptionalBuf;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package it.cavallium.dbengine.database.serialization;
|
package it.cavallium.dbengine.database.serialization;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import io.netty5.util.Send;
|
import io.netty5.util.Send;
|
||||||
import it.cavallium.dbengine.database.DiscardingCloseable;
|
import it.cavallium.dbengine.database.DiscardingCloseable;
|
||||||
import it.cavallium.dbengine.database.SafeCloseable;
|
import it.cavallium.dbengine.database.SafeCloseable;
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
package it.cavallium.dbengine.database.serialization;
|
package it.cavallium.dbengine.database.serialization;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import io.netty5.buffer.api.ReadableComponent;
|
|
||||||
import io.netty5.buffer.api.ReadableComponentProcessor;
|
|
||||||
import io.netty5.util.Send;
|
import io.netty5.util.Send;
|
||||||
import it.cavallium.dbengine.database.SafeCloseable;
|
import it.cavallium.dbengine.database.SafeCloseable;
|
||||||
import java.io.DataInput;
|
import java.io.DataInput;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package it.cavallium.dbengine.database.serialization;
|
package it.cavallium.dbengine.database.serialization;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import java.io.DataOutput;
|
import java.io.DataOutput;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package it.cavallium.dbengine.database.serialization;
|
package it.cavallium.dbengine.database.serialization;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import io.netty5.buffer.api.BufferAllocator;
|
import io.netty5.buffer.BufferAllocator;
|
||||||
import io.netty5.util.Send;
|
import io.netty5.util.Send;
|
||||||
import java.io.IOError;
|
import java.io.IOError;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package it.cavallium.dbengine.database.serialization;
|
package it.cavallium.dbengine.database.serialization;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import io.netty5.buffer.api.BufferAllocator;
|
import io.netty5.buffer.BufferAllocator;
|
||||||
import io.netty5.util.Send;
|
import io.netty5.util.Send;
|
||||||
import io.netty5.util.internal.StringUtil;
|
import io.netty5.util.internal.StringUtil;
|
||||||
import it.cavallium.dbengine.database.LLUtils;
|
import it.cavallium.dbengine.database.LLUtils;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package it.cavallium.dbengine.database.serialization;
|
package it.cavallium.dbengine.database.serialization;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import io.netty5.buffer.api.BufferAllocator;
|
import io.netty5.buffer.BufferAllocator;
|
||||||
import io.netty5.util.Send;
|
import io.netty5.util.Send;
|
||||||
import it.cavallium.dbengine.database.LLUtils;
|
import it.cavallium.dbengine.database.LLUtils;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package it.cavallium.dbengine.lucene;
|
package it.cavallium.dbengine.lucene;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
public class ByteArrayCodec implements HugePqCodec<byte[]> {
|
public class ByteArrayCodec implements HugePqCodec<byte[]> {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package it.cavallium.dbengine.lucene;
|
package it.cavallium.dbengine.lucene;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import org.apache.lucene.util.BytesRef;
|
import org.apache.lucene.util.BytesRef;
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package it.cavallium.dbengine.lucene;
|
package it.cavallium.dbengine.lucene;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
public class DoubleCodec implements HugePqCodec<Double> {
|
public class DoubleCodec implements HugePqCodec<Double> {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package it.cavallium.dbengine.lucene;
|
package it.cavallium.dbengine.lucene;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
public class FloatCodec implements HugePqCodec<Float> {
|
public class FloatCodec implements HugePqCodec<Float> {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package it.cavallium.dbengine.lucene;
|
package it.cavallium.dbengine.lucene;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import it.cavallium.dbengine.database.DiscardingCloseable;
|
import it.cavallium.dbengine.database.DiscardingCloseable;
|
||||||
import it.cavallium.dbengine.database.LLUtils;
|
import it.cavallium.dbengine.database.LLUtils;
|
||||||
import it.cavallium.dbengine.database.SafeCloseable;
|
import it.cavallium.dbengine.database.SafeCloseable;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package it.cavallium.dbengine.lucene;
|
package it.cavallium.dbengine.lucene;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import org.apache.lucene.util.BitUtil;
|
import org.apache.lucene.util.BitUtil;
|
||||||
import org.apache.lucene.util.NumericUtils;
|
import org.apache.lucene.util.NumericUtils;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package it.cavallium.dbengine.lucene;
|
package it.cavallium.dbengine.lucene;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import it.cavallium.dbengine.database.LLRange;
|
import it.cavallium.dbengine.database.LLRange;
|
||||||
import it.cavallium.dbengine.database.LLUtils;
|
import it.cavallium.dbengine.database.LLUtils;
|
||||||
import it.cavallium.dbengine.database.SafeCloseable;
|
import it.cavallium.dbengine.database.SafeCloseable;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package it.cavallium.dbengine.lucene;
|
package it.cavallium.dbengine.lucene;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
public class IntCodec implements HugePqCodec<Integer> {
|
public class IntCodec implements HugePqCodec<Integer> {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package it.cavallium.dbengine.lucene;
|
package it.cavallium.dbengine.lucene;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package it.cavallium.dbengine.lucene;
|
package it.cavallium.dbengine.lucene;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
public class LLScoreDocCodec implements HugePqCodec<LLScoreDoc> {
|
public class LLScoreDocCodec implements HugePqCodec<LLScoreDoc> {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package it.cavallium.dbengine.lucene;
|
package it.cavallium.dbengine.lucene;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import it.cavallium.dbengine.database.DiscardingCloseable;
|
import it.cavallium.dbengine.database.DiscardingCloseable;
|
||||||
import it.cavallium.dbengine.database.SafeCloseable;
|
import it.cavallium.dbengine.database.SafeCloseable;
|
||||||
import it.cavallium.dbengine.database.disk.LLTempHugePqEnv;
|
import it.cavallium.dbengine.database.disk.LLTempHugePqEnv;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package it.cavallium.dbengine.lucene;
|
package it.cavallium.dbengine.lucene;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
public class LongCodec implements HugePqCodec<Long> {
|
public class LongCodec implements HugePqCodec<Long> {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package it.cavallium.dbengine.lucene;
|
package it.cavallium.dbengine.lucene;
|
||||||
|
|
||||||
import io.netty5.buffer.api.BufferAllocator;
|
import io.netty5.buffer.BufferAllocator;
|
||||||
import it.cavallium.dbengine.lucene.directory.RocksDBInstance;
|
import it.cavallium.dbengine.lucene.directory.RocksDBInstance;
|
||||||
import it.cavallium.dbengine.lucene.directory.RocksdbFileStore;
|
import it.cavallium.dbengine.lucene.directory.RocksdbFileStore;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -26,6 +26,7 @@ import org.apache.lucene.codecs.compressing.Decompressor;
|
|||||||
import org.apache.lucene.codecs.lucene90.compressing.Lucene90CompressingStoredFieldsFormat;
|
import org.apache.lucene.codecs.lucene90.compressing.Lucene90CompressingStoredFieldsFormat;
|
||||||
import org.apache.lucene.index.FieldInfos;
|
import org.apache.lucene.index.FieldInfos;
|
||||||
import org.apache.lucene.index.SegmentInfo;
|
import org.apache.lucene.index.SegmentInfo;
|
||||||
|
import org.apache.lucene.store.ByteBuffersDataInput;
|
||||||
import org.apache.lucene.store.DataInput;
|
import org.apache.lucene.store.DataInput;
|
||||||
import org.apache.lucene.store.DataOutput;
|
import org.apache.lucene.store.DataOutput;
|
||||||
import org.apache.lucene.store.Directory;
|
import org.apache.lucene.store.Directory;
|
||||||
@ -76,8 +77,8 @@ public class Lucene90NoCompressionStoredFieldsFormat extends StoredFieldsFormat
|
|||||||
private static final Compressor DUMMY_COMPRESSOR = new Compressor() {
|
private static final Compressor DUMMY_COMPRESSOR = new Compressor() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void compress(byte[] bytes, int off, int len, DataOutput out) throws IOException {
|
public void compress(ByteBuffersDataInput byteBuffersDataInput, DataOutput dataOutput) throws IOException {
|
||||||
out.writeBytes(bytes, off, len);
|
dataOutput.copyBytes(byteBuffersDataInput, byteBuffersDataInput.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package it.cavallium.dbengine.lucene.directory;
|
package it.cavallium.dbengine.lucene.directory;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import io.netty5.buffer.api.BufferAllocator;
|
import io.netty5.buffer.BufferAllocator;
|
||||||
import io.netty5.buffer.api.BufferRef;
|
import io.netty5.buffer.BufferRef;
|
||||||
import org.apache.lucene.store.IndexInput;
|
import org.apache.lucene.store.IndexInput;
|
||||||
|
|
||||||
import java.io.EOFException;
|
import java.io.EOFException;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package it.cavallium.dbengine.lucene.directory;
|
package it.cavallium.dbengine.lucene.directory;
|
||||||
|
|
||||||
import com.google.common.util.concurrent.Striped;
|
import com.google.common.util.concurrent.Striped;
|
||||||
import io.netty5.buffer.api.BufferAllocator;
|
import io.netty5.buffer.BufferAllocator;
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
|
@ -2,10 +2,9 @@ package it.cavallium.dbengine.lucene.directory;
|
|||||||
|
|
||||||
import com.google.common.primitives.Longs;
|
import com.google.common.primitives.Longs;
|
||||||
import com.google.common.util.concurrent.Striped;
|
import com.google.common.util.concurrent.Striped;
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import io.netty5.buffer.api.BufferAllocator;
|
import io.netty5.buffer.BufferAllocator;
|
||||||
import io.netty5.buffer.api.ReadableComponent;
|
import io.netty5.buffer.BufferComponent;
|
||||||
import io.netty5.buffer.api.WritableComponent;
|
|
||||||
import it.cavallium.dbengine.database.LLUtils;
|
import it.cavallium.dbengine.database.LLUtils;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
@ -119,13 +118,13 @@ public class RocksdbFileStore {
|
|||||||
|
|
||||||
private static ByteBuffer readableNioBuffer(Buffer buffer) {
|
private static ByteBuffer readableNioBuffer(Buffer buffer) {
|
||||||
assert buffer.countReadableComponents() == 1 : "Readable components count: " + buffer.countReadableComponents();
|
assert buffer.countReadableComponents() == 1 : "Readable components count: " + buffer.countReadableComponents();
|
||||||
return ((ReadableComponent) buffer).readableBuffer();
|
return ((BufferComponent) buffer).readableBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ByteBuffer writableNioBuffer(Buffer buffer, int newWriterOffset) {
|
private static ByteBuffer writableNioBuffer(Buffer buffer, int newWriterOffset) {
|
||||||
assert buffer.countWritableComponents() == 1 : "Writable components count: " + buffer.countWritableComponents();
|
assert buffer.countWritableComponents() == 1 : "Writable components count: " + buffer.countWritableComponents();
|
||||||
buffer.writerOffset(0).ensureWritable(newWriterOffset);
|
buffer.writerOffset(0).ensureWritable(newWriterOffset);
|
||||||
var byteBuf = ((WritableComponent) buffer).writableBuffer();
|
var byteBuf = ((BufferComponent) buffer).writableBuffer();
|
||||||
buffer.writerOffset(newWriterOffset);
|
buffer.writerOffset(newWriterOffset);
|
||||||
assert buffer.capacity() >= newWriterOffset : "Returned capacity " + buffer.capacity() + " < " + newWriterOffset;
|
assert buffer.capacity() >= newWriterOffset : "Returned capacity " + buffer.capacity() + " < " + newWriterOffset;
|
||||||
return byteBuf;
|
return byteBuf;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package it.cavallium.dbengine.lucene.directory;
|
package it.cavallium.dbengine.lucene.directory;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import io.netty5.buffer.api.BufferAllocator;
|
import io.netty5.buffer.BufferAllocator;
|
||||||
import java.io.EOFException;
|
import java.io.EOFException;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import org.apache.lucene.store.IndexInput;
|
import org.apache.lucene.store.IndexInput;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package it.cavallium.dbengine.lucene.directory;
|
package it.cavallium.dbengine.lucene.directory;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.Buffer;
|
||||||
import org.apache.lucene.store.BufferedChecksum;
|
import org.apache.lucene.store.BufferedChecksum;
|
||||||
import org.apache.lucene.store.IndexOutput;
|
import org.apache.lucene.store.IndexOutput;
|
||||||
import org.apache.lucene.util.Accountable;
|
import org.apache.lucene.util.Accountable;
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
package it.cavallium.dbengine.lucene.searcher;
|
package it.cavallium.dbengine.lucene.searcher;
|
||||||
|
|
||||||
import io.netty5.buffer.api.Drop;
|
import io.netty5.buffer.Drop;
|
||||||
import io.netty5.buffer.api.Owned;
|
import io.netty5.buffer.Owned;
|
||||||
import it.cavallium.dbengine.client.query.current.data.TotalHitsCount;
|
import it.cavallium.dbengine.client.query.current.data.TotalHitsCount;
|
||||||
import it.cavallium.dbengine.database.DiscardingCloseable;
|
import it.cavallium.dbengine.database.DiscardingCloseable;
|
||||||
import it.cavallium.dbengine.database.LLKeyScore;
|
import it.cavallium.dbengine.database.LLKeyScore;
|
||||||
import io.netty5.buffer.api.internal.ResourceSupport;
|
import io.netty5.buffer.internal.ResourceSupport;
|
||||||
import it.cavallium.dbengine.utils.SimpleResource;
|
import it.cavallium.dbengine.utils.SimpleResource;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
@ -7,7 +7,7 @@ import static it.cavallium.dbengine.lucene.searcher.CurrentPageInfo.EMPTY_STATUS
|
|||||||
import static it.cavallium.dbengine.lucene.searcher.PaginationInfo.MAX_SINGLE_SEARCH_LIMIT;
|
import static it.cavallium.dbengine.lucene.searcher.PaginationInfo.MAX_SINGLE_SEARCH_LIMIT;
|
||||||
|
|
||||||
import io.netty5.util.Send;
|
import io.netty5.util.Send;
|
||||||
import io.netty5.buffer.api.internal.ResourceSupport;
|
import io.netty5.buffer.internal.ResourceSupport;
|
||||||
import it.cavallium.dbengine.client.query.current.data.TotalHitsCount;
|
import it.cavallium.dbengine.client.query.current.data.TotalHitsCount;
|
||||||
import it.cavallium.dbengine.database.LLKeyScore;
|
import it.cavallium.dbengine.database.LLKeyScore;
|
||||||
import it.cavallium.dbengine.database.LLUtils;
|
import it.cavallium.dbengine.database.LLUtils;
|
||||||
|
@ -4,12 +4,12 @@ import io.micrometer.core.instrument.MeterRegistry;
|
|||||||
import io.micrometer.core.instrument.Tag;
|
import io.micrometer.core.instrument.Tag;
|
||||||
import io.micrometer.core.instrument.Tags;
|
import io.micrometer.core.instrument.Tags;
|
||||||
import io.micrometer.core.instrument.binder.MeterBinder;
|
import io.micrometer.core.instrument.binder.MeterBinder;
|
||||||
import io.netty5.buffer.api.BufferAllocator;
|
import io.netty5.buffer.BufferAllocator;
|
||||||
import io.netty5.buffer.api.pool.BufferAllocatorMetric;
|
import io.netty5.buffer.pool.BufferAllocatorMetric;
|
||||||
import io.netty5.buffer.api.pool.BufferAllocatorMetricProvider;
|
import io.netty5.buffer.pool.BufferAllocatorMetricProvider;
|
||||||
import io.netty5.buffer.api.pool.PoolArenaMetric;
|
import io.netty5.buffer.pool.PoolArenaMetric;
|
||||||
import io.netty5.buffer.api.pool.PoolChunkListMetric;
|
import io.netty5.buffer.pool.PoolChunkListMetric;
|
||||||
import io.netty5.buffer.api.pool.PoolSubpageMetric;
|
import io.netty5.buffer.pool.PoolSubpageMetric;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user