> allConcepts = namespace.getStorage().getAllConcepts()) {
- clearDependentConcepts(allConcepts, imp.getTable().resolve());
+ clearDependentConcepts(allConcepts, imp.getTable());
}
namespace.getStorage().removeImport(imp.getId());
diff --git a/backend/src/main/java/com/bakdata/conquery/models/auth/AuthorizationController.java b/backend/src/main/java/com/bakdata/conquery/models/auth/AuthorizationController.java
index 655e93da5b..72b3f186b2 100644
--- a/backend/src/main/java/com/bakdata/conquery/models/auth/AuthorizationController.java
+++ b/backend/src/main/java/com/bakdata/conquery/models/auth/AuthorizationController.java
@@ -34,11 +34,12 @@
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.pam.FirstSuccessfulStrategy;
import org.apache.shiro.authc.pam.ModularRealmAuthenticator;
+import org.apache.shiro.lang.util.LifecycleUtils;
import org.apache.shiro.mgt.DefaultSecurityManager;
import org.apache.shiro.realm.AuthorizingRealm;
import org.apache.shiro.realm.Realm;
-import org.apache.shiro.util.LifecycleUtils;
import org.glassfish.hk2.utilities.binding.AbstractBinder;
+import org.jetbrains.annotations.NotNull;
/**
* The central class for the initialization of authorization and authentication.
@@ -78,7 +79,7 @@ public final class AuthorizationController implements Managed {
@Getter
private DropwizardResourceConfig unprotectedAuthAdmin;
- public AuthorizationController(MetaStorage storage, ConqueryConfig config, Environment environment, AdminServlet adminServlet) {
+ public AuthorizationController(@NotNull MetaStorage storage, @NotNull ConqueryConfig config, @NotNull Environment environment, AdminServlet adminServlet) {
this.storage = storage;
this.config = config;
this.environment = environment;
diff --git a/backend/src/main/java/com/bakdata/conquery/models/auth/basic/LocalAuthenticationRealm.java b/backend/src/main/java/com/bakdata/conquery/models/auth/basic/LocalAuthenticationRealm.java
index 581b8015f9..31abe04329 100644
--- a/backend/src/main/java/com/bakdata/conquery/models/auth/basic/LocalAuthenticationRealm.java
+++ b/backend/src/main/java/com/bakdata/conquery/models/auth/basic/LocalAuthenticationRealm.java
@@ -42,8 +42,8 @@
import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.authc.CredentialsException;
import org.apache.shiro.authc.IncorrectCredentialsException;
+import org.apache.shiro.lang.util.Destroyable;
import org.apache.shiro.realm.AuthenticatingRealm;
-import org.apache.shiro.util.Destroyable;
/**
* This realm stores credentials in a local database ({@link XodusStore}). Upon
@@ -53,7 +53,7 @@
* authorization related user information that is saved in the
* {@link MetaStorage}. So adding or removing a user in this realm does
* not change the {@link MetaStorage}. {@link Conquery} interacts with
- * this realm using the Shiro frame work. However, endusers can interface it
+ * this realm using the Shiro framework. However, endusers can interface it
* through specific endpoints that are registerd by this realm.
*/
@Slf4j
diff --git a/backend/src/main/java/com/bakdata/conquery/models/config/ClusterConfig.java b/backend/src/main/java/com/bakdata/conquery/models/config/ClusterConfig.java
index f404aa1a48..e94c1ee3ce 100644
--- a/backend/src/main/java/com/bakdata/conquery/models/config/ClusterConfig.java
+++ b/backend/src/main/java/com/bakdata/conquery/models/config/ClusterConfig.java
@@ -1,16 +1,30 @@
package com.bakdata.conquery.models.config;
+import java.io.IOException;
import java.net.InetAddress;
+import java.net.InetSocketAddress;
import jakarta.validation.Valid;
+import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
+import com.bakdata.conquery.io.mina.ChunkingFilter;
+import com.bakdata.conquery.io.mina.JacksonProtocolDecoder;
+import com.bakdata.conquery.io.mina.JacksonProtocolEncoder;
+import com.bakdata.conquery.io.mina.MdcFilter;
+import com.bakdata.conquery.models.messages.network.NetworkMessage;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.databind.ObjectMapper;
import io.dropwizard.core.Configuration;
-import io.dropwizard.util.DataSize;
import io.dropwizard.util.Duration;
import io.dropwizard.validation.PortRange;
import lombok.Getter;
import lombok.Setter;
+import org.apache.mina.core.service.IoHandler;
+import org.apache.mina.filter.codec.ProtocolCodecFilter;
+import org.apache.mina.transport.socket.DefaultSocketSessionConfig;
+import org.apache.mina.transport.socket.nio.NioSocketAcceptor;
+import org.apache.mina.transport.socket.nio.NioSocketConnector;
@Getter
@Setter
@@ -22,7 +36,7 @@ public class ClusterConfig extends Configuration {
private InetAddress managerURL = InetAddress.getLoopbackAddress();
@Valid
@NotNull
- private MinaConfig mina = new MinaConfig();
+ private DefaultSocketSessionConfig mina = new DefaultSocketSessionConfig();
@Min(1)
private int entityBucketSize = 1000;
@@ -30,6 +44,24 @@ public class ClusterConfig extends Configuration {
private Duration heartbeatTimeout = Duration.minutes(1);
private Duration connectRetryTimeout = Duration.seconds(30);
+ /**
+ * Defines the maximum buffer size inclusive 4 bytes for a header. Objects larger than this size cannot be sent over the cluster.
+ *
+ * May only touch this for testing purposes.
+ */
+ @Max(Integer.MAX_VALUE - 4)
+ @Min(64) // not practical
+ private int maxIoBufferSizeBytes = Integer.MAX_VALUE - 4;
+
+ /**
+ * Defines the starting buffer allocation size. Larger can reduce reallocations, but can cause a greater memory demand.
+ *
+ * May only touch this for testing purposes.
+ */
+ @Max(Integer.MAX_VALUE - 4)
+ @Min(64) // Mina's default
+ private int initialIoBufferSizeBytes = 8192; // 8kb
+
/**
* @see com.bakdata.conquery.models.messages.namespaces.specific.CollectColumnValuesJob
*
@@ -44,27 +76,6 @@ public class ClusterConfig extends Configuration {
*/
private int networkSessionMaxQueueLength = 5;
- /**
- * {@link org.apache.mina.core.buffer.IoBuffer} size, that mina allocates.
- * We assume a pagesize of 4096 bytes == 4 kibibytes
- */
- @NotNull
- @Valid
- private DataSize messageChunkSize = DataSize.kibibytes(4);
-
- /**
- * How long the soft pool cleaner waits before reducing the pool size down to softPoolBaselineSize.
- */
- @NotNull
- @Valid
- private Duration softPoolCleanerPause = Duration.seconds(10);
-
- /**
- * The number of soft references the soft pool should retain after cleaning.
- * The actual number of {@link org.apache.mina.core.buffer.IoBuffer}
- */
- private long softPoolBaselineSize = 100;
-
/**
* Amount of backpressure before jobs can volunteer to block to send messages to their shards.
*
@@ -72,4 +83,56 @@ public class ClusterConfig extends Configuration {
*/
@Min(0)
private int backpressure = 1500;
+
+ @JsonIgnore
+ public NioSocketConnector getClusterConnector(ObjectMapper om, IoHandler ioHandler, String mdcLocation) {
+
+ final NioSocketConnector connector = new NioSocketConnector();
+
+ JacksonProtocolEncoder encoder = new JacksonProtocolEncoder(om.writerFor(NetworkMessage.class));
+ encoder.setMaxObjectSize(maxIoBufferSizeBytes);
+ encoder.setInitialBufferCapacityBytes(initialIoBufferSizeBytes);
+
+ ProtocolCodecFilter codecFilter = new ProtocolCodecFilter(
+ encoder,
+ new JacksonProtocolDecoder(om.readerFor(NetworkMessage.class))
+ );
+ connector.getFilterChain().addFirst("mdc", new MdcFilter(mdcLocation));
+ if (mina.getSendBufferSize() > 0) {
+ connector.getFilterChain().addLast("chunk", new ChunkingFilter(mina.getSendBufferSize()));
+ }
+ connector.getFilterChain().addLast("codec", codecFilter);
+
+ connector.setHandler(ioHandler);
+ connector.getSessionConfig().setAll(getMina());
+
+ return connector;
+ }
+
+ @JsonIgnore
+ public NioSocketAcceptor getClusterAcceptor(ObjectMapper om, IoHandler ioHandler, String mdcLocation) throws IOException {
+ NioSocketAcceptor acceptor = new NioSocketAcceptor();
+
+
+ JacksonProtocolEncoder encoder = new JacksonProtocolEncoder(om.writerFor(NetworkMessage.class));
+ encoder.setMaxObjectSize(maxIoBufferSizeBytes);
+ encoder.setInitialBufferCapacityBytes(initialIoBufferSizeBytes);
+
+ ProtocolCodecFilter codecFilter = new ProtocolCodecFilter(
+ encoder,
+ new JacksonProtocolDecoder(om.readerFor(NetworkMessage.class))
+ );
+
+ acceptor.getFilterChain().addFirst("mdc", new MdcFilter(mdcLocation));
+ if (mina.getSendBufferSize() > 0) {
+ acceptor.getFilterChain().addLast("chunk", new ChunkingFilter(mina.getSendBufferSize()));
+ }
+ acceptor.getFilterChain().addLast("codec", codecFilter);
+
+ acceptor.setHandler(ioHandler);
+ acceptor.getSessionConfig().setAll(getMina());
+ acceptor.bind(new InetSocketAddress(getPort()));
+
+ return acceptor;
+ }
}
diff --git a/backend/src/main/java/com/bakdata/conquery/models/datasets/PreviewConfig.java b/backend/src/main/java/com/bakdata/conquery/models/datasets/PreviewConfig.java
index 568a31adfd..a3639bbee3 100644
--- a/backend/src/main/java/com/bakdata/conquery/models/datasets/PreviewConfig.java
+++ b/backend/src/main/java/com/bakdata/conquery/models/datasets/PreviewConfig.java
@@ -3,7 +3,6 @@
import java.util.Collection;
import java.util.Collections;
import java.util.List;
-import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;
import jakarta.validation.Valid;
@@ -180,7 +179,6 @@ public List