Update lucene and netty 5

This commit is contained in:
Andrea Cavalli 2022-10-02 03:09:50 +02:00
parent b33bafec21
commit 78ba98c8c4
112 changed files with 262 additions and 267 deletions

View File

@ -13,7 +13,7 @@
<revision>0-SNAPSHOT</revision>
<dbengine.ci>false</dbengine.ci>
<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>
</properties>
<repositories>
@ -120,7 +120,7 @@
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty5-buffer</artifactId>
<version>5.0.0.Alpha4</version>
<version>5.0.0.Alpha5</version>
<exclusions>
<exclusion>
<groupId>io.netty</groupId>

View File

@ -1,7 +1,7 @@
package it.cavallium.dbengine;
import io.netty5.buffer.api.pool.PoolArenaMetric;
import io.netty5.buffer.api.pool.PooledBufferAllocator;
import io.netty5.buffer.pool.PoolArenaMetric;
import io.netty5.buffer.pool.PooledBufferAllocator;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;
@ -24,7 +24,7 @@ public class MetricUtils {
MethodHandle handle = null;
try {
// 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
handle = lookup.findVirtual(pooledBufferClass, "arenaMetrics", MethodType.methodType(List.class));
} catch (NoSuchMethodException | IllegalAccessException | ClassNotFoundException ex) {

View File

@ -1,7 +1,7 @@
package it.cavallium.dbengine.client;
import io.micrometer.core.instrument.MeterRegistry;
import io.netty5.buffer.api.BufferAllocator;
import io.netty5.buffer.BufferAllocator;
import it.cavallium.dbengine.database.DatabaseProperties;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

View File

@ -1,6 +1,6 @@
package it.cavallium.dbengine.client;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.Buffer;
import io.netty5.util.Send;
import it.cavallium.dbengine.database.serialization.SerializationException;
import it.cavallium.dbengine.database.serialization.Serializer;

View File

@ -1,6 +1,6 @@
package it.cavallium.dbengine.client;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.Buffer;
import io.netty5.util.Send;
import it.cavallium.dbengine.database.serialization.SerializationException;
import it.cavallium.dbengine.database.serialization.SerializerFixedBinaryLength;

View File

@ -1,6 +1,6 @@
package it.cavallium.dbengine.database;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.Buffer;
import io.netty5.util.Send;
import java.util.function.Supplier;

View File

@ -1,7 +1,7 @@
package it.cavallium.dbengine.database;
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.LuceneRocksDBManager;
import it.cavallium.dbengine.rpc.current.data.Column;

View File

@ -1,10 +1,10 @@
package it.cavallium.dbengine.database;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.api.Drop;
import io.netty5.buffer.api.Owned;
import io.netty5.buffer.Buffer;
import io.netty5.buffer.Drop;
import io.netty5.buffer.Owned;
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 java.util.StringJoiner;
import org.apache.logging.log4j.LogManager;

View File

@ -1,7 +1,7 @@
package it.cavallium.dbengine.database;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.api.BufferAllocator;
import io.netty5.buffer.Buffer;
import io.netty5.buffer.BufferAllocator;
import io.netty5.util.Send;
import it.cavallium.dbengine.client.BadBlock;
import it.cavallium.dbengine.database.disk.BinarySerializationFunction;

View File

@ -1,11 +1,11 @@
package it.cavallium.dbengine.database;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.api.Drop;
import io.netty5.buffer.api.Owned;
import io.netty5.buffer.Buffer;
import io.netty5.buffer.Drop;
import io.netty5.buffer.Owned;
import io.netty5.util.Resource;
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 java.util.Objects;
import java.util.StringJoiner;

View File

@ -3,7 +3,7 @@ package it.cavallium.dbengine.database;
import com.google.common.primitives.Ints;
import com.google.common.primitives.Longs;
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.MemoryStats;
import it.cavallium.dbengine.database.collections.DatabaseInt;

View File

@ -2,7 +2,7 @@ package it.cavallium.dbengine.database;
import com.google.common.collect.Multimap;
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.ConnectionPartLucene;
import it.cavallium.dbengine.client.ConnectionSettings.ConnectionPart.ConnectionPartRocksDB;

View File

@ -1,10 +1,10 @@
package it.cavallium.dbengine.database;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.api.Drop;
import io.netty5.buffer.api.Owned;
import io.netty5.buffer.Buffer;
import io.netty5.buffer.Drop;
import io.netty5.buffer.Owned;
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 java.util.StringJoiner;
import org.apache.logging.log4j.LogManager;

View File

@ -1,8 +1,8 @@
package it.cavallium.dbengine.database;
import io.netty5.buffer.api.Drop;
import io.netty5.buffer.api.Owned;
import io.netty5.buffer.api.internal.ResourceSupport;
import io.netty5.buffer.Drop;
import io.netty5.buffer.Owned;
import io.netty5.buffer.internal.ResourceSupport;
import it.cavallium.dbengine.client.LuceneIndexImpl;
import it.cavallium.dbengine.client.query.current.data.TotalHitsCount;
import it.cavallium.dbengine.lucene.LuceneCloseable;

View File

@ -1,7 +1,7 @@
package it.cavallium.dbengine.database;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.api.BufferAllocator;
import io.netty5.buffer.Buffer;
import io.netty5.buffer.BufferAllocator;
import io.netty5.util.Send;
import it.cavallium.dbengine.database.disk.BinarySerializationFunction;
import it.cavallium.dbengine.database.serialization.SerializationFunction;

View File

@ -1,21 +1,20 @@
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 org.apache.commons.lang3.ArrayUtils.EMPTY_BYTE_ARRAY;
import com.google.common.primitives.Ints;
import com.google.common.primitives.Longs;
import io.netty5.buffer.api.AllocatorControl;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.api.BufferAllocator;
import io.netty5.buffer.api.CompositeBuffer;
import io.netty5.buffer.api.Drop;
import io.netty5.buffer.api.ReadableComponent;
import io.netty5.buffer.AllocatorControl;
import io.netty5.buffer.Buffer;
import io.netty5.buffer.BufferAllocator;
import io.netty5.buffer.BufferComponent;
import io.netty5.buffer.CompositeBuffer;
import io.netty5.buffer.Drop;
import io.netty5.util.Resource;
import io.netty5.util.Send;
import io.netty5.buffer.api.WritableComponent;
import io.netty5.buffer.api.internal.Statics;
import io.netty5.util.IllegalReferenceCountException;
import it.cavallium.dbengine.database.serialization.SerializationException;
import it.cavallium.dbengine.database.serialization.SerializationFunction;
@ -534,7 +533,7 @@ public class LLUtils {
try {
assert directBuffer.readerOffset() == 0;
assert directBuffer.writerOffset() == 0;
var directBufferWriter = ((WritableComponent) directBuffer).writableBuffer();
var directBufferWriter = ((BufferComponent) directBuffer).writableBuffer();
assert directBufferWriter.position() == 0;
assert directBufferWriter.capacity() >= directBuffer.capacity();
assert directBufferWriter.isDirect();
@ -552,7 +551,7 @@ public class LLUtils {
assert directBuffer.readerOffset() == 0;
directBuffer.ensureWritable(trueSize);
assert directBuffer.writerOffset() == 0;
directBufferWriter = ((WritableComponent) directBuffer).writableBuffer();
directBufferWriter = ((BufferComponent) directBuffer).writableBuffer();
assert directBufferWriter.position() == 0;
assert directBufferWriter.isDirect();
reader.applyAsInt(directBufferWriter.position(0));
@ -783,16 +782,16 @@ public class LLUtils {
private static Drop<Buffer> drop() {
// 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) {
return inputBuffer.isDirect() && inputBuffer instanceof ReadableComponent;
return inputBuffer instanceof BufferComponent component && component.readableNativeAddress() != 0;
}
public static ByteBuffer getReadOnlyDirect(Buffer inputBuffer) {
assert isReadOnlyDirect(inputBuffer);
return ((ReadableComponent) inputBuffer).readableBuffer();
return ((BufferComponent) inputBuffer).readableBuffer();
}
public static Buffer fromByteArray(BufferAllocator alloc, byte[] array) {
@ -967,7 +966,7 @@ public class LLUtils {
if (readableComponents == 0) {
return true;
} else if (readableComponents == 1) {
return key.forEachReadable(0, (index, component) -> component.readableBuffer().isDirect()) >= 0;
return key.isDirect();
} else {
return false;
}

View File

@ -1,6 +1,6 @@
package it.cavallium.dbengine.database;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.Buffer;
import java.util.NoSuchElementException;
import java.util.Objects;
import java.util.Optional;

View File

@ -1,7 +1,7 @@
package it.cavallium.dbengine.database.collections;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.api.BufferAllocator;
import io.netty5.buffer.Buffer;
import io.netty5.buffer.BufferAllocator;
import it.cavallium.dbengine.database.BufSupplier;
import it.cavallium.dbengine.database.LLDictionary;
import it.cavallium.dbengine.database.serialization.Serializer;

View File

@ -2,9 +2,9 @@ package it.cavallium.dbengine.database.collections;
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.buffer.api.internal.ResourceSupport;
import io.netty5.buffer.internal.ResourceSupport;
import it.cavallium.dbengine.client.CompositeSnapshot;
import it.cavallium.dbengine.database.BufSupplier;
import it.cavallium.dbengine.database.Delta;

View File

@ -1,12 +1,12 @@
package it.cavallium.dbengine.database.collections;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.api.BufferAllocator;
import io.netty5.buffer.api.DefaultBufferAllocators;
import io.netty5.buffer.api.Drop;
import io.netty5.buffer.api.Owned;
import io.netty5.buffer.Buffer;
import io.netty5.buffer.BufferAllocator;
import io.netty5.buffer.DefaultBufferAllocators;
import io.netty5.buffer.Drop;
import io.netty5.buffer.Owned;
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.CompositeSnapshot;
import it.cavallium.dbengine.database.BufSupplier;

View File

@ -1,15 +1,15 @@
package it.cavallium.dbengine.database.collections;
import io.netty5.buffer.api.BufferAllocator;
import io.netty5.buffer.api.Drop;
import io.netty5.buffer.api.Owned;
import io.netty5.buffer.BufferAllocator;
import io.netty5.buffer.Drop;
import io.netty5.buffer.Owned;
import io.netty5.util.Send;
import it.cavallium.dbengine.client.BadBlock;
import it.cavallium.dbengine.client.CompositeSnapshot;
import it.cavallium.dbengine.database.BufSupplier;
import it.cavallium.dbengine.database.LLDictionary;
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.UpdateMode;
import it.cavallium.dbengine.database.serialization.Serializer;

View File

@ -1,9 +1,9 @@
package it.cavallium.dbengine.database.collections;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.api.Drop;
import io.netty5.buffer.api.Owned;
import io.netty5.buffer.api.internal.ResourceSupport;
import io.netty5.buffer.Buffer;
import io.netty5.buffer.Drop;
import io.netty5.buffer.Owned;
import io.netty5.buffer.internal.ResourceSupport;
import it.cavallium.dbengine.client.BadBlock;
import it.cavallium.dbengine.client.CompositeSnapshot;
import it.cavallium.dbengine.database.BufSupplier;

View File

@ -1,7 +1,7 @@
package it.cavallium.dbengine.database.collections;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.api.Drop;
import io.netty5.buffer.Buffer;
import io.netty5.buffer.Drop;
import io.netty5.util.Send;
import it.cavallium.dbengine.client.CompositeSnapshot;
import it.cavallium.dbengine.database.BufSupplier;

View File

@ -1,7 +1,7 @@
package it.cavallium.dbengine.database.collections;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.api.Drop;
import io.netty5.buffer.Buffer;
import io.netty5.buffer.Drop;
import io.netty5.util.Send;
import it.cavallium.dbengine.client.CompositeSnapshot;
import it.cavallium.dbengine.database.BufSupplier;

View File

@ -1,13 +1,13 @@
package it.cavallium.dbengine.database.collections;
import io.netty5.buffer.api.Drop;
import io.netty5.buffer.api.Owned;
import io.netty5.buffer.Drop;
import io.netty5.buffer.Owned;
import io.netty5.util.Send;
import it.cavallium.dbengine.client.BadBlock;
import it.cavallium.dbengine.client.CompositeSnapshot;
import it.cavallium.dbengine.database.Delta;
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.serialization.SerializationFunction;
import it.cavallium.dbengine.utils.SimpleResource;

View File

@ -1,9 +1,9 @@
package it.cavallium.dbengine.database.collections;
import io.netty5.buffer.api.Drop;
import io.netty5.buffer.api.Owned;
import io.netty5.buffer.Drop;
import io.netty5.buffer.Owned;
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.CompositeSnapshot;
import it.cavallium.dbengine.client.Mapper;

View File

@ -1,9 +1,9 @@
package it.cavallium.dbengine.database.collections;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.api.Drop;
import io.netty5.buffer.api.Owned;
import io.netty5.buffer.api.internal.ResourceSupport;
import io.netty5.buffer.Buffer;
import io.netty5.buffer.Drop;
import io.netty5.buffer.Owned;
import io.netty5.buffer.internal.ResourceSupport;
import it.cavallium.dbengine.client.BadBlock;
import it.cavallium.dbengine.client.CompositeSnapshot;
import it.cavallium.dbengine.database.Delta;

View File

@ -1,6 +1,6 @@
package it.cavallium.dbengine.database.collections;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.Buffer;
import io.netty5.util.Send;
import it.cavallium.dbengine.client.CompositeSnapshot;
import it.cavallium.dbengine.database.LLDictionary;

View File

@ -1,6 +1,6 @@
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.Send;
import it.cavallium.dbengine.client.CompositeSnapshot;

View File

@ -1,6 +1,6 @@
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.Send;
import it.cavallium.dbengine.client.CompositeSnapshot;

View File

@ -1,6 +1,6 @@
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.database.BufSupplier;
import it.cavallium.dbengine.database.LLDictionary;

View File

@ -1,6 +1,6 @@
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.Send;
import it.cavallium.dbengine.client.CompositeSnapshot;

View File

@ -1,6 +1,6 @@
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.Send;
import it.cavallium.dbengine.client.CompositeSnapshot;

View File

@ -1,6 +1,6 @@
package it.cavallium.dbengine.database.collections;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.Buffer;
import io.netty5.util.Send;
import it.cavallium.dbengine.client.CompositeSnapshot;
import it.cavallium.dbengine.database.BufSupplier;

View File

@ -1,6 +1,6 @@
package it.cavallium.dbengine.database.collections;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.Buffer;
import io.netty5.util.Send;
import it.cavallium.dbengine.database.serialization.Serializer;

View File

@ -1,8 +1,8 @@
package it.cavallium.dbengine.database.collections;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.api.BufferAllocator;
import io.netty5.buffer.api.CompositeBuffer;
import io.netty5.buffer.Buffer;
import io.netty5.buffer.BufferAllocator;
import io.netty5.buffer.CompositeBuffer;
import io.netty5.util.Send;
import it.cavallium.dbengine.database.LLUtils;
import it.cavallium.dbengine.database.serialization.SerializationException;

View File

@ -1,7 +1,7 @@
package it.cavallium.dbengine.database.collections;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.api.BufferAllocator;
import io.netty5.buffer.Buffer;
import io.netty5.buffer.BufferAllocator;
import io.netty5.util.Send;
import it.cavallium.dbengine.database.serialization.SerializationException;
import it.cavallium.dbengine.database.serialization.Serializer;

View File

@ -1,6 +1,6 @@
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.isReadOnlyDirect;
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.MeterRegistry;
import io.micrometer.core.instrument.Timer;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.api.BufferAllocator;
import io.netty5.buffer.api.DefaultBufferAllocators;
import io.netty5.buffer.api.ReadableComponent;
import io.netty5.buffer.api.WritableComponent;
import io.netty5.buffer.Buffer;
import io.netty5.buffer.BufferAllocator;
import io.netty5.buffer.BufferComponent;
import io.netty5.buffer.DefaultBufferAllocators;
import it.cavallium.dbengine.database.LLRange;
import it.cavallium.dbengine.database.LLUtils;
import it.cavallium.dbengine.database.RepeatedElementList;
@ -256,7 +255,7 @@ public sealed abstract class AbstractRocksDBColumn<T extends RocksDB> implements
requireNonNull(key);
AbstractSlice<?> slice;
if (allowNettyDirect && USE_DIRECT_BUFFER_BOUNDS && isReadOnlyDirect(key)) {
ByteBuffer keyInternalByteBuffer = ((ReadableComponent) key).readableBuffer();
ByteBuffer keyInternalByteBuffer = ((BufferComponent) key).readableBuffer();
assert keyInternalByteBuffer.position() == 0;
slice = new DirectSlice(keyInternalByteBuffer, key.readableBytes());
assert slice.size() == key.readableBytes();
@ -371,7 +370,7 @@ public sealed abstract class AbstractRocksDBColumn<T extends RocksDB> implements
} else {
mustCloseKey = false;
}
keyNioBuffer = ((ReadableComponent) key).readableBuffer();
keyNioBuffer = ((BufferComponent) key).readableBuffer();
assert keyNioBuffer.isDirect();
assert keyNioBuffer.limit() == key.readableBytes();
}
@ -389,7 +388,7 @@ public sealed abstract class AbstractRocksDBColumn<T extends RocksDB> implements
} else {
mustCloseValue = false;
}
valueNioBuffer = ((ReadableComponent) value).readableBuffer();
valueNioBuffer = ((BufferComponent) value).readableBuffer();
assert valueNioBuffer.isDirect();
assert valueNioBuffer.limit() == value.readableBytes();
}
@ -434,7 +433,7 @@ public sealed abstract class AbstractRocksDBColumn<T extends RocksDB> implements
} else {
mustCloseKey = false;
}
keyNioBuffer = ((ReadableComponent) key).readableBuffer();
keyNioBuffer = ((BufferComponent) key).readableBuffer();
assert keyNioBuffer.isDirect();
assert keyNioBuffer.limit() == key.readableBytes();
}
@ -508,7 +507,7 @@ public sealed abstract class AbstractRocksDBColumn<T extends RocksDB> implements
} else {
mustCloseKey = false;
}
keyNioBuffer = ((ReadableComponent) key).readableBuffer();
keyNioBuffer = ((BufferComponent) key).readableBuffer();
assert keyNioBuffer.isDirect();
assert keyNioBuffer.limit() == key.readableBytes();
}
@ -549,7 +548,7 @@ public sealed abstract class AbstractRocksDBColumn<T extends RocksDB> implements
} else {
mustCloseKey = false;
}
keyNioBuffer = ((ReadableComponent) key).readableBuffer();
keyNioBuffer = ((BufferComponent) key).readableBuffer();
assert keyNioBuffer.isDirect();
assert keyNioBuffer.limit() == key.readableBytes();
}

View File

@ -1,6 +1,6 @@
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 org.jetbrains.annotations.Nullable;

View File

@ -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.isReadOnlyDirect;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.api.BufferAllocator;
import io.netty5.buffer.api.ReadableComponent;
import io.netty5.buffer.Buffer;
import io.netty5.buffer.BufferAllocator;
import io.netty5.buffer.BufferComponent;
import io.netty5.util.Send;
import io.netty5.util.internal.PlatformDependent;
import it.cavallium.dbengine.database.LLUtils;
@ -116,8 +116,8 @@ public class CappedWriteBatch extends WriteBatch {
if (USE_FAST_DIRECT_BUFFERS
&& (isReadOnlyDirect(key))
&& (isReadOnlyDirect(value))) {
ByteBuffer keyNioBuffer = ((ReadableComponent) key).readableBuffer();
ByteBuffer valueNioBuffer = ((ReadableComponent) value).readableBuffer();
ByteBuffer keyNioBuffer = ((BufferComponent) key).readableBuffer();
ByteBuffer valueNioBuffer = ((BufferComponent) value).readableBuffer();
buffersToRelease.add(value);
buffersToRelease.add(key);
@ -162,7 +162,7 @@ public class CappedWriteBatch extends WriteBatch {
public synchronized void delete(ColumnFamilyHandle columnFamilyHandle, Send<Buffer> keyToReceive) throws RocksDBException {
var key = keyToReceive.receive();
if (USE_FAST_DIRECT_BUFFERS && isReadOnlyDirect(key)) {
ByteBuffer keyNioBuffer = ((ReadableComponent) key).readableBuffer();
ByteBuffer keyNioBuffer = ((BufferComponent) key).readableBuffer();
buffersToRelease.add(key);
delete(columnFamilyHandle, keyNioBuffer);
} else {

View File

@ -4,7 +4,7 @@ import static it.cavallium.dbengine.database.disk.LLTempHugePqEnv.getColumnOptio
import com.google.common.primitives.Ints;
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.unimi.dsi.fastutil.ints.Int2ObjectMap;
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;

View File

@ -8,11 +8,10 @@ import static org.rocksdb.KeyMayExist.KeyMayExistEnum.kExistsWithValue;
import static org.rocksdb.KeyMayExist.KeyMayExistEnum.kExistsWithoutValue;
import static org.rocksdb.KeyMayExist.KeyMayExistEnum.kNotExist;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.api.BufferAllocator;
import io.netty5.buffer.api.DefaultBufferAllocators;
import io.netty5.buffer.api.ReadableComponent;
import io.netty5.buffer.api.WritableComponent;
import io.netty5.buffer.Buffer;
import io.netty5.buffer.BufferAllocator;
import io.netty5.buffer.BufferComponent;
import io.netty5.buffer.DefaultBufferAllocators;
import it.cavallium.dbengine.database.LLUtils;
import java.nio.ByteBuffer;
import java.util.Arrays;
@ -75,7 +74,7 @@ public abstract class KeyMayExistGetter {
} else {
mustCloseKey = false;
}
keyNioBuffer = ((ReadableComponent) key).readableBuffer();
keyNioBuffer = ((BufferComponent) key).readableBuffer();
assert keyNioBuffer.isDirect();
assert keyNioBuffer.limit() == key.readableBytes();
}
@ -86,14 +85,14 @@ public abstract class KeyMayExistGetter {
try {
assert resultBuffer.readerOffset() == 0;
assert resultBuffer.writerOffset() == 0;
var resultWritable = ((WritableComponent) resultBuffer).writableBuffer();
var resultWritable = ((BufferComponent) resultBuffer).writableBuffer();
var keyMayExist = keyMayExist(readOptions, keyNioBuffer.rewind(), resultWritable.clear());
if (STRICT_MAYEXIST_NO_VALUE && keyMayExist.exists != kExistsWithValue && keyMayExist.valueLength != 0) {
// Create a direct result buffer because RocksDB works only with direct buffers
try (var realResultBuffer = bufferAllocator.allocate(INITIAL_DIRECT_READ_BYTE_BUF_SIZE_BYTES)) {
var resultWritableF = resultWritable;
var realResultWritable = ((WritableComponent) realResultBuffer).writableBuffer();
var realResultWritable = ((BufferComponent) realResultBuffer).writableBuffer();
var realSize = get(readOptions, keyNioBuffer.rewind(), realResultWritable);
var hexFormat = HexFormat.ofDelimiter(" ");
LOG.error(
@ -178,7 +177,7 @@ public abstract class KeyMayExistGetter {
return resultBuffer.writerOffset(resultWritable.limit());
} else {
resultBuffer.ensureWritable(size);
resultWritable = ((WritableComponent) resultBuffer).writableBuffer();
resultWritable = ((BufferComponent) resultBuffer).writableBuffer();
assert resultBuffer.readerOffset() == 0;
assert resultBuffer.writerOffset() == 0;

View File

@ -1,8 +1,8 @@
package it.cavallium.dbengine.database.disk;
import io.netty5.buffer.api.Drop;
import io.netty5.buffer.api.Owned;
import io.netty5.buffer.api.internal.ResourceSupport;
import io.netty5.buffer.Drop;
import io.netty5.buffer.Owned;
import io.netty5.buffer.internal.ResourceSupport;
import it.cavallium.dbengine.database.DiscardingCloseable;
import it.cavallium.dbengine.database.SafeCloseable;
import it.cavallium.dbengine.utils.SimpleResource;

View File

@ -3,7 +3,7 @@ package it.cavallium.dbengine.database.disk;
import static it.cavallium.dbengine.lucene.LuceneUtils.luceneScheduler;
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.LLLuceneIndex;
import it.cavallium.dbengine.lucene.LuceneHacks;

View File

@ -1,6 +1,6 @@
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.MARKER_ROCKSDB;
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.Timer;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.api.BufferAllocator;
import io.netty5.buffer.api.ReadableComponent;
import io.netty5.buffer.Buffer;
import io.netty5.buffer.BufferAllocator;
import io.netty5.buffer.BufferComponent;
import io.netty5.util.Resource;
import it.cavallium.dbengine.client.BadBlock;
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())) {
if (!LLLocalDictionary.PREFER_AUTO_SEEK_BOUND && range.hasMin()) {
if (nettyDirect && isReadOnlyDirect(range.getMinUnsafe())) {
var seekBuf = ((ReadableComponent) range.getMinUnsafe()).readableBuffer();
var seekBuf = ((BufferComponent) range.getMinUnsafe()).readableBuffer();
rocksIterator.seek(seekBuf);
} else {
var seekArray = LLUtils.toArray(range.getMinUnsafe());

View File

@ -1,6 +1,6 @@
package it.cavallium.dbengine.database.disk;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.Buffer;
import io.netty5.util.Send;
import it.cavallium.dbengine.database.LLEntry;
import it.cavallium.dbengine.database.LLRange;

View File

@ -1,6 +1,6 @@
package it.cavallium.dbengine.database.disk;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.Buffer;
import io.netty5.util.Send;
import it.cavallium.dbengine.database.LLEntry;
import it.cavallium.dbengine.database.LLRange;

View File

@ -1,6 +1,6 @@
package it.cavallium.dbengine.database.disk;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.Buffer;
import io.netty5.util.Send;
import it.cavallium.dbengine.database.LLRange;
import java.util.function.Supplier;

View File

@ -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.isBoundedRange;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.Buffer;
import it.cavallium.dbengine.database.LLRange;
import it.cavallium.dbengine.database.LLUtils;
import it.unimi.dsi.fastutil.objects.ObjectArrayList;

View File

@ -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.isBoundedRange;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.api.Drop;
import io.netty5.buffer.api.Owned;
import io.netty5.buffer.Buffer;
import io.netty5.buffer.Drop;
import io.netty5.buffer.Owned;
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.LLUtils;
import java.util.function.Supplier;

View File

@ -1,6 +1,6 @@
package it.cavallium.dbengine.database.disk;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.Buffer;
import io.netty5.util.Send;
import it.cavallium.dbengine.database.LLRange;
import java.util.function.Supplier;

View File

@ -1,6 +1,6 @@
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 java.lang.Boolean.parseBoolean;
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.Tag;
import io.micrometer.core.instrument.Timer;
import io.netty5.buffer.api.BufferAllocator;
import io.netty5.buffer.BufferAllocator;
import io.netty5.util.internal.PlatformDependent;
import it.cavallium.data.generator.nativedata.NullableString;
import it.cavallium.dbengine.client.Backuppable;

View File

@ -2,10 +2,10 @@ package it.cavallium.dbengine.database.disk;
import static it.cavallium.dbengine.database.LLUtils.generateCustomReadOptions;
import io.netty5.buffer.api.Drop;
import io.netty5.buffer.api.Owned;
import io.netty5.buffer.Drop;
import io.netty5.buffer.Owned;
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.LLUtils;
import it.cavallium.dbengine.utils.SimpleResource;

View File

@ -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.isBoundedRange;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.Buffer;
import it.cavallium.dbengine.database.LLRange;
import it.cavallium.dbengine.database.LLUtils;
import java.util.function.Supplier;

View File

@ -2,8 +2,8 @@ package it.cavallium.dbengine.database.disk;
import static it.cavallium.dbengine.database.disk.UpdateAtomicResultMode.DELTA;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.api.BufferAllocator;
import io.netty5.buffer.Buffer;
import io.netty5.buffer.BufferAllocator;
import io.netty5.util.Send;
import it.cavallium.dbengine.database.LLDelta;
import it.cavallium.dbengine.database.LLSingleton;

View File

@ -4,9 +4,9 @@ import static it.cavallium.dbengine.database.LLUtils.MARKER_ROCKSDB;
import io.micrometer.core.instrument.DistributionSummary;
import io.micrometer.core.instrument.MeterRegistry;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.api.BufferAllocator;
import io.netty5.buffer.api.MemoryManager;
import io.netty5.buffer.Buffer;
import io.netty5.buffer.BufferAllocator;
import io.netty5.buffer.MemoryManager;
import io.netty5.util.Send;
import it.cavallium.dbengine.database.LLDelta;
import it.cavallium.dbengine.database.LLUtils;

View File

@ -3,9 +3,9 @@ package it.cavallium.dbengine.database.disk;
import static it.cavallium.dbengine.database.LLUtils.MARKER_ROCKSDB;
import io.micrometer.core.instrument.MeterRegistry;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.api.BufferAllocator;
import io.netty5.buffer.api.MemoryManager;
import io.netty5.buffer.Buffer;
import io.netty5.buffer.BufferAllocator;
import io.netty5.buffer.MemoryManager;
import io.netty5.util.Send;
import it.cavallium.dbengine.database.LLDelta;
import it.cavallium.dbengine.database.LLUtils;

View File

@ -1,8 +1,8 @@
package it.cavallium.dbengine.database.disk;
import io.micrometer.core.instrument.MeterRegistry;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.api.BufferAllocator;
import io.netty5.buffer.Buffer;
import io.netty5.buffer.BufferAllocator;
import it.cavallium.dbengine.database.LLRange;
import it.cavallium.dbengine.database.LLUtils;
import it.cavallium.dbengine.database.disk.rocksdb.RocksIteratorObj;

View File

@ -3,8 +3,8 @@ package it.cavallium.dbengine.database.disk;
import static it.cavallium.dbengine.database.LLUtils.MARKER_ROCKSDB;
import io.micrometer.core.instrument.MeterRegistry;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.api.BufferAllocator;
import io.netty5.buffer.Buffer;
import io.netty5.buffer.BufferAllocator;
import it.cavallium.dbengine.database.LLDelta;
import it.cavallium.dbengine.database.LLUtils;
import java.io.IOException;

View File

@ -1,6 +1,6 @@
package it.cavallium.dbengine.database.disk;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.Buffer;
import io.netty5.util.Send;
public record UpdateAtomicResultCurrent(Buffer current) implements UpdateAtomicResult {

View File

@ -1,6 +1,6 @@
package it.cavallium.dbengine.database.disk;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.Buffer;
import io.netty5.util.Send;
public record UpdateAtomicResultPrevious(Buffer previous) implements UpdateAtomicResult {

View File

@ -1,8 +1,8 @@
package it.cavallium.dbengine.database.disk.rocksdb;
import io.netty5.buffer.api.Drop;
import io.netty5.buffer.api.Owned;
import io.netty5.buffer.api.internal.ResourceSupport;
import io.netty5.buffer.Drop;
import io.netty5.buffer.Owned;
import io.netty5.buffer.internal.ResourceSupport;
import it.cavallium.dbengine.utils.SimpleResource;
import org.rocksdb.AbstractSlice;
import org.rocksdb.ColumnFamilyHandle;

View File

@ -1,8 +1,8 @@
package it.cavallium.dbengine.database.disk.rocksdb;
import io.netty5.buffer.api.Drop;
import io.netty5.buffer.api.Owned;
import io.netty5.buffer.api.internal.ResourceSupport;
import io.netty5.buffer.Drop;
import io.netty5.buffer.Owned;
import io.netty5.buffer.internal.ResourceSupport;
import it.cavallium.dbengine.utils.SimpleResource;
import org.rocksdb.CompactionOptions;

View File

@ -1,10 +1,10 @@
package it.cavallium.dbengine.database.disk.rocksdb;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.api.Drop;
import io.netty5.buffer.api.Owned;
import io.netty5.buffer.Buffer;
import io.netty5.buffer.Drop;
import io.netty5.buffer.Owned;
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.SafeCloseable;
import it.cavallium.dbengine.database.disk.LLLocalGroupedReactiveRocksIterator;

View File

@ -1,8 +1,8 @@
package it.cavallium.dbengine.database.disk.rocksdb;
import io.netty5.buffer.api.Drop;
import io.netty5.buffer.api.Owned;
import io.netty5.buffer.api.internal.ResourceSupport;
import io.netty5.buffer.Drop;
import io.netty5.buffer.Owned;
import io.netty5.buffer.internal.ResourceSupport;
import it.cavallium.dbengine.utils.SimpleResource;
import org.rocksdb.WriteOptions;

View File

@ -4,11 +4,11 @@ import static it.cavallium.dbengine.database.LLUtils.isReadOnlyDirect;
import io.micrometer.core.instrument.Counter;
import io.micrometer.core.instrument.Timer;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.api.Drop;
import io.netty5.buffer.api.Owned;
import io.netty5.buffer.api.ReadableComponent;
import io.netty5.buffer.api.internal.ResourceSupport;
import io.netty5.buffer.Buffer;
import io.netty5.buffer.BufferComponent;
import io.netty5.buffer.Drop;
import io.netty5.buffer.Owned;
import io.netty5.buffer.internal.ResourceSupport;
import it.cavallium.dbengine.database.LLUtils;
import it.cavallium.dbengine.utils.SimpleResource;
import java.nio.ByteBuffer;
@ -142,7 +142,7 @@ public class RocksIteratorObj extends SimpleResource {
public void seekFrom(Buffer key) {
ensureOpen();
if (allowNettyDirect && isReadOnlyDirect(key)) {
ByteBuffer keyInternalByteBuffer = ((ReadableComponent) key).readableBuffer();
ByteBuffer keyInternalByteBuffer = ((BufferComponent) key).readableBuffer();
assert keyInternalByteBuffer.position() == 0;
rocksIterator.seekForPrev(keyInternalByteBuffer);
// 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) {
ensureOpen();
if (allowNettyDirect && isReadOnlyDirect(key)) {
ByteBuffer keyInternalByteBuffer = ((ReadableComponent) key).readableBuffer();
ByteBuffer keyInternalByteBuffer = ((BufferComponent) key).readableBuffer();
assert keyInternalByteBuffer.position() == 0;
startedIterSeek.increment();
iterSeekTime.record(() -> rocksIterator.seek(keyInternalByteBuffer));

View File

@ -3,7 +3,7 @@ package it.cavallium.dbengine.database.memory;
import static it.cavallium.dbengine.lucene.LuceneUtils.luceneScheduler;
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.LLKeyValueDatabase;
import it.cavallium.dbengine.database.LLLuceneIndex;

View File

@ -1,7 +1,7 @@
package it.cavallium.dbengine.database.memory;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.api.BufferAllocator;
import io.netty5.buffer.Buffer;
import io.netty5.buffer.BufferAllocator;
import io.netty5.util.Resource;
import io.netty5.util.Send;
import it.cavallium.dbengine.client.BadBlock;

View File

@ -1,7 +1,7 @@
package it.cavallium.dbengine.database.memory;
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.database.ColumnProperty;
import it.cavallium.dbengine.database.LLDictionary;

View File

@ -1,7 +1,7 @@
package it.cavallium.dbengine.database.memory;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.api.BufferAllocator;
import io.netty5.buffer.Buffer;
import io.netty5.buffer.BufferAllocator;
import io.netty5.util.Send;
import it.cavallium.dbengine.database.LLDelta;
import it.cavallium.dbengine.database.LLDictionaryResultType;

View File

@ -4,8 +4,8 @@ import com.google.common.collect.Multimap;
import io.micrometer.core.instrument.MeterRegistry;
import io.netty.handler.ssl.util.InsecureTrustManagerFactory;
import io.netty.incubator.codec.quic.QuicSslContextBuilder;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.api.BufferAllocator;
import io.netty5.buffer.Buffer;
import io.netty5.buffer.BufferAllocator;
import io.netty5.util.Send;
import it.cavallium.dbengine.client.MemoryStats;
import it.cavallium.dbengine.client.query.current.data.Query;

View File

@ -1,7 +1,7 @@
package it.cavallium.dbengine.database.remote;
import io.netty.handler.codec.ByteToMessageCodec;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.Buffer;
import io.netty5.util.Send;
import it.cavallium.data.generator.nativedata.NullableString;
import it.cavallium.dbengine.database.OptionalBuf;

View File

@ -1,6 +1,6 @@
package it.cavallium.dbengine.database.serialization;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.Buffer;
import io.netty5.util.Send;
import it.cavallium.dbengine.database.DiscardingCloseable;
import it.cavallium.dbengine.database.SafeCloseable;

View File

@ -1,8 +1,6 @@
package it.cavallium.dbengine.database.serialization;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.api.ReadableComponent;
import io.netty5.buffer.api.ReadableComponentProcessor;
import io.netty5.buffer.Buffer;
import io.netty5.util.Send;
import it.cavallium.dbengine.database.SafeCloseable;
import java.io.DataInput;

View File

@ -1,6 +1,6 @@
package it.cavallium.dbengine.database.serialization;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.Buffer;
import java.io.DataOutput;
import java.nio.charset.StandardCharsets;
import org.jetbrains.annotations.NotNull;

View File

@ -1,7 +1,7 @@
package it.cavallium.dbengine.database.serialization;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.api.BufferAllocator;
import io.netty5.buffer.Buffer;
import io.netty5.buffer.BufferAllocator;
import io.netty5.util.Send;
import java.io.IOError;
import java.io.IOException;

View File

@ -1,7 +1,7 @@
package it.cavallium.dbengine.database.serialization;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.api.BufferAllocator;
import io.netty5.buffer.Buffer;
import io.netty5.buffer.BufferAllocator;
import io.netty5.util.Send;
import io.netty5.util.internal.StringUtil;
import it.cavallium.dbengine.database.LLUtils;

View File

@ -1,7 +1,7 @@
package it.cavallium.dbengine.database.serialization;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.api.BufferAllocator;
import io.netty5.buffer.Buffer;
import io.netty5.buffer.BufferAllocator;
import io.netty5.util.Send;
import it.cavallium.dbengine.database.LLUtils;
import java.nio.charset.StandardCharsets;

View File

@ -1,6 +1,6 @@
package it.cavallium.dbengine.lucene;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.Buffer;
import java.util.function.Function;
public class ByteArrayCodec implements HugePqCodec<byte[]> {

View File

@ -1,6 +1,6 @@
package it.cavallium.dbengine.lucene;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.Buffer;
import java.util.function.Function;
import org.apache.lucene.util.BytesRef;

View File

@ -1,6 +1,6 @@
package it.cavallium.dbengine.lucene;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.Buffer;
import java.util.function.Function;
public class DoubleCodec implements HugePqCodec<Double> {

View File

@ -1,6 +1,6 @@
package it.cavallium.dbengine.lucene;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.Buffer;
import java.util.function.Function;
public class FloatCodec implements HugePqCodec<Float> {

View File

@ -1,6 +1,6 @@
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.LLUtils;
import it.cavallium.dbengine.database.SafeCloseable;

View File

@ -1,6 +1,6 @@
package it.cavallium.dbengine.lucene;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.Buffer;
import java.util.function.Function;
import org.apache.lucene.util.BitUtil;
import org.apache.lucene.util.NumericUtils;

View File

@ -1,6 +1,6 @@
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.LLUtils;
import it.cavallium.dbengine.database.SafeCloseable;

View File

@ -1,6 +1,6 @@
package it.cavallium.dbengine.lucene;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.Buffer;
import java.util.function.Function;
public class IntCodec implements HugePqCodec<Integer> {

View File

@ -1,6 +1,6 @@
package it.cavallium.dbengine.lucene;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.Buffer;
import java.util.ArrayList;
import java.util.function.Function;

View File

@ -1,6 +1,6 @@
package it.cavallium.dbengine.lucene;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.Buffer;
import java.util.function.Function;
public class LLScoreDocCodec implements HugePqCodec<LLScoreDoc> {

View File

@ -1,6 +1,6 @@
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.SafeCloseable;
import it.cavallium.dbengine.database.disk.LLTempHugePqEnv;

View File

@ -1,6 +1,6 @@
package it.cavallium.dbengine.lucene;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.Buffer;
import java.util.function.Function;
public class LongCodec implements HugePqCodec<Long> {

View File

@ -1,6 +1,6 @@
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.RocksdbFileStore;
import java.io.IOException;

View File

@ -26,6 +26,7 @@ import org.apache.lucene.codecs.compressing.Decompressor;
import org.apache.lucene.codecs.lucene90.compressing.Lucene90CompressingStoredFieldsFormat;
import org.apache.lucene.index.FieldInfos;
import org.apache.lucene.index.SegmentInfo;
import org.apache.lucene.store.ByteBuffersDataInput;
import org.apache.lucene.store.DataInput;
import org.apache.lucene.store.DataOutput;
import org.apache.lucene.store.Directory;
@ -76,8 +77,8 @@ public class Lucene90NoCompressionStoredFieldsFormat extends StoredFieldsFormat
private static final Compressor DUMMY_COMPRESSOR = new Compressor() {
@Override
public void compress(byte[] bytes, int off, int len, DataOutput out) throws IOException {
out.writeBytes(bytes, off, len);
public void compress(ByteBuffersDataInput byteBuffersDataInput, DataOutput dataOutput) throws IOException {
dataOutput.copyBytes(byteBuffersDataInput, byteBuffersDataInput.size());
}
@Override

View File

@ -1,8 +1,8 @@
package it.cavallium.dbengine.lucene.directory;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.api.BufferAllocator;
import io.netty5.buffer.api.BufferRef;
import io.netty5.buffer.Buffer;
import io.netty5.buffer.BufferAllocator;
import io.netty5.buffer.BufferRef;
import org.apache.lucene.store.IndexInput;
import java.io.EOFException;

View File

@ -1,7 +1,7 @@
package it.cavallium.dbengine.lucene.directory;
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.IOException;
import java.nio.file.Path;

View File

@ -2,10 +2,9 @@ package it.cavallium.dbengine.lucene.directory;
import com.google.common.primitives.Longs;
import com.google.common.util.concurrent.Striped;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.api.BufferAllocator;
import io.netty5.buffer.api.ReadableComponent;
import io.netty5.buffer.api.WritableComponent;
import io.netty5.buffer.Buffer;
import io.netty5.buffer.BufferAllocator;
import io.netty5.buffer.BufferComponent;
import it.cavallium.dbengine.database.LLUtils;
import java.io.IOException;
import java.nio.ByteBuffer;
@ -119,13 +118,13 @@ public class RocksdbFileStore {
private static ByteBuffer readableNioBuffer(Buffer buffer) {
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) {
assert buffer.countWritableComponents() == 1 : "Writable components count: " + buffer.countWritableComponents();
buffer.writerOffset(0).ensureWritable(newWriterOffset);
var byteBuf = ((WritableComponent) buffer).writableBuffer();
var byteBuf = ((BufferComponent) buffer).writableBuffer();
buffer.writerOffset(newWriterOffset);
assert buffer.capacity() >= newWriterOffset : "Returned capacity " + buffer.capacity() + " < " + newWriterOffset;
return byteBuf;

View File

@ -1,7 +1,7 @@
package it.cavallium.dbengine.lucene.directory;
import io.netty5.buffer.api.Buffer;
import io.netty5.buffer.api.BufferAllocator;
import io.netty5.buffer.Buffer;
import io.netty5.buffer.BufferAllocator;
import java.io.EOFException;
import java.io.IOException;
import org.apache.lucene.store.IndexInput;

View File

@ -1,6 +1,6 @@
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.IndexOutput;
import org.apache.lucene.util.Accountable;

View File

@ -1,11 +1,11 @@
package it.cavallium.dbengine.lucene.searcher;
import io.netty5.buffer.api.Drop;
import io.netty5.buffer.api.Owned;
import io.netty5.buffer.Drop;
import io.netty5.buffer.Owned;
import it.cavallium.dbengine.client.query.current.data.TotalHitsCount;
import it.cavallium.dbengine.database.DiscardingCloseable;
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 java.util.Objects;
import org.apache.logging.log4j.LogManager;

View File

@ -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 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.database.LLKeyScore;
import it.cavallium.dbengine.database.LLUtils;

View File

@ -4,12 +4,12 @@ import io.micrometer.core.instrument.MeterRegistry;
import io.micrometer.core.instrument.Tag;
import io.micrometer.core.instrument.Tags;
import io.micrometer.core.instrument.binder.MeterBinder;
import io.netty5.buffer.api.BufferAllocator;
import io.netty5.buffer.api.pool.BufferAllocatorMetric;
import io.netty5.buffer.api.pool.BufferAllocatorMetricProvider;
import io.netty5.buffer.api.pool.PoolArenaMetric;
import io.netty5.buffer.api.pool.PoolChunkListMetric;
import io.netty5.buffer.api.pool.PoolSubpageMetric;
import io.netty5.buffer.BufferAllocator;
import io.netty5.buffer.pool.BufferAllocatorMetric;
import io.netty5.buffer.pool.BufferAllocatorMetricProvider;
import io.netty5.buffer.pool.PoolArenaMetric;
import io.netty5.buffer.pool.PoolChunkListMetric;
import io.netty5.buffer.pool.PoolSubpageMetric;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

Some files were not shown because too many files have changed in this diff Show More