Java modules
This commit is contained in:
parent
d52c67eb07
commit
b086e1ca25
@ -1,4 +1,4 @@
|
|||||||
package it.cavallium.dbengine.database.remote;
|
package it.cavallium.dbengine.database.server;
|
||||||
|
|
||||||
import it.unimi.dsi.fastutil.bytes.ByteList;
|
import it.unimi.dsi.fastutil.bytes.ByteList;
|
||||||
|
|
@ -1,9 +1,8 @@
|
|||||||
package it.cavallium.dbengine.database.remote;
|
package it.cavallium.dbengine.database.server;
|
||||||
|
|
||||||
import io.micrometer.core.instrument.composite.CompositeMeterRegistry;
|
import io.micrometer.core.instrument.composite.CompositeMeterRegistry;
|
||||||
import io.netty5.buffer.api.Buffer;
|
import io.netty5.buffer.api.Buffer;
|
||||||
import io.netty5.buffer.api.DefaultBufferAllocators;
|
import io.netty5.buffer.api.DefaultBufferAllocators;
|
||||||
import io.netty5.buffer.api.Send;
|
|
||||||
import io.netty.handler.ssl.ClientAuth;
|
import io.netty.handler.ssl.ClientAuth;
|
||||||
import io.netty.incubator.codec.quic.InsecureQuicTokenHandler;
|
import io.netty.incubator.codec.quic.InsecureQuicTokenHandler;
|
||||||
import io.netty.incubator.codec.quic.QuicConnectionIdGenerator;
|
import io.netty.incubator.codec.quic.QuicConnectionIdGenerator;
|
||||||
@ -13,8 +12,11 @@ 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;
|
||||||
import it.cavallium.dbengine.database.LLSingleton;
|
import it.cavallium.dbengine.database.LLSingleton;
|
||||||
|
import it.cavallium.dbengine.database.disk.BinarySerializationFunction;
|
||||||
import it.cavallium.dbengine.database.disk.LLLocalDatabaseConnection;
|
import it.cavallium.dbengine.database.disk.LLLocalDatabaseConnection;
|
||||||
|
import it.cavallium.dbengine.database.remote.QuicUtils;
|
||||||
import it.cavallium.dbengine.database.remote.RPCCodecs.RPCEventCodec;
|
import it.cavallium.dbengine.database.remote.RPCCodecs.RPCEventCodec;
|
||||||
|
import it.cavallium.dbengine.database.serialization.SerializationException;
|
||||||
import it.cavallium.dbengine.lucene.LuceneRocksDBManager;
|
import it.cavallium.dbengine.lucene.LuceneRocksDBManager;
|
||||||
import it.cavallium.dbengine.rpc.current.data.Binary;
|
import it.cavallium.dbengine.rpc.current.data.Binary;
|
||||||
import it.cavallium.dbengine.rpc.current.data.BinaryOptional;
|
import it.cavallium.dbengine.rpc.current.data.BinaryOptional;
|
||||||
@ -184,7 +186,9 @@ public class QuicRPCServer {
|
|||||||
Many<RPCEvent> clientBound = Sinks.many().unicast().onBackpressureBuffer();
|
Many<RPCEvent> clientBound = Sinks.many().unicast().onBackpressureBuffer();
|
||||||
Mono<RPCEvent> update = singleton.update(prev -> {
|
Mono<RPCEvent> update = singleton.update(prev -> {
|
||||||
clientBound
|
clientBound
|
||||||
.tryEmitNext(new SingletonUpdateOldData(prev != null, prev != null ? toByteList(prev) : ByteList.of()))
|
.tryEmitNext(new SingletonUpdateOldData(prev != null,
|
||||||
|
prev != null ? toByteList(prev) : ByteList.of()
|
||||||
|
))
|
||||||
.orThrow();
|
.orThrow();
|
||||||
SingletonUpdateEnd newValue = (SingletonUpdateEnd) otherRequests.singleOrEmpty().block();
|
SingletonUpdateEnd newValue = (SingletonUpdateEnd) otherRequests.singleOrEmpty().block();
|
||||||
Objects.requireNonNull(newValue);
|
Objects.requireNonNull(newValue);
|
@ -1,3 +1,3 @@
|
|||||||
package it.cavallium.dbengine.database.remote;
|
package it.cavallium.dbengine.database.server;
|
||||||
|
|
||||||
public record ReferencedResource<T>(Long reference, T resource) {}
|
public record ReferencedResource<T>(Long reference, T resource) {}
|
@ -1,4 +1,4 @@
|
|||||||
package it.cavallium.dbengine.database.remote;
|
package it.cavallium.dbengine.database.server;
|
||||||
|
|
||||||
import java.util.NoSuchElementException;
|
import java.util.NoSuchElementException;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
@ -1,4 +1,4 @@
|
|||||||
package it.cavallium.dbengine.database.remote;
|
package it.cavallium.dbengine.database.server;
|
||||||
|
|
||||||
import reactor.core.publisher.Mono;
|
import reactor.core.publisher.Mono;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package it.cavallium.dbengine.database.remote;
|
package it.cavallium.dbengine.database.server;
|
||||||
|
|
||||||
import reactor.core.publisher.Mono;
|
import reactor.core.publisher.Mono;
|
||||||
|
|
16
src/main/java/module-info.java
Normal file
16
src/main/java/module-info.java
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
module dbengine.server {
|
||||||
|
requires it.unimi.dsi.fastutil;
|
||||||
|
requires org.apache.logging.log4j;
|
||||||
|
requires reactor.netty.incubator.quic;
|
||||||
|
requires reactor.netty.core;
|
||||||
|
requires dbengine;
|
||||||
|
requires java.logging;
|
||||||
|
requires reactor.core;
|
||||||
|
requires org.reactivestreams;
|
||||||
|
requires micrometer.core;
|
||||||
|
requires io.netty5.buffer;
|
||||||
|
requires org.jetbrains.annotations;
|
||||||
|
requires io.netty.incubator.codec.classes.quic;
|
||||||
|
requires io.netty.handler;
|
||||||
|
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
package it.cavallium.dbengine.database.remote;
|
package it.cavallium.dbengine.database.server;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
|
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
@ -9,18 +9,14 @@ import io.netty5.buffer.api.DefaultBufferAllocators;
|
|||||||
import it.cavallium.data.generator.nativedata.Nullableboolean;
|
import it.cavallium.data.generator.nativedata.Nullableboolean;
|
||||||
import it.cavallium.data.generator.nativedata.Nullabledouble;
|
import it.cavallium.data.generator.nativedata.Nullabledouble;
|
||||||
import it.cavallium.data.generator.nativedata.Nullableint;
|
import it.cavallium.data.generator.nativedata.Nullableint;
|
||||||
import it.cavallium.data.generator.nativedata.Nullablelong;
|
import it.cavallium.dbengine.client.DefaultDatabaseOptions;
|
||||||
import it.cavallium.dbengine.client.IndicizerAnalyzers;
|
import it.cavallium.dbengine.client.IndicizerAnalyzers;
|
||||||
import it.cavallium.dbengine.client.IndicizerSimilarities;
|
import it.cavallium.dbengine.client.IndicizerSimilarities;
|
||||||
import it.cavallium.dbengine.database.ColumnUtils;
|
import it.cavallium.dbengine.database.ColumnUtils;
|
||||||
import it.cavallium.dbengine.database.LLDatabaseConnection;
|
import it.cavallium.dbengine.database.LLDatabaseConnection;
|
||||||
import it.cavallium.dbengine.lucene.LuceneUtils;
|
import it.cavallium.dbengine.lucene.LuceneUtils;
|
||||||
import it.cavallium.dbengine.rpc.current.data.ByteBuffersDirectory;
|
import it.cavallium.dbengine.rpc.current.data.ByteBuffersDirectory;
|
||||||
import it.cavallium.dbengine.rpc.current.data.DatabaseOptions;
|
|
||||||
import it.cavallium.dbengine.rpc.current.data.LuceneIndexStructure;
|
|
||||||
import it.cavallium.dbengine.rpc.current.data.LuceneOptions;
|
import it.cavallium.dbengine.rpc.current.data.LuceneOptions;
|
||||||
import it.cavallium.dbengine.rpc.current.data.nullables.NullableFilter;
|
|
||||||
import it.unimi.dsi.fastutil.ints.IntList;
|
|
||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -70,22 +66,7 @@ public class LLQuicConnectionTest {
|
|||||||
var singletonsColumnName = "singletons";
|
var singletonsColumnName = "singletons";
|
||||||
var db = client.getDatabase(dbName,
|
var db = client.getDatabase(dbName,
|
||||||
List.of(ColumnUtils.special(singletonsColumnName)),
|
List.of(ColumnUtils.special(singletonsColumnName)),
|
||||||
new DatabaseOptions(List.of(),
|
DefaultDatabaseOptions.DEFAULT_DATABASE_OPTIONS
|
||||||
List.of(),
|
|
||||||
Map.of(),
|
|
||||||
true,
|
|
||||||
true,
|
|
||||||
true,
|
|
||||||
true,
|
|
||||||
true,
|
|
||||||
true,
|
|
||||||
Nullableint.empty(),
|
|
||||||
Nullablelong.empty(),
|
|
||||||
Nullablelong.empty(),
|
|
||||||
Nullableboolean.empty(),
|
|
||||||
false,
|
|
||||||
NullableFilter.empty()
|
|
||||||
)
|
|
||||||
).blockOptional().orElseThrow();
|
).blockOptional().orElseThrow();
|
||||||
assertEquals(dbName, db.getDatabaseName());
|
assertEquals(dbName, db.getDatabaseName());
|
||||||
assertEquals(allocator, db.getAllocator());
|
assertEquals(allocator, db.getAllocator());
|
@ -1,7 +1,8 @@
|
|||||||
package it.cavallium.dbengine.database.remote;
|
package it.cavallium.dbengine.database.server;
|
||||||
|
|
||||||
import io.micrometer.core.instrument.composite.CompositeMeterRegistry;
|
import io.micrometer.core.instrument.composite.CompositeMeterRegistry;
|
||||||
import io.netty5.buffer.api.BufferAllocator;
|
import io.netty5.buffer.api.BufferAllocator;
|
||||||
|
import it.cavallium.dbengine.database.remote.LLQuicConnection;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
|
|
||||||
public class TestDbClient {
|
public class TestDbClient {
|
@ -1,4 +1,4 @@
|
|||||||
package it.cavallium.dbengine.database.remote;
|
package it.cavallium.dbengine.database.server;
|
||||||
|
|
||||||
import io.micrometer.core.instrument.composite.CompositeMeterRegistry;
|
import io.micrometer.core.instrument.composite.CompositeMeterRegistry;
|
||||||
import io.netty5.buffer.api.BufferAllocator;
|
import io.netty5.buffer.api.BufferAllocator;
|
Loading…
x
Reference in New Issue
Block a user