From b5e3f2a6771466137f0319f3a25b886af5b6fd2a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20Novotn=C3=BD?=
Date: Wed, 1 May 2024 10:05:00 +0200
Subject: [PATCH 01/24] feat(#550): not working way of Java agent
---
docker/Dockerfile | 3 +
.../evita_external_api_observability/pom.xml | 5 +
.../observability/agent/OOMAgent.java | 94 +++++++++++++++++++
.../observability/metric/MetricHandler.java | 12 +++
.../src/main/java/module-info.java | 2 +
.../system/SystemProviderRegistrar.java | 14 +++
evita_server/pom.xml | 5 +
evita_server/run-server.sh | 1 +
8 files changed, 136 insertions(+)
create mode 100644 evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/agent/OOMAgent.java
diff --git a/docker/Dockerfile b/docker/Dockerfile
index 113c8f77c..ec5ffdae3 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -12,6 +12,9 @@ LABEL vendor="FG Forrest, a.s." \
io.evitadb.version="${VERSION}" \
io.evitadb.release-date="${RELEASE_DATE}"
+HEALTHCHECK --interval=10s --timeout=2s --retries=2 \
+ CMD curl -f http://localhost:5557/health || exit 1
+
USER root
# Install bash
diff --git a/evita_external_api/evita_external_api_observability/pom.xml b/evita_external_api/evita_external_api_observability/pom.xml
index f5ae9c54f..c5b3b4c9a 100644
--- a/evita_external_api/evita_external_api_observability/pom.xml
+++ b/evita_external_api/evita_external_api_observability/pom.xml
@@ -61,6 +61,11 @@
evita_query${project.parent.version}
+
+ net.bytebuddy
+ byte-buddy
+ 1.14.14
+ ${project.parent.groupId}
diff --git a/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/agent/OOMAgent.java b/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/agent/OOMAgent.java
new file mode 100644
index 000000000..8d74388be
--- /dev/null
+++ b/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/agent/OOMAgent.java
@@ -0,0 +1,94 @@
+/*
+ *
+ * _ _ ____ ____
+ * _____ _(_) |_ __ _| _ \| __ )
+ * / _ \ \ / / | __/ _` | | | | _ \
+ * | __/\ V /| | || (_| | |_| | |_) |
+ * \___| \_/ |_|\__\__,_|____/|____/
+ *
+ * Copyright (c) 2024
+ *
+ * Licensed under the Business Source License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://github.com/FgForrest/evitaDB/blob/main/LICENSE
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package io.evitadb.externalApi.observability.agent;
+
+import io.evitadb.exception.EvitaInternalError;
+import net.bytebuddy.agent.builder.AgentBuilder;
+import net.bytebuddy.implementation.MethodCall;
+import net.bytebuddy.implementation.SuperMethodCall;
+
+import java.io.File;
+import java.lang.instrument.Instrumentation;
+import java.lang.reflect.Method;
+
+import static net.bytebuddy.agent.builder.AgentBuilder.RedefinitionStrategy.REDEFINITION;
+import static net.bytebuddy.agent.builder.AgentBuilder.RedefinitionStrategy.RETRANSFORMATION;
+import static net.bytebuddy.matcher.ElementMatchers.any;
+import static net.bytebuddy.matcher.ElementMatchers.nameStartsWith;
+import static net.bytebuddy.matcher.ElementMatchers.named;
+import static net.bytebuddy.matcher.ElementMatchers.none;
+
+/**
+ * TODO JNO - document me
+ *
+ * @author Jan Novotný (novotny@fg.cz), FG Forrest a.s. (c) 2024
+ */
+public class OOMAgent {
+ private static final Method HANDLE_OOM;
+
+ static {
+ try {
+ HANDLE_OOM = OOMAgent.class.getDeclaredMethod("handleOOM");
+ } catch (NoSuchMethodException e) {
+ throw new EvitaInternalError("!!! OOMAgent initialization failed !!!", e);
+ }
+ }
+
+ public static void premain(String agentArgs, Instrumentation inst) {
+ if (HANDLE_OOM != null) {
+ new AgentBuilder.Default()
+ .disableClassFormatChanges()
+ .with(new AgentBuilder.InjectionStrategy.UsingInstrumentation(inst, new File("/www/oss/evitaDB-temporary/evita_external_api/evita_external_api_observability/target/evita_external_api_observability-2024.5-SNAPSHOT.jar")))
+ .with(REDEFINITION)
+ // Make sure we see helpful logs
+ .with(AgentBuilder.RedefinitionStrategy.Listener.StreamWriting.toSystemError())
+ .with(AgentBuilder.Listener.StreamWriting.toSystemError().withTransformationsOnly())
+ .with(AgentBuilder.InstallationListener.StreamWriting.toSystemError())
+ .ignore(none())
+ // Ignore Byte Buddy and JDK classes we are not interested in
+ .ignore(
+ nameStartsWith("net.bytebuddy.")
+ .or(nameStartsWith("jdk.internal.reflect."))
+ .or(nameStartsWith("java.lang.invoke."))
+ .or(nameStartsWith("com.sun.proxy."))
+ )
+ .disableClassFormatChanges()
+ .with(RETRANSFORMATION)
+ .with(AgentBuilder.InitializationStrategy.NoOp.INSTANCE)
+ .with(AgentBuilder.TypeStrategy.Default.REDEFINE)
+ .type(named("java.lang.OutOfMemoryError"))
+ .transform(
+ (builder, typeDescription, classLoader, javaModule, protectionDomain) -> builder
+ .constructor(any())
+ .intercept(SuperMethodCall.INSTANCE.andThen(MethodCall.invoke(HANDLE_OOM)))
+ )
+ .installOn(inst);
+ }
+ }
+
+ public static void handleOOM() {
+ System.out.println("!!! OOM !!!");
+ }
+
+}
diff --git a/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/metric/MetricHandler.java b/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/metric/MetricHandler.java
index a83774872..f3ec82405 100644
--- a/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/metric/MetricHandler.java
+++ b/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/metric/MetricHandler.java
@@ -69,6 +69,11 @@ public class MetricHandler {
private static final Map DEFAULT_JVM_METRICS;
private static final String DEFAULT_JVM_METRICS_NAME = "AllMetrics";
+ // Define a Prometheus counter for OutOfMemoryError events
+ private static final Counter OUT_OF_MEMORY_ERRORS_TOTAL = Counter.builder()
+ .name("jvm_out_of_memory_errors_total")
+ .help("Total number of Out of Memory errors")
+ .register();
static {
DEFAULT_JVM_METRICS = Map.of(
@@ -89,6 +94,13 @@ public MetricHandler(@Nonnull ObservabilityConfig observabilityConfig) {
this.observabilityConfig = observabilityConfig;
}
+ /**
+ * TODO JNO - document me
+ */
+ public static void outOfMemoryErrorEvent() {
+ OUT_OF_MEMORY_ERRORS_TOTAL.inc();
+ }
+
/**
* Based on configuration, this method enables collecting and publishing metrics into Prometheus scraping endpoint.
* If no configuration of such event has been provided, all JVM and custom events are logged. For limiting the logged
diff --git a/evita_external_api/evita_external_api_observability/src/main/java/module-info.java b/evita_external_api/evita_external_api_observability/src/main/java/module-info.java
index 46cf6e9d5..41a715dea 100644
--- a/evita_external_api/evita_external_api_observability/src/main/java/module-info.java
+++ b/evita_external_api/evita_external_api_observability/src/main/java/module-info.java
@@ -76,6 +76,8 @@
requires io.opentelemetry.exporter.logging;
requires io.opentelemetry.exporter.otlp;
requires io.opentelemetry.sdk.autoconfigure;
+ requires java.instrument;
+ requires net.bytebuddy;
exports io.evitadb.externalApi.observability.configuration;
exports io.evitadb.externalApi.observability.trace;
diff --git a/evita_external_api/evita_external_api_system/src/main/java/io/evitadb/externalApi/system/SystemProviderRegistrar.java b/evita_external_api/evita_external_api_system/src/main/java/io/evitadb/externalApi/system/SystemProviderRegistrar.java
index 9c2a35d98..b46919c2c 100644
--- a/evita_external_api/evita_external_api_system/src/main/java/io/evitadb/externalApi/system/SystemProviderRegistrar.java
+++ b/evita_external_api/evita_external_api_system/src/main/java/io/evitadb/externalApi/system/SystemProviderRegistrar.java
@@ -119,6 +119,20 @@ public ExternalApiProvider register(@Nonnull Evita evita, @Nonnull
}
);
+ router.addExactPath(
+ "/oom",
+ exchange -> {
+ exchange.setStatusCode(StatusCodes.OK);
+ exchange.getResponseHeaders().put(Headers.CONTENT_TYPE, "text/plain");
+ try {
+ final OutOfMemoryError oom = new OutOfMemoryError("XXX");
+ exchange.getResponseSender().send(String.valueOf(oom.getMessage()));
+ } finally {
+ //exchange.getResponseSender().send("!!! OOM !!!");
+ }
+ }
+ );
+
final ResourceHandler fileSystemHandler;
try (ResourceManager resourceManager = new FileResourceManager(file, 100)) {
fileSystemHandler = new ResourceHandler(
diff --git a/evita_server/pom.xml b/evita_server/pom.xml
index 47b4bf648..7a18a899a 100644
--- a/evita_server/pom.xml
+++ b/evita_server/pom.xml
@@ -143,6 +143,11 @@
io.evitadb.server.EvitaServertrue
+
+ io.evitadb.externalApi.observability.agent.OOMAgent
+ true
+ true
+
diff --git a/evita_server/run-server.sh b/evita_server/run-server.sh
index 9f4a6498c..4b8b48865 100755
--- a/evita_server/run-server.sh
+++ b/evita_server/run-server.sh
@@ -24,6 +24,7 @@
java \
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:8005 \
+ -javaagent:target/evita-server.jar \
-jar "target/evita-server.jar" \
"-DconfigFile=../docker/evita-configuration.yaml" \
"-Dstorage.storageDirectory=../data " \
From 9fc545662c0184b7cb448d601e118d59bd0a19c1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20Novotn=C3=BD?=
Date: Thu, 2 May 2024 10:12:04 +0200
Subject: [PATCH 02/24] fix: when cause was null, the stacktrace might have
been dropped
---
.../src/main/java/io/evitadb/core/SessionRegistry.java | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/evita_engine/src/main/java/io/evitadb/core/SessionRegistry.java b/evita_engine/src/main/java/io/evitadb/core/SessionRegistry.java
index 69dd9021b..627180e39 100644
--- a/evita_engine/src/main/java/io/evitadb/core/SessionRegistry.java
+++ b/evita_engine/src/main/java/io/evitadb/core/SessionRegistry.java
@@ -182,6 +182,7 @@ private static class EvitaSessionProxy implements InvocationHandler {
private final EvitaSession evitaSession;
private final TracingContext tracingContext;
+ @Nullable
@Override
public Object invoke(Object proxy, Method method, Object[] args) {
try {
@@ -211,11 +212,14 @@ public Object invoke(Object proxy, Method method, Object[] args) {
// unwrap and rethrow
throw evitaInternalError;
} else {
- log.error("Unexpected internal Evita error occurred: " + ex.getCause().getMessage(), targetException);
+ log.error(
+ "Unexpected internal Evita error occurred: " + ex.getCause().getMessage(),
+ targetException == null ? ex : targetException
+ );
throw new EvitaInternalError(
"Unexpected internal Evita error occurred: " + ex.getCause().getMessage(),
"Unexpected internal Evita error occurred.",
- targetException
+ targetException == null ? ex : targetException
);
}
} catch (Throwable ex) {
From 38251e0bd8e7a45d0ed05ba644981c2a7d1dbdf5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20Novotn=C3=BD?=
Date: Thu, 2 May 2024 11:34:34 +0200
Subject: [PATCH 03/24] fix(#550): partial implementation of health probe
---
docker/Dockerfile | 3 +
.../requestResponse/system/SystemStatus.java | 24 +-
.../src/main/java/io/evitadb/core/Evita.java | 4 +-
.../java/io/evitadb/driver/EvitaClient.java | 7 +-
.../generated/EvitaSessionServiceGrpc.java | 2 +-
.../grpc/generated/GrpcCatalogState.java | 2 +-
.../grpc/generated/GrpcCloseRequest.java | 8 +-
.../generated/GrpcCloseRequestOrBuilder.java | 2 +-
.../grpc/generated/GrpcCloseResponse.java | 6 +-
.../generated/GrpcCloseResponseOrBuilder.java | 2 +-
.../grpc/generated/GrpcCommitBehavior.java | 2 +-
.../externalApi/grpc/generated/GrpcEnums.java | 9 +-
.../grpc/generated/GrpcEvitaAPI.java | 184 +++++-----
.../GrpcEvitaServerStatusResponse.java | 338 ++++++++++++++++++
...rpcEvitaServerStatusResponseOrBuilder.java | 49 +++
.../grpc/generated/GrpcEvitaSessionAPI.java | 96 ++---
.../generated/GrpcEvitaSessionRequest.java | 24 +-
.../GrpcEvitaSessionRequestOrBuilder.java | 2 +-
.../generated/GrpcEvitaSessionResponse.java | 32 +-
.../GrpcEvitaSessionResponseOrBuilder.java | 2 +-
.../generated/GrpcGoLiveAndCloseResponse.java | 10 +-
.../GrpcGoLiveAndCloseResponseOrBuilder.java | 2 +-
.../grpc/generated/GrpcHealthProblem.java | 160 +++++++++
.../requestResponse/EvitaEnumConverter.java | 68 ++--
.../evitadb/externalApi/grpc/GrpcEnums.proto | 12 +
.../externalApi/grpc/GrpcEvitaAPI.proto | 4 +-
.../observability/metric/MetricHandler.java | 4 +
.../system/SystemProviderRegistrar.java | 32 +-
28 files changed, 860 insertions(+), 230 deletions(-)
create mode 100644 evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcHealthProblem.java
diff --git a/docker/Dockerfile b/docker/Dockerfile
index 113c8f77c..3c0160c32 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -12,6 +12,9 @@ LABEL vendor="FG Forrest, a.s." \
io.evitadb.version="${VERSION}" \
io.evitadb.release-date="${RELEASE_DATE}"
+HEALTHCHECK --interval=10s --timeout=2s --retries=2 \
+ CMD curl -f http://localhost:5557/system/liveness || exit 1
+
USER root
# Install bash
diff --git a/evita_api/src/main/java/io/evitadb/api/requestResponse/system/SystemStatus.java b/evita_api/src/main/java/io/evitadb/api/requestResponse/system/SystemStatus.java
index 09fe8647e..93f286fee 100644
--- a/evita_api/src/main/java/io/evitadb/api/requestResponse/system/SystemStatus.java
+++ b/evita_api/src/main/java/io/evitadb/api/requestResponse/system/SystemStatus.java
@@ -27,6 +27,7 @@
import java.io.Serializable;
import java.time.Duration;
import java.time.OffsetDateTime;
+import java.util.Set;
/**
* Contains basic information about evitaDB server.
@@ -37,6 +38,7 @@
* @param instanceId unique identifier of the server instance
* @param catalogsCorrupted number of corrupted catalogs
* @param catalogsOk number of catalogs that are ok
+ * @param healthProblems set of flags that indicate health problems of the server
*/
public record SystemStatus(
@Nonnull String version,
@@ -44,5 +46,23 @@ public record SystemStatus(
@Nonnull Duration uptime,
@Nonnull String instanceId,
int catalogsCorrupted,
- int catalogsOk
-) implements Serializable { }
+ int catalogsOk,
+ @Nonnull Set healthProblems
+) implements Serializable {
+
+ public enum HealthProblem {
+
+ /**
+ * Signalized when the consumed memory never goes below 85% of the maximum heap size and the GC tries to free
+ * old generation multiple times consuming a log of CPU power.
+ */
+ MEMORY_SHORTAGE,
+ /**
+ * Signalized when the input queues are full and the server is not able to process incoming requests. This flag
+ * is cleared when the server is able to process incoming requests again.
+ */
+ INPUT_QUEUES_OVERLOADED
+
+ }
+
+}
diff --git a/evita_engine/src/main/java/io/evitadb/core/Evita.java b/evita_engine/src/main/java/io/evitadb/core/Evita.java
index 47377c3f4..eb3890c80 100644
--- a/evita_engine/src/main/java/io/evitadb/core/Evita.java
+++ b/evita_engine/src/main/java/io/evitadb/core/Evita.java
@@ -51,6 +51,7 @@
import io.evitadb.api.requestResponse.schema.mutation.catalog.ModifyCatalogSchemaNameMutation;
import io.evitadb.api.requestResponse.schema.mutation.catalog.RemoveCatalogSchemaMutation;
import io.evitadb.api.requestResponse.system.SystemStatus;
+import io.evitadb.api.requestResponse.system.SystemStatus.HealthProblem;
import io.evitadb.api.trace.TracingContext;
import io.evitadb.api.trace.TracingContextProvider;
import io.evitadb.core.cache.CacheSupervisor;
@@ -527,7 +528,8 @@ public SystemStatus getSystemStatus() {
Duration.between(this.started, OffsetDateTime.now()),
this.configuration.name(),
corruptedCatalogs,
- this.catalogs.size() - corruptedCatalogs
+ this.catalogs.size() - corruptedCatalogs,
+ EnumSet.noneOf(HealthProblem.class)
);
}
diff --git a/evita_external_api/evita_external_api_grpc/client/src/main/java/io/evitadb/driver/EvitaClient.java b/evita_external_api/evita_external_api_grpc/client/src/main/java/io/evitadb/driver/EvitaClient.java
index 59021d0ff..146b7e303 100644
--- a/evita_external_api/evita_external_api_grpc/client/src/main/java/io/evitadb/driver/EvitaClient.java
+++ b/evita_external_api/evita_external_api_grpc/client/src/main/java/io/evitadb/driver/EvitaClient.java
@@ -91,6 +91,7 @@
import java.util.function.Supplier;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import java.util.stream.Collectors;
import static java.util.Optional.ofNullable;
@@ -628,7 +629,11 @@ public SystemStatus getSystemStatus() {
Duration.of(response.getUptime(), ChronoUnit.SECONDS),
response.getInstanceId(),
response.getCatalogsCorrupted(),
- response.getCatalogsOk()
+ response.getCatalogsOk(),
+ response.getHealthProblemsList()
+ .stream()
+ .map(EvitaEnumConverter::toHealthProblem)
+ .collect(Collectors.toSet())
);
}
);
diff --git a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/EvitaSessionServiceGrpc.java b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/EvitaSessionServiceGrpc.java
index d906c6db2..bb66938ba 100644
--- a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/EvitaSessionServiceGrpc.java
+++ b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/EvitaSessionServiceGrpc.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023-2024
+ * Copyright (c) 2023
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcCatalogState.java b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcCatalogState.java
index 84207e46c..e9ceafdeb 100644
--- a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcCatalogState.java
+++ b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcCatalogState.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023-2024
+ * Copyright (c) 2023
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcCloseRequest.java b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcCloseRequest.java
index 172d0602c..6fb6d991d 100644
--- a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcCloseRequest.java
+++ b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcCloseRequest.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023-2024
+ * Copyright (c) 2023
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -468,7 +468,7 @@ public Builder mergeFrom(
* @return This builder for chaining.
*/
public Builder setCommitBehaviourValue(int value) {
-
+
commitBehaviour_ = value;
onChanged();
return this;
@@ -500,7 +500,7 @@ public Builder setCommitBehaviour(io.evitadb.externalApi.grpc.generated.GrpcComm
if (value == null) {
throw new NullPointerException();
}
-
+
commitBehaviour_ = value.getNumber();
onChanged();
return this;
@@ -514,7 +514,7 @@ public Builder setCommitBehaviour(io.evitadb.externalApi.grpc.generated.GrpcComm
* @return This builder for chaining.
*/
public Builder clearCommitBehaviour() {
-
+
commitBehaviour_ = 0;
onChanged();
return this;
diff --git a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcCloseRequestOrBuilder.java b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcCloseRequestOrBuilder.java
index 001c02bd1..cef228c77 100644
--- a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcCloseRequestOrBuilder.java
+++ b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcCloseRequestOrBuilder.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023-2024
+ * Copyright (c) 2023
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcCloseResponse.java b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcCloseResponse.java
index 9bf186d69..898286538 100644
--- a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcCloseResponse.java
+++ b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcCloseResponse.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023-2024
+ * Copyright (c) 2023
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -457,7 +457,7 @@ public long getCatalogVersion() {
* @return This builder for chaining.
*/
public Builder setCatalogVersion(long value) {
-
+
catalogVersion_ = value;
onChanged();
return this;
@@ -471,7 +471,7 @@ public Builder setCatalogVersion(long value) {
* @return This builder for chaining.
*/
public Builder clearCatalogVersion() {
-
+
catalogVersion_ = 0L;
onChanged();
return this;
diff --git a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcCloseResponseOrBuilder.java b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcCloseResponseOrBuilder.java
index 16f668f3c..f0e2bd13c 100644
--- a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcCloseResponseOrBuilder.java
+++ b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcCloseResponseOrBuilder.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023-2024
+ * Copyright (c) 2023
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcCommitBehavior.java b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcCommitBehavior.java
index f753675d2..57a873495 100644
--- a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcCommitBehavior.java
+++ b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcCommitBehavior.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023-2024
+ * Copyright (c) 2023
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEnums.java b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEnums.java
index 75866c853..61a66395f 100644
--- a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEnums.java
+++ b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEnums.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023-2024
+ * Copyright (c) 2023
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -39,7 +39,7 @@ public static void registerAllExtensions(
}
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEvitaAssociatedDataDataType_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEvitaAssociatedDataDataType_fieldAccessorTable;
@@ -152,8 +152,9 @@ public static void registerAllExtensions(
"XIST\020\001\022\016\n\nMUST_EXIST\020\002*t\n\022GrpcCommitBeha" +
"vior\022 \n\034WAIT_FOR_CONFLICT_RESOLUTION\020\000\022\034" +
"\n\030WAIT_FOR_LOG_PERSISTENCE\020\001\022\036\n\032WAIT_FOR" +
- "_INDEX_PROPAGATION\020\002B\014P\001\252\002\007EvitaDBb\006prot" +
- "o3"
+ "_INDEX_PROPAGATION\020\002*E\n\021GrpcHealthProble" +
+ "m\022\023\n\017MEMORY_SHORTAGE\020\000\022\033\n\027INPUT_QUEUES_O" +
+ "VERLOADED\020\001B\014P\001\252\002\007EvitaDBb\006proto3"
};
descriptor = com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
diff --git a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaAPI.java b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaAPI.java
index 8ea71740f..47559e567 100644
--- a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaAPI.java
+++ b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaAPI.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023-2024
+ * Copyright (c) 2023
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -39,77 +39,77 @@ public static void registerAllExtensions(
}
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEvitaServerStatusResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEvitaServerStatusResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEvitaSessionRequest_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEvitaSessionRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEvitaSessionResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEvitaSessionResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEvitaSessionTerminationRequest_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEvitaSessionTerminationRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEvitaSessionTerminationResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEvitaSessionTerminationResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcCatalogNamesResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcCatalogNamesResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDefineCatalogRequest_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDefineCatalogRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDefineCatalogResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDefineCatalogResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcRenameCatalogRequest_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcRenameCatalogRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcRenameCatalogResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcRenameCatalogResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcReplaceCatalogRequest_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcReplaceCatalogRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcReplaceCatalogResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcReplaceCatalogResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDeleteCatalogIfExistsRequest_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDeleteCatalogIfExistsRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDeleteCatalogIfExistsResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDeleteCatalogIfExistsResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcUpdateEvitaRequest_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcUpdateEvitaRequest_fieldAccessorTable;
@@ -125,87 +125,89 @@ public static void registerAllExtensions(
"lApi.grpc.generated\032\033google/protobuf/emp" +
"ty.proto\032\017GrpcEnums.proto\032\030GrpcEvitaData" +
"Types.proto\032\037GrpcCatalogSchemaMutation.p" +
- "roto\"\321\001\n\035GrpcEvitaServerStatusResponse\022\017" +
+ "roto\"\243\002\n\035GrpcEvitaServerStatusResponse\022\017" +
"\n\007version\030\001 \001(\t\022L\n\tstartedAt\030\002 \001(\01329.io." +
"evitadb.externalApi.grpc.generated.GrpcO" +
"ffsetDateTime\022\016\n\006uptime\030\003 \001(\003\022\022\n\ninstanc" +
"eId\030\004 \001(\t\022\031\n\021catalogsCorrupted\030\005 \001(\005\022\022\n\n" +
- "catalogsOk\030\006 \001(\005\"\221\001\n\027GrpcEvitaSessionReq" +
- "uest\022\023\n\013catalogName\030\001 \001(\t\022Q\n\016commitBehav" +
- "ior\030\002 \001(\01629.io.evitadb.externalApi.grpc." +
- "generated.GrpcCommitBehavior\022\016\n\006dryRun\030\003" +
- " \001(\010\"\235\002\n\030GrpcEvitaSessionResponse\022\021\n\tses" +
- "sionId\030\001 \001(\t\022K\n\013sessionType\030\002 \001(\01626.io.e" +
- "vitadb.externalApi.grpc.generated.GrpcSe" +
- "ssionType\022R\n\017commitBehaviour\030\003 \001(\01629.io." +
- "evitadb.externalApi.grpc.generated.GrpcC" +
- "ommitBehavior\022M\n\014catalogState\030\004 \001(\01627.io" +
+ "catalogsOk\030\006 \001(\005\022P\n\016healthProblems\030\007 \003(\016" +
+ "28.io.evitadb.externalApi.grpc.generated" +
+ ".GrpcHealthProblem\"\221\001\n\027GrpcEvitaSessionR" +
+ "equest\022\023\n\013catalogName\030\001 \001(\t\022Q\n\016commitBeh" +
+ "avior\030\002 \001(\01629.io.evitadb.externalApi.grp" +
+ "c.generated.GrpcCommitBehavior\022\016\n\006dryRun" +
+ "\030\003 \001(\010\"\235\002\n\030GrpcEvitaSessionResponse\022\021\n\ts" +
+ "essionId\030\001 \001(\t\022K\n\013sessionType\030\002 \001(\01626.io" +
".evitadb.externalApi.grpc.generated.Grpc" +
- "CatalogState\"L\n\"GrpcEvitaSessionTerminat" +
- "ionRequest\022\023\n\013catalogName\030\001 \001(\t\022\021\n\tsessi" +
- "onId\030\002 \001(\t\"9\n#GrpcEvitaSessionTerminatio" +
- "nResponse\022\022\n\nterminated\030\001 \001(\010\"0\n\030GrpcCat" +
- "alogNamesResponse\022\024\n\014catalogNames\030\001 \003(\t\"" +
- "/\n\030GrpcDefineCatalogRequest\022\023\n\013catalogNa" +
- "me\030\001 \001(\t\",\n\031GrpcDefineCatalogResponse\022\017\n" +
- "\007success\030\001 \001(\010\"G\n\030GrpcRenameCatalogReque" +
- "st\022\023\n\013catalogName\030\001 \001(\t\022\026\n\016newCatalogNam" +
- "e\030\002 \001(\t\",\n\031GrpcRenameCatalogResponse\022\017\n\007" +
- "success\030\001 \001(\010\"a\n\031GrpcReplaceCatalogReque" +
- "st\022#\n\033catalogNameToBeReplacedWith\030\001 \001(\t\022" +
- "\037\n\027catalogNameToBeReplaced\030\002 \001(\t\"-\n\032Grpc" +
- "ReplaceCatalogResponse\022\017\n\007success\030\001 \001(\010\"" +
- "7\n GrpcDeleteCatalogIfExistsRequest\022\023\n\013c" +
- "atalogName\030\001 \001(\t\"4\n!GrpcDeleteCatalogIfE" +
- "xistsResponse\022\017\n\007success\030\001 \001(\010\"{\n\026GrpcUp" +
- "dateEvitaRequest\022a\n\017schemaMutations\030\001 \003(" +
- "\0132H.io.evitadb.externalApi.grpc.generate" +
- "d.GrpcTopLevelCatalogSchemaMutation2\336\r\n\014" +
- "EvitaService\022l\n\014ServerStatus\022\026.google.pr" +
- "otobuf.Empty\032D.io.evitadb.externalApi.gr" +
- "pc.generated.GrpcEvitaServerStatusRespon" +
- "se\022\230\001\n\025CreateReadOnlySession\022>.io.evitad" +
- "b.externalApi.grpc.generated.GrpcEvitaSe" +
- "ssionRequest\032?.io.evitadb.externalApi.gr" +
- "pc.generated.GrpcEvitaSessionResponse\022\231\001" +
- "\n\026CreateReadWriteSession\022>.io.evitadb.ex" +
- "ternalApi.grpc.generated.GrpcEvitaSessio" +
- "nRequest\032?.io.evitadb.externalApi.grpc.g" +
- "enerated.GrpcEvitaSessionResponse\022\236\001\n\033Cr" +
- "eateBinaryReadOnlySession\022>.io.evitadb.e" +
- "xternalApi.grpc.generated.GrpcEvitaSessi" +
- "onRequest\032?.io.evitadb.externalApi.grpc." +
- "generated.GrpcEvitaSessionResponse\022\237\001\n\034C" +
- "reateBinaryReadWriteSession\022>.io.evitadb" +
+ "SessionType\022R\n\017commitBehaviour\030\003 \001(\01629.i" +
+ "o.evitadb.externalApi.grpc.generated.Grp" +
+ "cCommitBehavior\022M\n\014catalogState\030\004 \001(\01627." +
+ "io.evitadb.externalApi.grpc.generated.Gr" +
+ "pcCatalogState\"L\n\"GrpcEvitaSessionTermin" +
+ "ationRequest\022\023\n\013catalogName\030\001 \001(\t\022\021\n\tses" +
+ "sionId\030\002 \001(\t\"9\n#GrpcEvitaSessionTerminat" +
+ "ionResponse\022\022\n\nterminated\030\001 \001(\010\"0\n\030GrpcC" +
+ "atalogNamesResponse\022\024\n\014catalogNames\030\001 \003(" +
+ "\t\"/\n\030GrpcDefineCatalogRequest\022\023\n\013catalog" +
+ "Name\030\001 \001(\t\",\n\031GrpcDefineCatalogResponse\022" +
+ "\017\n\007success\030\001 \001(\010\"G\n\030GrpcRenameCatalogReq" +
+ "uest\022\023\n\013catalogName\030\001 \001(\t\022\026\n\016newCatalogN" +
+ "ame\030\002 \001(\t\",\n\031GrpcRenameCatalogResponse\022\017" +
+ "\n\007success\030\001 \001(\010\"a\n\031GrpcReplaceCatalogReq" +
+ "uest\022#\n\033catalogNameToBeReplacedWith\030\001 \001(" +
+ "\t\022\037\n\027catalogNameToBeReplaced\030\002 \001(\t\"-\n\032Gr" +
+ "pcReplaceCatalogResponse\022\017\n\007success\030\001 \001(" +
+ "\010\"7\n GrpcDeleteCatalogIfExistsRequest\022\023\n" +
+ "\013catalogName\030\001 \001(\t\"4\n!GrpcDeleteCatalogI" +
+ "fExistsResponse\022\017\n\007success\030\001 \001(\010\"{\n\026Grpc" +
+ "UpdateEvitaRequest\022a\n\017schemaMutations\030\001 " +
+ "\003(\0132H.io.evitadb.externalApi.grpc.genera" +
+ "ted.GrpcTopLevelCatalogSchemaMutation2\336\r" +
+ "\n\014EvitaService\022l\n\014ServerStatus\022\026.google." +
+ "protobuf.Empty\032D.io.evitadb.externalApi." +
+ "grpc.generated.GrpcEvitaServerStatusResp" +
+ "onse\022\230\001\n\025CreateReadOnlySession\022>.io.evit" +
+ "adb.externalApi.grpc.generated.GrpcEvita" +
+ "SessionRequest\032?.io.evitadb.externalApi." +
+ "grpc.generated.GrpcEvitaSessionResponse\022" +
+ "\231\001\n\026CreateReadWriteSession\022>.io.evitadb." +
+ "externalApi.grpc.generated.GrpcEvitaSess" +
+ "ionRequest\032?.io.evitadb.externalApi.grpc" +
+ ".generated.GrpcEvitaSessionResponse\022\236\001\n\033" +
+ "CreateBinaryReadOnlySession\022>.io.evitadb" +
".externalApi.grpc.generated.GrpcEvitaSes" +
"sionRequest\032?.io.evitadb.externalApi.grp" +
- "c.generated.GrpcEvitaSessionResponse\022\251\001\n" +
- "\020TerminateSession\022I.io.evitadb.externalA" +
- "pi.grpc.generated.GrpcEvitaSessionTermin" +
- "ationRequest\032J.io.evitadb.externalApi.gr" +
- "pc.generated.GrpcEvitaSessionTermination" +
- "Response\022j\n\017GetCatalogNames\022\026.google.pro" +
- "tobuf.Empty\032?.io.evitadb.externalApi.grp" +
- "c.generated.GrpcCatalogNamesResponse\022\222\001\n" +
- "\rDefineCatalog\022?.io.evitadb.externalApi." +
- "grpc.generated.GrpcDefineCatalogRequest\032" +
- "@.io.evitadb.externalApi.grpc.generated." +
- "GrpcDefineCatalogResponse\022\222\001\n\rRenameCata" +
- "log\022?.io.evitadb.externalApi.grpc.genera" +
- "ted.GrpcRenameCatalogRequest\032@.io.evitad" +
- "b.externalApi.grpc.generated.GrpcRenameC" +
- "atalogResponse\022\225\001\n\016ReplaceCatalog\022@.io.e" +
- "vitadb.externalApi.grpc.generated.GrpcRe" +
- "placeCatalogRequest\032A.io.evitadb.externa" +
- "lApi.grpc.generated.GrpcReplaceCatalogRe" +
- "sponse\022\252\001\n\025DeleteCatalogIfExists\022G.io.ev" +
- "itadb.externalApi.grpc.generated.GrpcDel" +
- "eteCatalogIfExistsRequest\032H.io.evitadb.e" +
- "xternalApi.grpc.generated.GrpcDeleteCata" +
- "logIfExistsResponse\022_\n\006Update\022=.io.evita" +
- "db.externalApi.grpc.generated.GrpcUpdate" +
- "EvitaRequest\032\026.google.protobuf.EmptyB\014P\001" +
- "\252\002\007EvitaDBb\006proto3"
+ "c.generated.GrpcEvitaSessionResponse\022\237\001\n" +
+ "\034CreateBinaryReadWriteSession\022>.io.evita" +
+ "db.externalApi.grpc.generated.GrpcEvitaS" +
+ "essionRequest\032?.io.evitadb.externalApi.g" +
+ "rpc.generated.GrpcEvitaSessionResponse\022\251" +
+ "\001\n\020TerminateSession\022I.io.evitadb.externa" +
+ "lApi.grpc.generated.GrpcEvitaSessionTerm" +
+ "inationRequest\032J.io.evitadb.externalApi." +
+ "grpc.generated.GrpcEvitaSessionTerminati" +
+ "onResponse\022j\n\017GetCatalogNames\022\026.google.p" +
+ "rotobuf.Empty\032?.io.evitadb.externalApi.g" +
+ "rpc.generated.GrpcCatalogNamesResponse\022\222" +
+ "\001\n\rDefineCatalog\022?.io.evitadb.externalAp" +
+ "i.grpc.generated.GrpcDefineCatalogReques" +
+ "t\032@.io.evitadb.externalApi.grpc.generate" +
+ "d.GrpcDefineCatalogResponse\022\222\001\n\rRenameCa" +
+ "talog\022?.io.evitadb.externalApi.grpc.gene" +
+ "rated.GrpcRenameCatalogRequest\032@.io.evit" +
+ "adb.externalApi.grpc.generated.GrpcRenam" +
+ "eCatalogResponse\022\225\001\n\016ReplaceCatalog\022@.io" +
+ ".evitadb.externalApi.grpc.generated.Grpc" +
+ "ReplaceCatalogRequest\032A.io.evitadb.exter" +
+ "nalApi.grpc.generated.GrpcReplaceCatalog" +
+ "Response\022\252\001\n\025DeleteCatalogIfExists\022G.io." +
+ "evitadb.externalApi.grpc.generated.GrpcD" +
+ "eleteCatalogIfExistsRequest\032H.io.evitadb" +
+ ".externalApi.grpc.generated.GrpcDeleteCa" +
+ "talogIfExistsResponse\022_\n\006Update\022=.io.evi" +
+ "tadb.externalApi.grpc.generated.GrpcUpda" +
+ "teEvitaRequest\032\026.google.protobuf.EmptyB\014" +
+ "P\001\252\002\007EvitaDBb\006proto3"
};
descriptor = com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
@@ -220,7 +222,7 @@ public static void registerAllExtensions(
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEvitaServerStatusResponse_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEvitaServerStatusResponse_descriptor,
- new java.lang.String[] { "Version", "StartedAt", "Uptime", "InstanceId", "CatalogsCorrupted", "CatalogsOk", });
+ new java.lang.String[] { "Version", "StartedAt", "Uptime", "InstanceId", "CatalogsCorrupted", "CatalogsOk", "HealthProblems", });
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEvitaSessionRequest_descriptor =
getDescriptor().getMessageTypes().get(1);
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEvitaSessionRequest_fieldAccessorTable = new
diff --git a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaServerStatusResponse.java b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaServerStatusResponse.java
index 96a32969f..3945e9756 100644
--- a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaServerStatusResponse.java
+++ b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaServerStatusResponse.java
@@ -45,6 +45,7 @@ private GrpcEvitaServerStatusResponse(com.google.protobuf.GeneratedMessageV3.Bui
private GrpcEvitaServerStatusResponse() {
version_ = "";
instanceId_ = "";
+ healthProblems_ = java.util.Collections.emptyList();
}
@java.lang.Override
@@ -67,6 +68,7 @@ private GrpcEvitaServerStatusResponse(
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
+ int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
@@ -117,6 +119,29 @@ private GrpcEvitaServerStatusResponse(
catalogsOk_ = input.readInt32();
break;
}
+ case 56: {
+ int rawValue = input.readEnum();
+ if (!((mutable_bitField0_ & 0x00000001) != 0)) {
+ healthProblems_ = new java.util.ArrayList();
+ mutable_bitField0_ |= 0x00000001;
+ }
+ healthProblems_.add(rawValue);
+ break;
+ }
+ case 58: {
+ int length = input.readRawVarint32();
+ int oldLimit = input.pushLimit(length);
+ while(input.getBytesUntilLimit() > 0) {
+ int rawValue = input.readEnum();
+ if (!((mutable_bitField0_ & 0x00000001) != 0)) {
+ healthProblems_ = new java.util.ArrayList();
+ mutable_bitField0_ |= 0x00000001;
+ }
+ healthProblems_.add(rawValue);
+ }
+ input.popLimit(oldLimit);
+ break;
+ }
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
@@ -132,6 +157,9 @@ private GrpcEvitaServerStatusResponse(
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
+ if (((mutable_bitField0_ & 0x00000001) != 0)) {
+ healthProblems_ = java.util.Collections.unmodifiableList(healthProblems_);
+ }
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
@@ -324,6 +352,84 @@ public int getCatalogsOk() {
return catalogsOk_;
}
+ public static final int HEALTHPROBLEMS_FIELD_NUMBER = 7;
+ private java.util.List healthProblems_;
+ private static final com.google.protobuf.Internal.ListAdapter.Converter<
+ java.lang.Integer, io.evitadb.externalApi.grpc.generated.GrpcHealthProblem> healthProblems_converter_ =
+ new com.google.protobuf.Internal.ListAdapter.Converter<
+ java.lang.Integer, io.evitadb.externalApi.grpc.generated.GrpcHealthProblem>() {
+ public io.evitadb.externalApi.grpc.generated.GrpcHealthProblem convert(java.lang.Integer from) {
+ @SuppressWarnings("deprecation")
+ io.evitadb.externalApi.grpc.generated.GrpcHealthProblem result = io.evitadb.externalApi.grpc.generated.GrpcHealthProblem.valueOf(from);
+ return result == null ? io.evitadb.externalApi.grpc.generated.GrpcHealthProblem.UNRECOGNIZED : result;
+ }
+ };
+ /**
+ *
+ * Set of all observed health problems
+ *
+ *
+ * repeated .io.evitadb.externalApi.grpc.generated.GrpcHealthProblem healthProblems = 7;
+ * @return A list containing the healthProblems.
+ */
+ @java.lang.Override
+ public java.util.List getHealthProblemsList() {
+ return new com.google.protobuf.Internal.ListAdapter<
+ java.lang.Integer, io.evitadb.externalApi.grpc.generated.GrpcHealthProblem>(healthProblems_, healthProblems_converter_);
+ }
+ /**
+ *
+ * Set of all observed health problems
+ *
+ *
+ * repeated .io.evitadb.externalApi.grpc.generated.GrpcHealthProblem healthProblems = 7;
+ * @return The count of healthProblems.
+ */
+ @java.lang.Override
+ public int getHealthProblemsCount() {
+ return healthProblems_.size();
+ }
+ /**
+ *
+ * Set of all observed health problems
+ *
+ *
+ * repeated .io.evitadb.externalApi.grpc.generated.GrpcHealthProblem healthProblems = 7;
+ * @param index The index of the element to return.
+ * @return The healthProblems at the given index.
+ */
+ @java.lang.Override
+ public io.evitadb.externalApi.grpc.generated.GrpcHealthProblem getHealthProblems(int index) {
+ return healthProblems_converter_.convert(healthProblems_.get(index));
+ }
+ /**
+ *
+ * Set of all observed health problems
+ *
+ *
+ * repeated .io.evitadb.externalApi.grpc.generated.GrpcHealthProblem healthProblems = 7;
+ * @return A list containing the enum numeric values on the wire for healthProblems.
+ */
+ @java.lang.Override
+ public java.util.List
+ getHealthProblemsValueList() {
+ return healthProblems_;
+ }
+ /**
+ *
+ * Set of all observed health problems
+ *
+ *
+ * repeated .io.evitadb.externalApi.grpc.generated.GrpcHealthProblem healthProblems = 7;
+ * @param index The index of the value to return.
+ * @return The enum numeric value on the wire of healthProblems at the given index.
+ */
+ @java.lang.Override
+ public int getHealthProblemsValue(int index) {
+ return healthProblems_.get(index);
+ }
+ private int healthProblemsMemoizedSerializedSize;
+
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
@@ -338,6 +444,7 @@ public final boolean isInitialized() {
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
+ getSerializedSize();
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(version_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, version_);
}
@@ -356,6 +463,13 @@ public void writeTo(com.google.protobuf.CodedOutputStream output)
if (catalogsOk_ != 0) {
output.writeInt32(6, catalogsOk_);
}
+ if (getHealthProblemsList().size() > 0) {
+ output.writeUInt32NoTag(58);
+ output.writeUInt32NoTag(healthProblemsMemoizedSerializedSize);
+ }
+ for (int i = 0; i < healthProblems_.size(); i++) {
+ output.writeEnumNoTag(healthProblems_.get(i));
+ }
unknownFields.writeTo(output);
}
@@ -387,6 +501,18 @@ public int getSerializedSize() {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(6, catalogsOk_);
}
+ {
+ int dataSize = 0;
+ for (int i = 0; i < healthProblems_.size(); i++) {
+ dataSize += com.google.protobuf.CodedOutputStream
+ .computeEnumSizeNoTag(healthProblems_.get(i));
+ }
+ size += dataSize;
+ if (!getHealthProblemsList().isEmpty()) { size += 1;
+ size += com.google.protobuf.CodedOutputStream
+ .computeUInt32SizeNoTag(dataSize);
+ }healthProblemsMemoizedSerializedSize = dataSize;
+ }
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
@@ -417,6 +543,7 @@ public boolean equals(final java.lang.Object obj) {
!= other.getCatalogsCorrupted()) return false;
if (getCatalogsOk()
!= other.getCatalogsOk()) return false;
+ if (!healthProblems_.equals(other.healthProblems_)) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@@ -443,6 +570,10 @@ public int hashCode() {
hash = (53 * hash) + getCatalogsCorrupted();
hash = (37 * hash) + CATALOGSOK_FIELD_NUMBER;
hash = (53 * hash) + getCatalogsOk();
+ if (getHealthProblemsCount() > 0) {
+ hash = (37 * hash) + HEALTHPROBLEMS_FIELD_NUMBER;
+ hash = (53 * hash) + healthProblems_.hashCode();
+ }
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
@@ -596,6 +727,8 @@ public Builder clear() {
catalogsOk_ = 0;
+ healthProblems_ = java.util.Collections.emptyList();
+ bitField0_ = (bitField0_ & ~0x00000001);
return this;
}
@@ -622,6 +755,7 @@ public io.evitadb.externalApi.grpc.generated.GrpcEvitaServerStatusResponse build
@java.lang.Override
public io.evitadb.externalApi.grpc.generated.GrpcEvitaServerStatusResponse buildPartial() {
io.evitadb.externalApi.grpc.generated.GrpcEvitaServerStatusResponse result = new io.evitadb.externalApi.grpc.generated.GrpcEvitaServerStatusResponse(this);
+ int from_bitField0_ = bitField0_;
result.version_ = version_;
if (startedAtBuilder_ == null) {
result.startedAt_ = startedAt_;
@@ -632,6 +766,11 @@ public io.evitadb.externalApi.grpc.generated.GrpcEvitaServerStatusResponse build
result.instanceId_ = instanceId_;
result.catalogsCorrupted_ = catalogsCorrupted_;
result.catalogsOk_ = catalogsOk_;
+ if (((bitField0_ & 0x00000001) != 0)) {
+ healthProblems_ = java.util.Collections.unmodifiableList(healthProblems_);
+ bitField0_ = (bitField0_ & ~0x00000001);
+ }
+ result.healthProblems_ = healthProblems_;
onBuilt();
return result;
}
@@ -700,6 +839,16 @@ public Builder mergeFrom(io.evitadb.externalApi.grpc.generated.GrpcEvitaServerSt
if (other.getCatalogsOk() != 0) {
setCatalogsOk(other.getCatalogsOk());
}
+ if (!other.healthProblems_.isEmpty()) {
+ if (healthProblems_.isEmpty()) {
+ healthProblems_ = other.healthProblems_;
+ bitField0_ = (bitField0_ & ~0x00000001);
+ } else {
+ ensureHealthProblemsIsMutable();
+ healthProblems_.addAll(other.healthProblems_);
+ }
+ onChanged();
+ }
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
@@ -728,6 +877,7 @@ public Builder mergeFrom(
}
return this;
}
+ private int bitField0_;
private java.lang.Object version_ = "";
/**
@@ -1204,6 +1354,194 @@ public Builder clearCatalogsOk() {
onChanged();
return this;
}
+
+ private java.util.List healthProblems_ =
+ java.util.Collections.emptyList();
+ private void ensureHealthProblemsIsMutable() {
+ if (!((bitField0_ & 0x00000001) != 0)) {
+ healthProblems_ = new java.util.ArrayList(healthProblems_);
+ bitField0_ |= 0x00000001;
+ }
+ }
+ /**
+ *
+ * Set of all observed health problems
+ *
+ *
+ * repeated .io.evitadb.externalApi.grpc.generated.GrpcHealthProblem healthProblems = 7;
+ * @return A list containing the healthProblems.
+ */
+ public java.util.List getHealthProblemsList() {
+ return new com.google.protobuf.Internal.ListAdapter<
+ java.lang.Integer, io.evitadb.externalApi.grpc.generated.GrpcHealthProblem>(healthProblems_, healthProblems_converter_);
+ }
+ /**
+ *
+ * Set of all observed health problems
+ *
+ *
+ * repeated .io.evitadb.externalApi.grpc.generated.GrpcHealthProblem healthProblems = 7;
+ * @return The count of healthProblems.
+ */
+ public int getHealthProblemsCount() {
+ return healthProblems_.size();
+ }
+ /**
+ *
+ * Set of all observed health problems
+ *
+ *
+ * repeated .io.evitadb.externalApi.grpc.generated.GrpcHealthProblem healthProblems = 7;
+ * @param index The index of the element to return.
+ * @return The healthProblems at the given index.
+ */
+ public io.evitadb.externalApi.grpc.generated.GrpcHealthProblem getHealthProblems(int index) {
+ return healthProblems_converter_.convert(healthProblems_.get(index));
+ }
+ /**
+ *
+ * Set of all observed health problems
+ *
+ *
+ * repeated .io.evitadb.externalApi.grpc.generated.GrpcHealthProblem healthProblems = 7;
+ * @param index The index to set the value at.
+ * @param value The healthProblems to set.
+ * @return This builder for chaining.
+ */
+ public Builder setHealthProblems(
+ int index, io.evitadb.externalApi.grpc.generated.GrpcHealthProblem value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureHealthProblemsIsMutable();
+ healthProblems_.set(index, value.getNumber());
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ * Set of all observed health problems
+ *
+ *
+ * repeated .io.evitadb.externalApi.grpc.generated.GrpcHealthProblem healthProblems = 7;
+ * @param value The healthProblems to add.
+ * @return This builder for chaining.
+ */
+ public Builder addHealthProblems(io.evitadb.externalApi.grpc.generated.GrpcHealthProblem value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureHealthProblemsIsMutable();
+ healthProblems_.add(value.getNumber());
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ * Set of all observed health problems
+ *
+ *
+ * repeated .io.evitadb.externalApi.grpc.generated.GrpcHealthProblem healthProblems = 7;
+ * @param values The healthProblems to add.
+ * @return This builder for chaining.
+ */
+ public Builder addAllHealthProblems(
+ java.lang.Iterable extends io.evitadb.externalApi.grpc.generated.GrpcHealthProblem> values) {
+ ensureHealthProblemsIsMutable();
+ for (io.evitadb.externalApi.grpc.generated.GrpcHealthProblem value : values) {
+ healthProblems_.add(value.getNumber());
+ }
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * repeated .io.evitadb.externalApi.grpc.generated.GrpcHealthProblem healthProblems = 7;
+ * @return A list containing the enum numeric values on the wire for healthProblems.
+ */
+ public java.util.List
+ getHealthProblemsValueList() {
+ return java.util.Collections.unmodifiableList(healthProblems_);
+ }
+ /**
+ *
+ * Set of all observed health problems
+ *
+ *
+ * repeated .io.evitadb.externalApi.grpc.generated.GrpcHealthProblem healthProblems = 7;
+ * @param index The index of the value to return.
+ * @return The enum numeric value on the wire of healthProblems at the given index.
+ */
+ public int getHealthProblemsValue(int index) {
+ return healthProblems_.get(index);
+ }
+ /**
+ *
+ * Set of all observed health problems
+ *
+ *
+ * repeated .io.evitadb.externalApi.grpc.generated.GrpcHealthProblem healthProblems = 7;
+ * @param index The index of the value to return.
+ * @return The enum numeric value on the wire of healthProblems at the given index.
+ * @return This builder for chaining.
+ */
+ public Builder setHealthProblemsValue(
+ int index, int value) {
+ ensureHealthProblemsIsMutable();
+ healthProblems_.set(index, value);
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ * Set of all observed health problems
+ *
+ *
+ * repeated .io.evitadb.externalApi.grpc.generated.GrpcHealthProblem healthProblems = 7;
+ * @param value The enum numeric value on the wire for healthProblems to add.
+ * @return This builder for chaining.
+ */
+ public Builder addHealthProblemsValue(int value) {
+ ensureHealthProblemsIsMutable();
+ healthProblems_.add(value);
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ * Set of all observed health problems
+ *
+ *
+ * repeated .io.evitadb.externalApi.grpc.generated.GrpcHealthProblem healthProblems = 7;
+ * @param values The enum numeric values on the wire for healthProblems to add.
+ * @return This builder for chaining.
+ */
+ public Builder addAllHealthProblemsValue(
+ java.lang.Iterable values) {
+ ensureHealthProblemsIsMutable();
+ for (int value : values) {
+ healthProblems_.add(value);
+ }
+ onChanged();
+ return this;
+ }
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
diff --git a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaServerStatusResponseOrBuilder.java b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaServerStatusResponseOrBuilder.java
index 1520b68fe..c52d8142a 100644
--- a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaServerStatusResponseOrBuilder.java
+++ b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaServerStatusResponseOrBuilder.java
@@ -126,4 +126,53 @@ public interface GrpcEvitaServerStatusResponseOrBuilder extends
* @return The catalogsOk.
*/
int getCatalogsOk();
+
+ /**
+ *
+ * Set of all observed health problems
+ *
+ *
+ * repeated .io.evitadb.externalApi.grpc.generated.GrpcHealthProblem healthProblems = 7;
+ * @return A list containing the healthProblems.
+ */
+ java.util.List getHealthProblemsList();
+ /**
+ *
+ * Set of all observed health problems
+ *
+ *
+ * repeated .io.evitadb.externalApi.grpc.generated.GrpcHealthProblem healthProblems = 7;
+ * @return The count of healthProblems.
+ */
+ int getHealthProblemsCount();
+ /**
+ *
+ * Set of all observed health problems
+ *
+ *
+ * repeated .io.evitadb.externalApi.grpc.generated.GrpcHealthProblem healthProblems = 7;
+ * @param index The index of the element to return.
+ * @return The healthProblems at the given index.
+ */
+ io.evitadb.externalApi.grpc.generated.GrpcHealthProblem getHealthProblems(int index);
+ /**
+ *
+ * Set of all observed health problems
+ *
+ *
+ * repeated .io.evitadb.externalApi.grpc.generated.GrpcHealthProblem healthProblems = 7;
+ * @return A list containing the enum numeric values on the wire for healthProblems.
+ */
+ java.util.List
+ getHealthProblemsValueList();
+ /**
+ *
+ * Set of all observed health problems
+ *
+ *
+ * repeated .io.evitadb.externalApi.grpc.generated.GrpcHealthProblem healthProblems = 7;
+ * @param index The index of the value to return.
+ * @return The enum numeric value on the wire of healthProblems at the given index.
+ */
+ int getHealthProblemsValue(int index);
}
diff --git a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaSessionAPI.java b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaSessionAPI.java
index 1acea46ee..77ddce1b8 100644
--- a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaSessionAPI.java
+++ b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaSessionAPI.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023-2024
+ * Copyright (c) 2023
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -39,237 +39,237 @@ public static void registerAllExtensions(
}
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcCatalogStateResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcCatalogStateResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcCatalogSchemaResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcCatalogSchemaResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEntitySchemaRequest_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEntitySchemaRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEntitySchemaResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEntitySchemaResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcUpdateCatalogSchemaRequest_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcUpdateCatalogSchemaRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcUpdateCatalogSchemaResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcUpdateCatalogSchemaResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcUpdateAndFetchCatalogSchemaResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcUpdateAndFetchCatalogSchemaResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDefineEntitySchemaRequest_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDefineEntitySchemaRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDefineEntitySchemaResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDefineEntitySchemaResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcUpdateEntitySchemaRequest_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcUpdateEntitySchemaRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcUpdateEntitySchemaResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcUpdateEntitySchemaResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcUpdateAndFetchEntitySchemaResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcUpdateAndFetchEntitySchemaResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEntityRequest_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEntityRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEntityRequest_NamedQueryParamsEntry_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEntityRequest_NamedQueryParamsEntry_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEntityResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEntityResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcPaginatedList_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcPaginatedList_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcStripList_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcStripList_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDataChunk_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDataChunk_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDeleteCollectionRequest_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDeleteCollectionRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDeleteCollectionResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDeleteCollectionResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcRenameCollectionRequest_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcRenameCollectionRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcRenameCollectionResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcRenameCollectionResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcReplaceCollectionRequest_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcReplaceCollectionRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcReplaceCollectionResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcReplaceCollectionResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEntityCollectionSizeRequest_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEntityCollectionSizeRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEntityCollectionSizeResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEntityCollectionSizeResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcCloseRequest_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcCloseRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcCloseResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcCloseResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcGoLiveAndCloseResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcGoLiveAndCloseResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEntityTypesResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEntityTypesResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcQueryRequest_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcQueryRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcQueryRequest_NamedQueryParamsEntry_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcQueryRequest_NamedQueryParamsEntry_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcQueryResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcQueryResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcQueryOneResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcQueryOneResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcQueryListResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcQueryListResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcUpsertEntityRequest_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcUpsertEntityRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcUpsertEntityRequest_NamedQueryParamsEntry_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcUpsertEntityRequest_NamedQueryParamsEntry_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDeleteEntityRequest_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDeleteEntityRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDeleteEntityRequest_NamedQueryParamsEntry_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDeleteEntityRequest_NamedQueryParamsEntry_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDeleteEntitiesRequest_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDeleteEntitiesRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDeleteEntitiesRequest_NamedQueryParamsEntry_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDeleteEntitiesRequest_NamedQueryParamsEntry_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcUpsertEntityResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcUpsertEntityResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDeleteEntityResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDeleteEntityResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDeleteEntityAndItsHierarchyResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDeleteEntityAndItsHierarchyResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDeleteEntitiesResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDeleteEntitiesResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcTransactionResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcTransactionResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcQueryParam_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcQueryParam_fieldAccessorTable;
diff --git a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaSessionRequest.java b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaSessionRequest.java
index dd61ef83b..0382b83e9 100644
--- a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaSessionRequest.java
+++ b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaSessionRequest.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023-2024
+ * Copyright (c) 2023
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -142,7 +142,7 @@ public java.lang.String getCatalogName() {
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
- com.google.protobuf.ByteString bs =
+ com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
catalogName_ = s;
@@ -162,7 +162,7 @@ public java.lang.String getCatalogName() {
getCatalogNameBytes() {
java.lang.Object ref = catalogName_;
if (ref instanceof java.lang.String) {
- com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
catalogName_ = b;
@@ -587,7 +587,7 @@ public java.lang.String getCatalogName() {
getCatalogNameBytes() {
java.lang.Object ref = catalogName_;
if (ref instanceof String) {
- com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
catalogName_ = b;
@@ -610,7 +610,7 @@ public Builder setCatalogName(
if (value == null) {
throw new NullPointerException();
}
-
+
catalogName_ = value;
onChanged();
return this;
@@ -624,7 +624,7 @@ public Builder setCatalogName(
* @return This builder for chaining.
*/
public Builder clearCatalogName() {
-
+
catalogName_ = getDefaultInstance().getCatalogName();
onChanged();
return this;
@@ -644,7 +644,7 @@ public Builder setCatalogNameBytes(
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
-
+
catalogName_ = value;
onChanged();
return this;
@@ -672,7 +672,7 @@ public Builder setCatalogNameBytes(
* @return This builder for chaining.
*/
public Builder setCommitBehaviorValue(int value) {
-
+
commitBehavior_ = value;
onChanged();
return this;
@@ -704,7 +704,7 @@ public Builder setCommitBehavior(io.evitadb.externalApi.grpc.generated.GrpcCommi
if (value == null) {
throw new NullPointerException();
}
-
+
commitBehavior_ = value.getNumber();
onChanged();
return this;
@@ -718,7 +718,7 @@ public Builder setCommitBehavior(io.evitadb.externalApi.grpc.generated.GrpcCommi
* @return This builder for chaining.
*/
public Builder clearCommitBehavior() {
-
+
commitBehavior_ = 0;
onChanged();
return this;
@@ -747,7 +747,7 @@ public boolean getDryRun() {
* @return This builder for chaining.
*/
public Builder setDryRun(boolean value) {
-
+
dryRun_ = value;
onChanged();
return this;
@@ -761,7 +761,7 @@ public Builder setDryRun(boolean value) {
* @return This builder for chaining.
*/
public Builder clearDryRun() {
-
+
dryRun_ = false;
onChanged();
return this;
diff --git a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaSessionRequestOrBuilder.java b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaSessionRequestOrBuilder.java
index 26ac8e5eb..29ecc4e32 100644
--- a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaSessionRequestOrBuilder.java
+++ b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaSessionRequestOrBuilder.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023-2024
+ * Copyright (c) 2023
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaSessionResponse.java b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaSessionResponse.java
index 595f765c5..604fe3040 100644
--- a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaSessionResponse.java
+++ b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaSessionResponse.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023-2024
+ * Copyright (c) 2023
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -151,7 +151,7 @@ public java.lang.String getSessionId() {
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
- com.google.protobuf.ByteString bs =
+ com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
sessionId_ = s;
@@ -171,7 +171,7 @@ public java.lang.String getSessionId() {
getSessionIdBytes() {
java.lang.Object ref = sessionId_;
if (ref instanceof java.lang.String) {
- com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
sessionId_ = b;
@@ -649,7 +649,7 @@ public java.lang.String getSessionId() {
getSessionIdBytes() {
java.lang.Object ref = sessionId_;
if (ref instanceof String) {
- com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
sessionId_ = b;
@@ -672,7 +672,7 @@ public Builder setSessionId(
if (value == null) {
throw new NullPointerException();
}
-
+
sessionId_ = value;
onChanged();
return this;
@@ -686,7 +686,7 @@ public Builder setSessionId(
* @return This builder for chaining.
*/
public Builder clearSessionId() {
-
+
sessionId_ = getDefaultInstance().getSessionId();
onChanged();
return this;
@@ -706,7 +706,7 @@ public Builder setSessionIdBytes(
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
-
+
sessionId_ = value;
onChanged();
return this;
@@ -734,7 +734,7 @@ public Builder setSessionIdBytes(
* @return This builder for chaining.
*/
public Builder setSessionTypeValue(int value) {
-
+
sessionType_ = value;
onChanged();
return this;
@@ -766,7 +766,7 @@ public Builder setSessionType(io.evitadb.externalApi.grpc.generated.GrpcSessionT
if (value == null) {
throw new NullPointerException();
}
-
+
sessionType_ = value.getNumber();
onChanged();
return this;
@@ -780,7 +780,7 @@ public Builder setSessionType(io.evitadb.externalApi.grpc.generated.GrpcSessionT
* @return This builder for chaining.
*/
public Builder clearSessionType() {
-
+
sessionType_ = 0;
onChanged();
return this;
@@ -808,7 +808,7 @@ public Builder clearSessionType() {
* @return This builder for chaining.
*/
public Builder setCommitBehaviourValue(int value) {
-
+
commitBehaviour_ = value;
onChanged();
return this;
@@ -840,7 +840,7 @@ public Builder setCommitBehaviour(io.evitadb.externalApi.grpc.generated.GrpcComm
if (value == null) {
throw new NullPointerException();
}
-
+
commitBehaviour_ = value.getNumber();
onChanged();
return this;
@@ -854,7 +854,7 @@ public Builder setCommitBehaviour(io.evitadb.externalApi.grpc.generated.GrpcComm
* @return This builder for chaining.
*/
public Builder clearCommitBehaviour() {
-
+
commitBehaviour_ = 0;
onChanged();
return this;
@@ -882,7 +882,7 @@ public Builder clearCommitBehaviour() {
* @return This builder for chaining.
*/
public Builder setCatalogStateValue(int value) {
-
+
catalogState_ = value;
onChanged();
return this;
@@ -914,7 +914,7 @@ public Builder setCatalogState(io.evitadb.externalApi.grpc.generated.GrpcCatalog
if (value == null) {
throw new NullPointerException();
}
-
+
catalogState_ = value.getNumber();
onChanged();
return this;
@@ -928,7 +928,7 @@ public Builder setCatalogState(io.evitadb.externalApi.grpc.generated.GrpcCatalog
* @return This builder for chaining.
*/
public Builder clearCatalogState() {
-
+
catalogState_ = 0;
onChanged();
return this;
diff --git a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaSessionResponseOrBuilder.java b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaSessionResponseOrBuilder.java
index e5fb4c9ac..433179ad4 100644
--- a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaSessionResponseOrBuilder.java
+++ b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaSessionResponseOrBuilder.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023-2024
+ * Copyright (c) 2023
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcGoLiveAndCloseResponse.java b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcGoLiveAndCloseResponse.java
index a9b2e3782..95532aac0 100644
--- a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcGoLiveAndCloseResponse.java
+++ b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcGoLiveAndCloseResponse.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023-2024
+ * Copyright (c) 2023
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -495,7 +495,7 @@ public boolean getSuccess() {
* @return This builder for chaining.
*/
public Builder setSuccess(boolean value) {
-
+
success_ = value;
onChanged();
return this;
@@ -509,7 +509,7 @@ public Builder setSuccess(boolean value) {
* @return This builder for chaining.
*/
public Builder clearSuccess() {
-
+
success_ = false;
onChanged();
return this;
@@ -538,7 +538,7 @@ public long getCatalogVersion() {
* @return This builder for chaining.
*/
public Builder setCatalogVersion(long value) {
-
+
catalogVersion_ = value;
onChanged();
return this;
@@ -552,7 +552,7 @@ public Builder setCatalogVersion(long value) {
* @return This builder for chaining.
*/
public Builder clearCatalogVersion() {
-
+
catalogVersion_ = 0L;
onChanged();
return this;
diff --git a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcGoLiveAndCloseResponseOrBuilder.java b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcGoLiveAndCloseResponseOrBuilder.java
index 29bb35755..2e4f99434 100644
--- a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcGoLiveAndCloseResponseOrBuilder.java
+++ b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcGoLiveAndCloseResponseOrBuilder.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023-2024
+ * Copyright (c) 2023
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcHealthProblem.java b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcHealthProblem.java
new file mode 100644
index 000000000..9b85d02fb
--- /dev/null
+++ b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcHealthProblem.java
@@ -0,0 +1,160 @@
+/*
+ *
+ * _ _ ____ ____
+ * _____ _(_) |_ __ _| _ \| __ )
+ * / _ \ \ / / | __/ _` | | | | _ \
+ * | __/\ V /| | || (_| | |_| | |_) |
+ * \___| \_/ |_|\__\__,_|____/|____/
+ *
+ * Copyright (c) 2023
+ *
+ * Licensed under the Business Source License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://github.com/FgForrest/evitaDB/blob/main/LICENSE
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: GrpcEnums.proto
+
+package io.evitadb.externalApi.grpc.generated;
+
+/**
+ *
+ * This enum represents all possible health problems that are monitored by evitaDB.
+ *
+ * Signalized when the consumed memory never goes below 85% of the maximum heap size and the GC tries to free
+ * old generation multiple times consuming a log of CPU power.
+ *
+ * Signalized when the input queues are full and the server is not able to process incoming requests. This flag
+ * is cleared when the server is able to process incoming requests again.
+ *
+ * Signalized when the consumed memory never goes below 85% of the maximum heap size and the GC tries to free
+ * old generation multiple times consuming a log of CPU power.
+ *
+ *
+ * MEMORY_SHORTAGE = 0;
+ */
+ public static final int MEMORY_SHORTAGE_VALUE = 0;
+ /**
+ *
+ * Signalized when the input queues are full and the server is not able to process incoming requests. This flag
+ * is cleared when the server is able to process incoming requests again.
+ *
+ *
+ * INPUT_QUEUES_OVERLOADED = 1;
+ */
+ public static final int INPUT_QUEUES_OVERLOADED_VALUE = 1;
+
+
+ public final int getNumber() {
+ if (this == UNRECOGNIZED) {
+ throw new java.lang.IllegalArgumentException(
+ "Can't get the number of an unknown enum value.");
+ }
+ return value;
+ }
+
+ /**
+ * @param value The numeric wire value of the corresponding enum entry.
+ * @return The enum associated with the given numeric wire value.
+ * @deprecated Use {@link #forNumber(int)} instead.
+ */
+ @java.lang.Deprecated
+ public static GrpcHealthProblem valueOf(int value) {
+ return forNumber(value);
+ }
+
+ /**
+ * @param value The numeric wire value of the corresponding enum entry.
+ * @return The enum associated with the given numeric wire value.
+ */
+ public static GrpcHealthProblem forNumber(int value) {
+ switch (value) {
+ case 0: return MEMORY_SHORTAGE;
+ case 1: return INPUT_QUEUES_OVERLOADED;
+ default: return null;
+ }
+ }
+
+ public static com.google.protobuf.Internal.EnumLiteMap
+ internalGetValueMap() {
+ return internalValueMap;
+ }
+ private static final com.google.protobuf.Internal.EnumLiteMap<
+ GrpcHealthProblem> internalValueMap =
+ new com.google.protobuf.Internal.EnumLiteMap() {
+ public GrpcHealthProblem findValueByNumber(int number) {
+ return GrpcHealthProblem.forNumber(number);
+ }
+ };
+
+ public final com.google.protobuf.Descriptors.EnumValueDescriptor
+ getValueDescriptor() {
+ if (this == UNRECOGNIZED) {
+ throw new java.lang.IllegalStateException(
+ "Can't get the descriptor of an unrecognized enum value.");
+ }
+ return getDescriptor().getValues().get(ordinal());
+ }
+ public final com.google.protobuf.Descriptors.EnumDescriptor
+ getDescriptorForType() {
+ return getDescriptor();
+ }
+ public static final com.google.protobuf.Descriptors.EnumDescriptor
+ getDescriptor() {
+ return io.evitadb.externalApi.grpc.generated.GrpcEnums.getDescriptor().getEnumTypes().get(23);
+ }
+
+ private static final GrpcHealthProblem[] VALUES = values();
+
+ public static GrpcHealthProblem valueOf(
+ com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
+ if (desc.getType() != getDescriptor()) {
+ throw new java.lang.IllegalArgumentException(
+ "EnumValueDescriptor is not for this type.");
+ }
+ if (desc.getIndex() == -1) {
+ return UNRECOGNIZED;
+ }
+ return VALUES[desc.getIndex()];
+ }
+
+ private final int value;
+
+ private GrpcHealthProblem(int value) {
+ this.value = value;
+ }
+
+ // @@protoc_insertion_point(enum_scope:io.evitadb.externalApi.grpc.generated.GrpcHealthProblem)
+}
+
diff --git a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/requestResponse/EvitaEnumConverter.java b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/requestResponse/EvitaEnumConverter.java
index d9091f27e..76d568713 100644
--- a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/requestResponse/EvitaEnumConverter.java
+++ b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/requestResponse/EvitaEnumConverter.java
@@ -46,6 +46,7 @@
import io.evitadb.api.requestResponse.schema.OrderBehaviour;
import io.evitadb.api.requestResponse.schema.dto.AttributeUniquenessType;
import io.evitadb.api.requestResponse.schema.dto.GlobalAttributeUniquenessType;
+import io.evitadb.api.requestResponse.system.SystemStatus.HealthProblem;
import io.evitadb.exception.EvitaInternalError;
import io.evitadb.externalApi.grpc.generated.*;
import lombok.AccessLevel;
@@ -70,8 +71,7 @@ public static CatalogState toCatalogState(@Nonnull GrpcCatalogState grpcCatalogS
return switch (grpcCatalogState.getNumber()) {
case 0 -> CatalogState.WARMING_UP;
case 1 -> CatalogState.ALIVE;
- default ->
- throw new EvitaInternalError("Unrecognized remote catalog state: " + grpcCatalogState);
+ default -> throw new EvitaInternalError("Unrecognized remote catalog state: " + grpcCatalogState);
};
}
@@ -98,8 +98,7 @@ public static QueryPriceMode toQueryPriceMode(@Nonnull GrpcQueryPriceMode grpcQu
return switch (grpcQueryPriceMode.getNumber()) {
case 0 -> QueryPriceMode.WITH_TAX;
case 1 -> QueryPriceMode.WITHOUT_TAX;
- default ->
- throw new EvitaInternalError("Unrecognized remote query price mode: " + grpcQueryPriceMode);
+ default -> throw new EvitaInternalError("Unrecognized remote query price mode: " + grpcQueryPriceMode);
};
}
@@ -130,8 +129,7 @@ public static PriceContentMode toPriceContentMode(@Nonnull GrpcPriceContentMode
case 0 -> PriceContentMode.NONE;
case 1 -> PriceContentMode.RESPECTING_FILTER;
case 2 -> PriceContentMode.ALL;
- default ->
- throw new EvitaInternalError("Unrecognized remote price content mode: " + grpcPriceContentMode);
+ default -> throw new EvitaInternalError("Unrecognized remote price content mode: " + grpcPriceContentMode);
};
}
@@ -162,8 +160,7 @@ public static OrderDirection toOrderDirection(@Nonnull GrpcOrderDirection grpcOr
return switch (grpcOrderDirection.getNumber()) {
case 0 -> OrderDirection.ASC;
case 1 -> OrderDirection.DESC;
- default ->
- throw new EvitaInternalError("Unrecognized remote order direction: " + grpcOrderDirection);
+ default -> throw new EvitaInternalError("Unrecognized remote order direction: " + grpcOrderDirection);
};
}
@@ -193,8 +190,7 @@ public static OrderBehaviour toOrderBehaviour(@Nonnull GrpcOrderBehaviour grpcOr
return switch (grpcOrderBehaviour.getNumber()) {
case 0 -> OrderBehaviour.NULLS_FIRST;
case 1 -> OrderBehaviour.NULLS_LAST;
- default ->
- throw new EvitaInternalError("Unrecognized remote order behaviour: " + grpcOrderBehaviour);
+ default -> throw new EvitaInternalError("Unrecognized remote order behaviour: " + grpcOrderBehaviour);
};
}
@@ -256,8 +252,7 @@ public static StatisticsBase toStatisticsBase(@Nonnull GrpcStatisticsBase grpcSt
return switch (grpcStatisticsBase.getNumber()) {
case 0 -> StatisticsBase.COMPLETE_FILTER;
case 1 -> StatisticsBase.WITHOUT_USER_FILTER;
- default ->
- throw new EvitaInternalError("Unrecognized remote statistics base: " + grpcStatisticsBase);
+ default -> throw new EvitaInternalError("Unrecognized remote statistics base: " + grpcStatisticsBase);
};
}
@@ -287,8 +282,7 @@ public static StatisticsType toStatisticsType(@Nonnull GrpcStatisticsType grpcSt
return switch (grpcStatisticsType.getNumber()) {
case 0 -> StatisticsType.CHILDREN_COUNT;
case 1 -> StatisticsType.QUERIED_ENTITY_COUNT;
- default ->
- throw new EvitaInternalError("Unrecognized remote statistics type: " + grpcStatisticsType);
+ default -> throw new EvitaInternalError("Unrecognized remote statistics type: " + grpcStatisticsType);
};
}
@@ -304,8 +298,7 @@ public static HistogramBehavior toHistogramBehavior(@Nonnull GrpcHistogramBehavi
return switch (grpcHistogramBehavior.getNumber()) {
case 0 -> HistogramBehavior.STANDARD;
case 1 -> HistogramBehavior.OPTIMIZED;
- default ->
- throw new EvitaInternalError("Unrecognized remote histogram behavior: " + grpcHistogramBehavior);
+ default -> throw new EvitaInternalError("Unrecognized remote histogram behavior: " + grpcHistogramBehavior);
};
}
@@ -448,8 +441,7 @@ public static Cardinality toCardinality(@Nonnull GrpcCardinality grpcCardinality
case 2 -> Cardinality.EXACTLY_ONE;
case 3 -> Cardinality.ZERO_OR_MORE;
case 4 -> Cardinality.ONE_OR_MORE;
- default ->
- throw new EvitaInternalError("Unrecognized remote cardinality: " + grpcCardinality);
+ default -> throw new EvitaInternalError("Unrecognized remote cardinality: " + grpcCardinality);
};
}
@@ -483,8 +475,7 @@ public static GrpcCardinality toGrpcCardinality(@Nullable Cardinality cardinalit
public static CatalogEvolutionMode toCatalogEvolutionMode(@Nonnull GrpcCatalogEvolutionMode grpcEvolutionMode) {
return switch (grpcEvolutionMode.getNumber()) {
case 0 -> CatalogEvolutionMode.ADDING_ENTITY_TYPES;
- default ->
- throw new EvitaInternalError("Unrecognized remote evolution mode: " + grpcEvolutionMode);
+ default -> throw new EvitaInternalError("Unrecognized remote evolution mode: " + grpcEvolutionMode);
};
}
@@ -519,8 +510,7 @@ public static EvolutionMode toEvolutionMode(@Nonnull GrpcEvolutionMode grpcEvolu
case 5 -> EvolutionMode.ADDING_LOCALES;
case 6 -> EvolutionMode.ADDING_CURRENCIES;
case 7 -> EvolutionMode.ADDING_HIERARCHY;
- default ->
- throw new EvitaInternalError("Unrecognized remote evolution mode: " + grpcEvolutionMode);
+ default -> throw new EvitaInternalError("Unrecognized remote evolution mode: " + grpcEvolutionMode);
};
}
@@ -575,8 +565,7 @@ public static QueryPhase toQueryPhase(@Nonnull GrpcQueryPhase grpcQueryPhase) {
case 18 -> QueryPhase.FETCHING;
case 19 -> QueryPhase.FETCHING_REFERENCES;
case 20 -> QueryPhase.FETCHING_PARENTS;
- default ->
- throw new EvitaInternalError("Unrecognized remote query phase: " + grpcQueryPhase);
+ default -> throw new EvitaInternalError("Unrecognized remote query phase: " + grpcQueryPhase);
};
}
@@ -599,7 +588,8 @@ public static GrpcQueryPhase toGrpcQueryPhase(@Nonnull QueryPhase queryPhase) {
case PLANNING_SORT -> GrpcQueryPhase.PLANNING_SORT;
case PLANNING_SORT_ALTERNATIVE -> GrpcQueryPhase.PLANNING_SORT_ALTERNATIVE;
case PLANNING_EXTRA_RESULT_FABRICATION -> GrpcQueryPhase.PLANNING_EXTRA_RESULT_FABRICATION;
- case PLANNING_EXTRA_RESULT_FABRICATION_ALTERNATIVE -> GrpcQueryPhase.PLANNING_EXTRA_RESULT_FABRICATION_ALTERNATIVE;
+ case PLANNING_EXTRA_RESULT_FABRICATION_ALTERNATIVE ->
+ GrpcQueryPhase.PLANNING_EXTRA_RESULT_FABRICATION_ALTERNATIVE;
case EXECUTION -> GrpcQueryPhase.EXECUTION;
case EXECUTION_PREFETCH -> GrpcQueryPhase.EXECUTION_PREFETCH;
case EXECUTION_FILTER -> GrpcQueryPhase.EXECUTION_FILTER;
@@ -626,8 +616,7 @@ public static EntityExistence toEntityExistence(@Nonnull GrpcEntityExistence grp
case 0 -> EntityExistence.MAY_EXIST;
case 1 -> EntityExistence.MUST_NOT_EXIST;
case 2 -> EntityExistence.MUST_EXIST;
- default ->
- throw new EvitaInternalError("Unrecognized remote entity existence: " + grpcEntityExistence);
+ default -> throw new EvitaInternalError("Unrecognized remote entity existence: " + grpcEntityExistence);
};
}
@@ -678,8 +667,7 @@ public static AttributeUniquenessType toAttributeUniquenessType(@Nonnull GrpcAtt
case 0 -> AttributeUniquenessType.NOT_UNIQUE;
case 1 -> AttributeUniquenessType.UNIQUE_WITHIN_COLLECTION;
case 2 -> AttributeUniquenessType.UNIQUE_WITHIN_COLLECTION_LOCALE;
- default ->
- throw new EvitaInternalError("Unrecognized remote attribute uniqueness type: " + type);
+ default -> throw new EvitaInternalError("Unrecognized remote attribute uniqueness type: " + type);
};
}
@@ -710,8 +698,7 @@ public static GlobalAttributeUniquenessType toGlobalAttributeUniquenessType(@Non
case 0 -> GlobalAttributeUniquenessType.NOT_UNIQUE;
case 1 -> GlobalAttributeUniquenessType.UNIQUE_WITHIN_CATALOG;
case 2 -> GlobalAttributeUniquenessType.UNIQUE_WITHIN_CATALOG_LOCALE;
- default ->
- throw new EvitaInternalError("Unrecognized remote global attribute uniqueness type: " + type);
+ default -> throw new EvitaInternalError("Unrecognized remote global attribute uniqueness type: " + type);
};
}
@@ -758,8 +745,23 @@ public static CommitBehavior toCommitBehavior(@Nonnull GrpcCommitBehavior commit
case WAIT_FOR_CONFLICT_RESOLUTION -> CommitBehavior.WAIT_FOR_CONFLICT_RESOLUTION;
case WAIT_FOR_LOG_PERSISTENCE -> CommitBehavior.WAIT_FOR_WAL_PERSISTENCE;
case WAIT_FOR_INDEX_PROPAGATION -> CommitBehavior.WAIT_FOR_INDEX_PROPAGATION;
- default ->
- throw new EvitaInternalError("Unrecognized remote commit behavior: " + commitBehaviour);
+ default -> throw new EvitaInternalError("Unrecognized remote commit behavior: " + commitBehaviour);
+ };
+ }
+
+ /**
+ * Converts a GrpcHealthProblem to a HealthProblem.
+ *
+ * @param grpcHealthProblem The GrpcHealthProblem to convert.
+ * @return The converted HealthProblem.
+ * @throws EvitaInternalError if the given grpcHealthProblem is unrecognized.
+ */
+ @Nonnull
+ public static HealthProblem toHealthProblem(@Nonnull GrpcHealthProblem grpcHealthProblem) {
+ return switch (grpcHealthProblem.getNumber()) {
+ case 0 -> HealthProblem.MEMORY_SHORTAGE;
+ case 1 -> HealthProblem.INPUT_QUEUES_OVERLOADED;
+ default -> throw new EvitaInternalError("Unrecognized remote health problem: " + grpcHealthProblem);
};
}
}
diff --git a/evita_external_api/evita_external_api_grpc/shared/src/main/resources/META-INF/io/evitadb/externalApi/grpc/GrpcEnums.proto b/evita_external_api/evita_external_api_grpc/shared/src/main/resources/META-INF/io/evitadb/externalApi/grpc/GrpcEnums.proto
index 96dd40893..86d43fe48 100644
--- a/evita_external_api/evita_external_api_grpc/shared/src/main/resources/META-INF/io/evitadb/externalApi/grpc/GrpcEnums.proto
+++ b/evita_external_api/evita_external_api_grpc/shared/src/main/resources/META-INF/io/evitadb/externalApi/grpc/GrpcEnums.proto
@@ -500,3 +500,15 @@ enum GrpcCommitBehavior {
WAIT_FOR_INDEX_PROPAGATION = 2;
}
+
+// This enum represents all possible health problems that are monitored by evitaDB.
+enum GrpcHealthProblem {
+
+ // Signalized when the consumed memory never goes below 85% of the maximum heap size and the GC tries to free
+ // old generation multiple times consuming a log of CPU power.
+ MEMORY_SHORTAGE = 0;
+ // Signalized when the input queues are full and the server is not able to process incoming requests. This flag
+ // is cleared when the server is able to process incoming requests again.
+ INPUT_QUEUES_OVERLOADED = 1;
+
+}
diff --git a/evita_external_api/evita_external_api_grpc/shared/src/main/resources/META-INF/io/evitadb/externalApi/grpc/GrpcEvitaAPI.proto b/evita_external_api/evita_external_api_grpc/shared/src/main/resources/META-INF/io/evitadb/externalApi/grpc/GrpcEvitaAPI.proto
index 88e9139ab..6f42fe19b 100644
--- a/evita_external_api/evita_external_api_grpc/shared/src/main/resources/META-INF/io/evitadb/externalApi/grpc/GrpcEvitaAPI.proto
+++ b/evita_external_api/evita_external_api_grpc/shared/src/main/resources/META-INF/io/evitadb/externalApi/grpc/GrpcEvitaAPI.proto
@@ -23,6 +23,8 @@ message GrpcEvitaServerStatusResponse {
int32 catalogsCorrupted = 5;
// Number of catalogs that are ok
int32 catalogsOk = 6;
+ // Set of all observed health problems
+ repeated GrpcHealthProblem healthProblems = 7;
}
// Request to create a session inside of a catalog.
@@ -152,4 +154,4 @@ service EvitaService {
rpc DeleteCatalogIfExists(GrpcDeleteCatalogIfExistsRequest) returns (GrpcDeleteCatalogIfExistsResponse);
// Procedure used to update the catalog with a set of mutations.
rpc Update(GrpcUpdateEvitaRequest) returns (google.protobuf.Empty);
-}
\ No newline at end of file
+}
diff --git a/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/metric/MetricHandler.java b/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/metric/MetricHandler.java
index a83774872..082c1310f 100644
--- a/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/metric/MetricHandler.java
+++ b/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/metric/MetricHandler.java
@@ -146,6 +146,10 @@ public void registerHandlers(EnhancedQueueExecutor executor) {
final Set classNames = eventClasses.getValue();
final Set> existingEventClasses = CustomEventProvider.getEventClasses();
+ // jvm_memory_used_bytes{area="heap"}
+ // jvm_memory_max_bytes{area="heap"}
+ // jvm_gc_collection_seconds_sum{gc="G1 Old Generation"}
+
for (Class extends CustomMetricsExecutionEvent> eventClass : existingEventClasses) {
// if event is enabled
if (classNames.contains(eventClass.getName())) {
diff --git a/evita_external_api/evita_external_api_system/src/main/java/io/evitadb/externalApi/system/SystemProviderRegistrar.java b/evita_external_api/evita_external_api_system/src/main/java/io/evitadb/externalApi/system/SystemProviderRegistrar.java
index 9c2a35d98..6157ab3c4 100644
--- a/evita_external_api/evita_external_api_system/src/main/java/io/evitadb/externalApi/system/SystemProviderRegistrar.java
+++ b/evita_external_api/evita_external_api_system/src/main/java/io/evitadb/externalApi/system/SystemProviderRegistrar.java
@@ -59,6 +59,7 @@
public class SystemProviderRegistrar implements ExternalApiProviderRegistrar {
private static final String ENDPOINT_SERVER_NAME = "server-name";
private static final String ENDPOINT_SYSTEM_STATUS = "status";
+ private static final String ENDPOINT_SYSTEM_LIVENESS = "liveness";
@Nonnull
@Override
@@ -119,6 +120,27 @@ public ExternalApiProvider register(@Nonnull Evita evita, @Nonnull
}
);
+ router.addExactPath(
+ "/" + ENDPOINT_SYSTEM_LIVENESS,
+ exchange -> {
+ exchange.getResponseHeaders().put(Headers.CONTENT_TYPE, "application/json");
+ final SystemStatus systemStatus = evita.getSystemStatus();
+ if (systemStatus.healthProblems().isEmpty()) {
+ exchange.setStatusCode(StatusCodes.OK);
+ exchange.getResponseSender().send("{\"status\": \"healthy\"}");
+ } else {
+ exchange.setStatusCode(StatusCodes.INTERNAL_SERVER_ERROR);
+ exchange.getResponseSender().send(
+ "{\"status\": \"unhealthy\", \"problems\": [" +
+ systemStatus.healthProblems().stream()
+ .map(it -> "\"" + it.name() + "\"")
+ .collect(Collectors.joining(", ")) +
+ "]}"
+ );
+ }
+ }
+ );
+
final ResourceHandler fileSystemHandler;
try (ResourceManager resourceManager = new FileResourceManager(file, 100)) {
fileSystemHandler = new ResourceHandler(
@@ -182,7 +204,11 @@ public ExternalApiProvider register(@Nonnull Evita evita, @Nonnull
* @return the JSON string representing the server status
*/
@Nonnull
- private static String renderStatus(@Nonnull String instanceId, @Nonnull SystemStatus systemStatus, ApiOptions apiOptions) {
+ private static String renderStatus(
+ @Nonnull String instanceId,
+ @Nonnull SystemStatus systemStatus,
+ @Nonnull ApiOptions apiOptions
+ ) {
return String.format("""
{
"serverName": "%s",
@@ -192,6 +218,7 @@ private static String renderStatus(@Nonnull String instanceId, @Nonnull SystemSt
"uptimeForHuman": "%s",
"catalogsCorrupted": %d,
"catalogsOk": %d,
+ "healthProblems": [%s],
"apis": [
%s
]
@@ -203,6 +230,9 @@ private static String renderStatus(@Nonnull String instanceId, @Nonnull SystemSt
StringUtils.formatDuration(systemStatus.uptime()),
systemStatus.catalogsCorrupted(),
systemStatus.catalogsOk(),
+ systemStatus.healthProblems().stream()
+ .map(it -> "\"" + it.name() + "\"")
+ .collect(Collectors.joining(", ")),
apiOptions.endpoints().entrySet().stream()
.map(
entry -> " {\n \"" + entry.getKey() + "\": [\n" +
From 24fce4f8f0f04b6cca7a7230dd884867f298b2ae Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20Novotn=C3=BD?=
Date: Fri, 3 May 2024 13:57:10 +0200
Subject: [PATCH 04/24] fix(#550): Provide health check for Docker image
Readiness probe implemented and tested.
---
evita_common/pom.xml | 5 +
.../java/io/evitadb/utils/NetworkUtils.java | 164 +++++++++++++++++
evita_common/src/main/java/module-info.java | 1 +
.../externalApi/http/ExternalApiProvider.java | 9 +
.../http/ExternalApiProviderRegistrar.java | 65 ++++---
.../externalApi/http/ExternalApiServer.java | 9 +-
.../externalApi/graphql/GraphQLManager.java | 3 +-
.../externalApi/graphql/GraphQLProvider.java | 32 ++++
.../graphql/GraphQLProviderRegistrar.java | 3 +-
.../externalApi/grpc/GrpcProvider.java | 30 ++++
.../grpc/GrpcProviderRegistrar.java | 3 +-
.../evitadb/externalApi/lab/LabProvider.java | 26 +++
.../externalApi/lab/LabProviderRegistrar.java | 3 +-
.../observability/ObservabilityManager.java | 8 +-
.../observability/ObservabilityProvider.java | 30 ++++
.../ObservabilityProviderRegistrar.java | 3 +-
.../externalApi/rest/RestProvider.java | 30 ++++
.../rest/RestProviderRegistrar.java | 3 +-
.../api/system/model/LivenessDescriptor.java | 4 +-
.../externalApi/system/SystemProvider.java | 22 +++
.../system/SystemProviderRegistrar.java | 166 ++++++++++++------
.../io/evitadb/server/EvitaServerTest.java | 82 ++++++++-
evita_server/pom.xml | 5 +
pom.xml | 5 +
24 files changed, 613 insertions(+), 98 deletions(-)
diff --git a/evita_common/pom.xml b/evita_common/pom.xml
index 6a9cf3c1d..96cfbc1e7 100644
--- a/evita_common/pom.xml
+++ b/evita_common/pom.xml
@@ -59,6 +59,11 @@
net.openhftzero-allocation-hashing
+
+ com.squareup.okhttp3
+ okhttp
+ true
+
diff --git a/evita_common/src/main/java/io/evitadb/utils/NetworkUtils.java b/evita_common/src/main/java/io/evitadb/utils/NetworkUtils.java
index 2aa524618..cdae693a8 100644
--- a/evita_common/src/main/java/io/evitadb/utils/NetworkUtils.java
+++ b/evita_common/src/main/java/io/evitadb/utils/NetworkUtils.java
@@ -23,9 +23,33 @@
package io.evitadb.utils;
+import lombok.NoArgsConstructor;
+import okhttp3.ConnectionPool;
+import okhttp3.Headers;
+import okhttp3.HttpUrl;
+import okhttp3.MediaType;
+import okhttp3.OkHttpClient;
+import okhttp3.Protocol;
+import okhttp3.Request;
+import okhttp3.Request.Builder;
+import okhttp3.RequestBody;
+import okhttp3.Response;
+
import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.X509TrustManager;
+import java.io.IOException;
import java.net.InetAddress;
import java.net.UnknownHostException;
+import java.security.KeyManagementException;
+import java.security.NoSuchAlgorithmException;
+import java.security.cert.X509Certificate;
+import java.util.Arrays;
+import java.util.Optional;
+import java.util.OptionalInt;
+import java.util.concurrent.TimeUnit;
/**
* Utility class for network related operations.
@@ -33,6 +57,7 @@
* @author Jan Novotný (novotny@fg.cz), FG Forrest a.s. (c) 2023
*/
public class NetworkUtils {
+ private static OkHttpClient HTTP_CLIENT;
/**
* Returns human comprehensible host name of the given host.
@@ -63,4 +88,143 @@ public static String getLocalHostName() {
}
}
+ /**
+ * Returns true if the URL is reachable and returns some content
+ *
+ * @param url URL to check
+ * @return true if the URL is reachable and returns some content
+ */
+ public static boolean isReachable(@Nonnull String url) {
+ try {
+ try (
+ final Response response = getHttpClient().newCall(
+ new Builder()
+ .url(url)
+ .get()
+ .build()
+ ).execute()
+ ) {
+ return response.code() < 500;
+ }
+ } catch (IOException e) {
+ return false;
+ }
+ }
+
+ /**
+ * Returns content of the URL if it is reachable and returns some content.
+ *
+ * @param url URL to check
+ * @param method HTTP method to use
+ * @param contentType content type to use
+ * @param body body to send
+ * @return the content of the URL as a string or empty optional if the URL is not reachable or
+ * does not return any content
+ */
+ @Nonnull
+ public static Optional fetchContent(
+ @Nonnull String url,
+ @Nullable String method,
+ @Nonnull String contentType,
+ @Nullable String body
+ ) {
+ try {
+ final RequestBody requestBody = Optional.ofNullable(body)
+ .map(theBody -> RequestBody.create(theBody, MediaType.parse(contentType)))
+ .orElse(null);
+ try (
+ final Response response = getHttpClient().newCall(
+ new Request(
+ HttpUrl.parse(url),
+ Headers.of("Content-Type", contentType),
+ method != null ? method : "GET",
+ requestBody
+ )
+ ).execute()
+ ) {
+ return Optional.of(response.body().string());
+ }
+ } catch (IOException e) {
+ return Optional.empty();
+ }
+ }
+
+ /**
+ * Returns HTTP status code of the URL if it is reachable and returns some content.
+ *
+ * @param url URL to check
+ * @param method HTTP method to use
+ * @param contentType content type to use
+ * @return the HTTP status code of the URL or empty optional if the URL is not reachable
+ */
+ @Nonnull
+ public static OptionalInt getHttpStatusCode(
+ @Nonnull String url,
+ @Nullable String method,
+ @Nonnull String contentType
+ ) {
+ try {
+ try (
+ final Response response = getHttpClient().newCall(
+ new Builder()
+ .url(url)
+ .addHeader("Content-Type", contentType)
+ .method(method != null ? method : "GET", null)
+ .build()
+ ).execute()
+ ) {
+ return OptionalInt.of(response.code());
+ }
+ } catch (IOException e) {
+ return OptionalInt.empty();
+ }
+ }
+
+ /**
+ * Returns the cached HTTP client instance. Instance has low timeouts and trusts all certificates, it doesn't reuse
+ * connections.
+ *
+ * @return the HTTP client instance
+ */
+ @Nonnull
+ private static OkHttpClient getHttpClient() {
+ if (HTTP_CLIENT == null) {
+ try {
+ // Get a new SSL context
+ final SSLContext sc = SSLContext.getInstance("TLSv1.3");
+ sc.init(null, new TrustManager[]{TrustAllX509TrustManager.INSTANCE}, new java.security.SecureRandom());
+
+ HTTP_CLIENT = new OkHttpClient.Builder()
+ .sslSocketFactory(sc.getSocketFactory(), TrustAllX509TrustManager.INSTANCE)
+ .protocols(Arrays.asList(Protocol.HTTP_1_1, Protocol.HTTP_2))
+ .readTimeout(500, TimeUnit.MILLISECONDS)
+ .callTimeout(500, TimeUnit.MILLISECONDS)
+ .connectionPool(new ConnectionPool(0, 1, TimeUnit.MILLISECONDS))
+ .build();
+ } catch (NoSuchAlgorithmException | KeyManagementException e) {
+ throw new IllegalStateException("Failed to create HTTP client", e);
+ }
+ }
+ return HTTP_CLIENT;
+ }
+
+ /**
+ * This trust manager is meant to be used only by this class to enable trust of all certificates. It's unsafe so
+ * it should be used only for fetching the data from local HTTP servers that are in the same network (trusted zone).
+ */
+ @NoArgsConstructor(access = lombok.AccessLevel.PRIVATE)
+ private static class TrustAllX509TrustManager implements X509TrustManager {
+ public static final TrustAllX509TrustManager INSTANCE = new TrustAllX509TrustManager();
+
+ public void checkClientTrusted(X509Certificate[] certs, String authType) {
+ }
+
+ public void checkServerTrusted(X509Certificate[] certs, String authType) {
+ }
+
+ public X509Certificate[] getAcceptedIssuers() {
+ return new X509Certificate[0];
+ }
+
+ }
}
diff --git a/evita_common/src/main/java/module-info.java b/evita_common/src/main/java/module-info.java
index f506def22..118d6419e 100644
--- a/evita_common/src/main/java/module-info.java
+++ b/evita_common/src/main/java/module-info.java
@@ -21,5 +21,6 @@
requires static lombok;
requires com.fasterxml.jackson.databind;
requires zero.allocation.hashing;
+ requires okhttp3;
}
diff --git a/evita_external_api/evita_external_api_core/src/main/java/io/evitadb/externalApi/http/ExternalApiProvider.java b/evita_external_api/evita_external_api_core/src/main/java/io/evitadb/externalApi/http/ExternalApiProvider.java
index cbf6d0773..0151b7e27 100644
--- a/evita_external_api/evita_external_api_core/src/main/java/io/evitadb/externalApi/http/ExternalApiProvider.java
+++ b/evita_external_api/evita_external_api_core/src/main/java/io/evitadb/externalApi/http/ExternalApiProvider.java
@@ -79,4 +79,13 @@ default void afterStart() {
default void beforeStop() {
// do nothing
}
+
+ /**
+ * Returns TRUE if the API is ready to accept requests. This method should physically test an API call to determine
+ * the API responds to the requests.
+ *
+ * @return TRUE if the API is ready to accept requests
+ */
+ boolean isReady();
+
}
diff --git a/evita_external_api/evita_external_api_core/src/main/java/io/evitadb/externalApi/http/ExternalApiProviderRegistrar.java b/evita_external_api/evita_external_api_core/src/main/java/io/evitadb/externalApi/http/ExternalApiProviderRegistrar.java
index de15b017d..1289db30c 100644
--- a/evita_external_api/evita_external_api_core/src/main/java/io/evitadb/externalApi/http/ExternalApiProviderRegistrar.java
+++ b/evita_external_api/evita_external_api_core/src/main/java/io/evitadb/externalApi/http/ExternalApiProviderRegistrar.java
@@ -31,7 +31,7 @@
/**
* Configures and registers provider of particular external API to HTTP server ({@link ExternalApiServer}).
- * Each provider have to have unique code and have to implement {@link #register(Evita, ApiOptions, T)}
+ * Each provider have to have unique code and have to implement {@link #register(Evita, ExternalApiServer, ApiOptions, AbstractApiConfiguration)}
* method which registers provider to the server to be later started by the server.
*
* It is based on {@link java.util.ServiceLoader} which requires appropriate registration of implementation of this interface.
@@ -40,35 +40,42 @@
*/
public interface ExternalApiProviderRegistrar {
- /**
- * Returns unique identification code of the API registrar.
- *
- * @return same code as linked {@link ExternalApiProvider#getCode()}
- */
- @Nonnull
- String getExternalApiCode();
+ /**
+ * Returns unique identification code of the API registrar.
+ *
+ * @return same code as linked {@link ExternalApiProvider#getCode()}
+ */
+ @Nonnull
+ String getExternalApiCode();
- /**
- * Returns configuration initialized with default values for this external API.
- *
- * @return configuration object instance with sane default values
- */
- @Nonnull
- Class getConfigurationClass();
+ /**
+ * Returns configuration initialized with default values for this external API.
+ *
+ * @return configuration object instance with sane default values
+ */
+ @Nonnull
+ Class getConfigurationClass();
- /**
- * @return order of the API provider. Providers with lower order are registered first.
- */
- default int getOrder() {
- return 0;
- }
+ /**
+ * @return order of the API provider. Providers with lower order are registered first.
+ */
+ default int getOrder() {
+ return 0;
+ }
- /**
- * Configures and registers this provider
- *
- * @param evita ready-to-use Evita with access to internal data structures
- * @param externalApiConfiguration configuration parameters for this provider (structure is defined by provider itself)
- */
- @Nonnull
- ExternalApiProvider register(@Nonnull Evita evita, @Nonnull ApiOptions apiOptions, @Nonnull T externalApiConfiguration);
+ /**
+ * Configures and registers this provider
+ *
+ * @param evita ready-to-use Evita with access to internal data structures
+ * @param externalApiServer the server the created provider will be registered to (not serving yet)
+ * @param apiOptions options for this provider
+ * @param externalApiConfiguration configuration parameters for this provider (structure is defined by provider itself)
+ */
+ @Nonnull
+ ExternalApiProvider register(
+ @Nonnull Evita evita,
+ @Nonnull ExternalApiServer externalApiServer,
+ @Nonnull ApiOptions apiOptions,
+ @Nonnull T externalApiConfiguration
+ );
}
diff --git a/evita_external_api/evita_external_api_core/src/main/java/io/evitadb/externalApi/http/ExternalApiServer.java b/evita_external_api/evita_external_api_core/src/main/java/io/evitadb/externalApi/http/ExternalApiServer.java
index a3d89e56c..46688cfce 100644
--- a/evita_external_api/evita_external_api_core/src/main/java/io/evitadb/externalApi/http/ExternalApiServer.java
+++ b/evita_external_api/evita_external_api_core/src/main/java/io/evitadb/externalApi/http/ExternalApiServer.java
@@ -48,7 +48,6 @@
import io.undertow.server.handlers.PathHandler;
import io.undertow.server.handlers.accesslog.AccessLogHandler;
import io.undertow.server.handlers.accesslog.AccessLogReceiver;
-import io.undertow.server.handlers.accesslog.DefaultAccessLogReceiver;
import io.undertow.server.handlers.encoding.ContentEncodingRepository;
import io.undertow.server.handlers.encoding.DeflateEncodingProvider;
import io.undertow.server.handlers.encoding.EncodingHandler;
@@ -283,9 +282,11 @@ private static KeyManagerFactory createKeyManagerFactory(
/**
* Registers API providers based on configuration and returns its references.
*/
+ @Nonnull
@SuppressWarnings("unchecked")
private static Map> registerApiProviders(
- @Nonnull Evita evitaSystemDataProvider,
+ @Nonnull Evita evita,
+ @Nonnull ExternalApiServer externalApiServer,
@Nonnull ApiOptions apiOptions,
@SuppressWarnings("rawtypes") @Nonnull Collection externalApiProviders
) {
@@ -299,7 +300,7 @@ private static Map> registerApiProviders(
}
//noinspection unchecked
- return registrar.register(evitaSystemDataProvider, apiOptions, apiProviderConfiguration);
+ return registrar.register(evita, externalApiServer, apiOptions, apiProviderConfiguration);
})
.filter(Objects::nonNull)
.collect(
@@ -335,7 +336,7 @@ public ExternalApiServer(
final ServerCertificateManager serverCertificateManager = new ServerCertificateManager(apiOptions.certificate());
final CertificatePath certificatePath = initCertificate(apiOptions, serverCertificateManager);
- this.registeredApiProviders = registerApiProviders(evita, apiOptions, externalApiProviders);
+ this.registeredApiProviders = registerApiProviders(evita, this, apiOptions, externalApiProviders);
if (this.registeredApiProviders.isEmpty()) {
log.info("No external API providers were registered. No server will be created.");
rootServer = null;
diff --git a/evita_external_api/evita_external_api_graphql/src/main/java/io/evitadb/externalApi/graphql/GraphQLManager.java b/evita_external_api/evita_external_api_graphql/src/main/java/io/evitadb/externalApi/graphql/GraphQLManager.java
index 696f52b2b..e38827c99 100644
--- a/evita_external_api/evita_external_api_graphql/src/main/java/io/evitadb/externalApi/graphql/GraphQLManager.java
+++ b/evita_external_api/evita_external_api_graphql/src/main/java/io/evitadb/externalApi/graphql/GraphQLManager.java
@@ -69,6 +69,7 @@
@Slf4j
public class GraphQLManager {
+ public static final String SYSTEM_API_PREFIX = "system";
/**
* Common object mapper for endpoints
*/
@@ -206,7 +207,7 @@ public void unregisterCatalog(@Nonnull String catalogName) {
*/
private void registerSystemApi() {
registerGraphQLEndpoint(new RegisteredGraphQLApi(
- UriPath.of("/", "system"),
+ UriPath.of("/", SYSTEM_API_PREFIX),
new AtomicReference<>(new SystemGraphQLBuilder(evita).build(graphQLConfig))
));
}
diff --git a/evita_external_api/evita_external_api_graphql/src/main/java/io/evitadb/externalApi/graphql/GraphQLProvider.java b/evita_external_api/evita_external_api_graphql/src/main/java/io/evitadb/externalApi/graphql/GraphQLProvider.java
index 8203980d4..fcef5ed96 100644
--- a/evita_external_api/evita_external_api_graphql/src/main/java/io/evitadb/externalApi/graphql/GraphQLProvider.java
+++ b/evita_external_api/evita_external_api_graphql/src/main/java/io/evitadb/externalApi/graphql/GraphQLProvider.java
@@ -25,11 +25,16 @@
import io.evitadb.externalApi.graphql.configuration.GraphQLConfig;
import io.evitadb.externalApi.http.ExternalApiProvider;
+import io.evitadb.utils.NetworkUtils;
import io.undertow.server.HttpHandler;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import javax.annotation.Nonnull;
+import java.util.Optional;
+import java.util.function.Predicate;
+
+import static io.evitadb.externalApi.graphql.GraphQLManager.SYSTEM_API_PREFIX;
/**
* Descriptor of external API provider that provides GraphQL API.
@@ -50,9 +55,36 @@ public class GraphQLProvider implements ExternalApiProvider {
@Getter
private final HttpHandler apiHandler;
+ /**
+ * Contains url that was at least once found reachable.
+ */
+ private String reachableUrl;
+
@Nonnull
@Override
public String getCode() {
return CODE;
}
+
+ @Override
+ public boolean isReady() {
+ final Predicate isReady = url -> {
+ final Optional post = NetworkUtils.fetchContent(url, "POST", "application/json", "{\"query\":\"{liveness}\"}");
+ return post.map(content -> content.contains("true")).orElse(false);
+ };
+ final String[] baseUrls = this.configuration.getBaseUrls(configuration.getExposedHost());
+ if (this.reachableUrl == null) {
+ for (String baseUrl : baseUrls) {
+ final String url = baseUrl + SYSTEM_API_PREFIX;
+ if (isReady.test(url)) {
+ this.reachableUrl = url;
+ return true;
+ }
+ }
+ return false;
+ } else {
+ return isReady.test(this.reachableUrl);
+ }
+ }
+
}
diff --git a/evita_external_api/evita_external_api_graphql/src/main/java/io/evitadb/externalApi/graphql/GraphQLProviderRegistrar.java b/evita_external_api/evita_external_api_graphql/src/main/java/io/evitadb/externalApi/graphql/GraphQLProviderRegistrar.java
index 79eee946e..ac5e8c66f 100644
--- a/evita_external_api/evita_external_api_graphql/src/main/java/io/evitadb/externalApi/graphql/GraphQLProviderRegistrar.java
+++ b/evita_external_api/evita_external_api_graphql/src/main/java/io/evitadb/externalApi/graphql/GraphQLProviderRegistrar.java
@@ -29,6 +29,7 @@
import io.evitadb.externalApi.graphql.configuration.GraphQLConfig;
import io.evitadb.externalApi.http.ExternalApiProvider;
import io.evitadb.externalApi.http.ExternalApiProviderRegistrar;
+import io.evitadb.externalApi.http.ExternalApiServer;
import io.undertow.server.HttpHandler;
import javax.annotation.Nonnull;
@@ -55,7 +56,7 @@ public Class getConfigurationClass() {
@Nonnull
@Override
- public ExternalApiProvider register(@Nonnull Evita evita, @Nonnull ApiOptions apiOptions, @Nonnull GraphQLConfig graphQLConfig) {
+ public ExternalApiProvider register(@Nonnull Evita evita, @Nonnull ExternalApiServer externalApiServer, @Nonnull ApiOptions apiOptions, @Nonnull GraphQLConfig graphQLConfig) {
final GraphQLManager graphQLManager = new GraphQLManager(evita, graphQLConfig);
evita.registerStructuralChangeObserver(new CatalogGraphQLRefreshingObserver(graphQLManager));
final HttpHandler apiHandler = graphQLManager.getGraphQLRouter();
diff --git a/evita_external_api/evita_external_api_grpc/server/src/main/java/io/evitadb/externalApi/grpc/GrpcProvider.java b/evita_external_api/evita_external_api_grpc/server/src/main/java/io/evitadb/externalApi/grpc/GrpcProvider.java
index d9b09a4b1..fa37c0864 100644
--- a/evita_external_api/evita_external_api_grpc/server/src/main/java/io/evitadb/externalApi/grpc/GrpcProvider.java
+++ b/evita_external_api/evita_external_api_grpc/server/src/main/java/io/evitadb/externalApi/grpc/GrpcProvider.java
@@ -26,12 +26,14 @@
import io.evitadb.externalApi.grpc.configuration.GrpcConfig;
import io.evitadb.externalApi.grpc.exception.GrpcServerStartFailedException;
import io.evitadb.externalApi.http.ExternalApiProvider;
+import io.evitadb.utils.NetworkUtils;
import io.grpc.Server;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import javax.annotation.Nonnull;
import java.io.IOException;
+import java.util.function.Predicate;
/**
* Descriptor of external API provider that provides gRPC API.
@@ -51,6 +53,11 @@ public class GrpcProvider implements ExternalApiProvider {
@Getter
private final Server server;
+ /**
+ * Contains url that was at least once found reachable.
+ */
+ private String reachableUrl;
+
@Nonnull
@Override
public String getCode() {
@@ -79,4 +86,27 @@ public void afterStart() {
public void beforeStop() {
server.shutdown();
}
+
+ @Override
+ public boolean isReady() {
+ final Predicate isReady = url -> {
+ final int responseCode = NetworkUtils.getHttpStatusCode(url, "GET", "application/grpc")
+ .orElse(-1);
+ // we are interested in 405 Method Not Allowed which signals gRPC server is running
+ return responseCode == 405;
+ };
+ final String[] baseUrls = this.configuration.getBaseUrls(configuration.getExposedHost());
+ if (this.reachableUrl == null) {
+ for (String baseUrl : baseUrls) {
+ if (isReady.test(baseUrl)) {
+ this.reachableUrl = baseUrl;
+ return true;
+ }
+ }
+ return false;
+ } else {
+ return isReady.test(this.reachableUrl);
+ }
+ }
+
}
diff --git a/evita_external_api/evita_external_api_grpc/server/src/main/java/io/evitadb/externalApi/grpc/GrpcProviderRegistrar.java b/evita_external_api/evita_external_api_grpc/server/src/main/java/io/evitadb/externalApi/grpc/GrpcProviderRegistrar.java
index 5e0f36dc8..75d5e3e05 100644
--- a/evita_external_api/evita_external_api_grpc/server/src/main/java/io/evitadb/externalApi/grpc/GrpcProviderRegistrar.java
+++ b/evita_external_api/evita_external_api_grpc/server/src/main/java/io/evitadb/externalApi/grpc/GrpcProviderRegistrar.java
@@ -29,6 +29,7 @@
import io.evitadb.externalApi.grpc.utils.GrpcServer;
import io.evitadb.externalApi.http.ExternalApiProvider;
import io.evitadb.externalApi.http.ExternalApiProviderRegistrar;
+import io.evitadb.externalApi.http.ExternalApiServer;
import io.grpc.Server;
import javax.annotation.Nonnull;
@@ -54,7 +55,7 @@ public Class getConfigurationClass() {
@Nonnull
@Override
- public ExternalApiProvider register(@Nonnull Evita evita, @Nonnull ApiOptions apiOptions, @Nonnull GrpcConfig grpcAPIConfig) {
+ public ExternalApiProvider register(@Nonnull Evita evita, @Nonnull ExternalApiServer externalApiServer, @Nonnull ApiOptions apiOptions, @Nonnull GrpcConfig grpcAPIConfig) {
final Server server = new GrpcServer(evita, apiOptions, grpcAPIConfig).getServer();
return new GrpcProvider(grpcAPIConfig, server);
}
diff --git a/evita_external_api/evita_external_api_lab/src/main/java/io/evitadb/externalApi/lab/LabProvider.java b/evita_external_api/evita_external_api_lab/src/main/java/io/evitadb/externalApi/lab/LabProvider.java
index a68c29f5a..3e9c860d0 100644
--- a/evita_external_api/evita_external_api_lab/src/main/java/io/evitadb/externalApi/lab/LabProvider.java
+++ b/evita_external_api/evita_external_api_lab/src/main/java/io/evitadb/externalApi/lab/LabProvider.java
@@ -25,11 +25,13 @@
import io.evitadb.externalApi.http.ExternalApiProvider;
import io.evitadb.externalApi.lab.configuration.LabConfig;
+import io.evitadb.utils.NetworkUtils;
import io.undertow.server.HttpHandler;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import javax.annotation.Nonnull;
+import java.util.function.Predicate;
/**
* Descriptor of provider of lab API and GUI.
@@ -49,10 +51,34 @@ public class LabProvider implements ExternalApiProvider {
@Getter
private final HttpHandler apiHandler;
+ /**
+ * Contains url that was at least once found reachable.
+ */
+ private String reachableUrl;
+
@Nonnull
@Override
public String getCode() {
return CODE;
}
+ @Override
+ public boolean isReady() {
+ final Predicate isReady = url -> NetworkUtils.fetchContent(url, null, "text/html", null)
+ .map(content -> content.contains("https://github.com/FgForrest/evitaDB/blob/main/LICENSE"))
+ .orElse(false);
+ final String[] baseUrls = this.configuration.getBaseUrls(configuration.getExposedHost());
+ if (this.reachableUrl == null) {
+ for (String baseUrl : baseUrls) {
+ if (isReady.test(baseUrl)) {
+ this.reachableUrl = baseUrl;
+ return true;
+ }
+ }
+ return false;
+ } else {
+ return isReady.test(this.reachableUrl);
+ }
+ }
+
}
diff --git a/evita_external_api/evita_external_api_lab/src/main/java/io/evitadb/externalApi/lab/LabProviderRegistrar.java b/evita_external_api/evita_external_api_lab/src/main/java/io/evitadb/externalApi/lab/LabProviderRegistrar.java
index 40757e33f..31d6eb5c4 100644
--- a/evita_external_api/evita_external_api_lab/src/main/java/io/evitadb/externalApi/lab/LabProviderRegistrar.java
+++ b/evita_external_api/evita_external_api_lab/src/main/java/io/evitadb/externalApi/lab/LabProviderRegistrar.java
@@ -27,6 +27,7 @@
import io.evitadb.externalApi.configuration.ApiOptions;
import io.evitadb.externalApi.http.ExternalApiProvider;
import io.evitadb.externalApi.http.ExternalApiProviderRegistrar;
+import io.evitadb.externalApi.http.ExternalApiServer;
import io.evitadb.externalApi.lab.configuration.LabConfig;
import io.undertow.server.HttpHandler;
@@ -54,7 +55,7 @@ public Class getConfigurationClass() {
@Nonnull
@Override
- public ExternalApiProvider register(@Nonnull Evita evita, @Nonnull ApiOptions apiOptions, @Nonnull LabConfig labConfig) {
+ public ExternalApiProvider register(@Nonnull Evita evita, @Nonnull ExternalApiServer externalApiServer, @Nonnull ApiOptions apiOptions, @Nonnull LabConfig labConfig) {
final LabManager labManager = new LabManager(evita, apiOptions, labConfig);
final HttpHandler apiHandler = labManager.getLabRouter();
return new LabProvider(labConfig, apiHandler);
diff --git a/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/ObservabilityManager.java b/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/ObservabilityManager.java
index 75bb8164a..849ce46cd 100644
--- a/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/ObservabilityManager.java
+++ b/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/ObservabilityManager.java
@@ -79,6 +79,8 @@
* @author Tomáš Pozler, FG Forrest a.s. (c) 2024
*/
public class ObservabilityManager {
+ public static final String METRICS_SUFFIX = "metrics";
+ public static final String METRICS_PATH = "/observability/" + METRICS_SUFFIX;
/**
* JFR recording instance.
*/
@@ -217,8 +219,8 @@ public HttpHandler getObservabilityRouter() {
private void createAndRegisterPrometheusServlet() {
final DeploymentInfo servletBuilder = Servlets.deployment()
.setClassLoader(Undertow.class.getClassLoader())
- .setDeploymentName("metrics-deployment")
- .setContextPath("/observability/metrics")
+ .setDeploymentName(METRICS_SUFFIX + "-deployment")
+ .setContextPath(METRICS_PATH)
.addServlets(
Servlets.servlet("MetricsServlet", PrometheusMetricsServlet.class).addMapping("/*")
);
@@ -227,7 +229,7 @@ private void createAndRegisterPrometheusServlet() {
servletDeploymentManager.deploy();
try {
- observabilityRouter.addPrefixPath("/metrics", servletDeploymentManager.start());
+ observabilityRouter.addPrefixPath("/" + METRICS_SUFFIX, servletDeploymentManager.start());
} catch (ServletException e) {
throw new EvitaInternalError("Unable to add routing to Prometheus scraping servlet.");
}
diff --git a/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/ObservabilityProvider.java b/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/ObservabilityProvider.java
index 35a1f27e6..b9a04916c 100644
--- a/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/ObservabilityProvider.java
+++ b/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/ObservabilityProvider.java
@@ -25,11 +25,15 @@
import io.evitadb.externalApi.http.ExternalApiProvider;
import io.evitadb.externalApi.observability.configuration.ObservabilityConfig;
+import io.evitadb.utils.NetworkUtils;
import io.undertow.server.HttpHandler;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import javax.annotation.Nonnull;
+import java.util.function.Predicate;
+
+import static io.evitadb.externalApi.observability.ObservabilityManager.METRICS_SUFFIX;
/**
* Descriptor of external API provider that provides Metrics API.
@@ -53,9 +57,35 @@ public class ObservabilityProvider implements ExternalApiProvider isReady = url -> NetworkUtils.fetchContent(url, "GET", "text/plain", null)
+ .map(content -> !content.isEmpty())
+ .orElse(false);
+ final String[] baseUrls = this.configuration.getBaseUrls(configuration.getExposedHost());
+ if (this.reachableUrl == null) {
+ for (String baseUrl : baseUrls) {
+ final String url = baseUrl + METRICS_SUFFIX;
+ if (isReady.test(url)) {
+ this.reachableUrl = url;
+ return true;
+ }
+ }
+ return false;
+ } else {
+ return isReady.test(this.reachableUrl);
+ }
+ }
+
}
diff --git a/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/ObservabilityProviderRegistrar.java b/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/ObservabilityProviderRegistrar.java
index 1b67ce812..d9e40eff0 100644
--- a/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/ObservabilityProviderRegistrar.java
+++ b/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/ObservabilityProviderRegistrar.java
@@ -27,6 +27,7 @@
import io.evitadb.externalApi.configuration.ApiOptions;
import io.evitadb.externalApi.http.ExternalApiProvider;
import io.evitadb.externalApi.http.ExternalApiProviderRegistrar;
+import io.evitadb.externalApi.http.ExternalApiServer;
import io.evitadb.externalApi.observability.configuration.ObservabilityConfig;
import io.evitadb.externalApi.observability.configuration.TracingConfig;
import io.evitadb.externalApi.observability.trace.OpenTelemetryTracerSetup;
@@ -62,7 +63,7 @@ public int getOrder() {
@Nonnull
@Override
- public ExternalApiProvider register(@Nonnull Evita evita, @Nonnull ApiOptions apiOptions, @Nonnull ObservabilityConfig observabilityConfig) {
+ public ExternalApiProvider register(@Nonnull Evita evita, @Nonnull ExternalApiServer externalApiServer, @Nonnull ApiOptions apiOptions, @Nonnull ObservabilityConfig observabilityConfig) {
final ObservabilityManager observabilityManager = new ObservabilityManager(observabilityConfig, apiOptions, evita);
final TracingConfig tracingConfig = observabilityConfig.getTracing();
if (tracingConfig != null && tracingConfig.getEndpoint() != null) {
diff --git a/evita_external_api/evita_external_api_rest/src/main/java/io/evitadb/externalApi/rest/RestProvider.java b/evita_external_api/evita_external_api_rest/src/main/java/io/evitadb/externalApi/rest/RestProvider.java
index f6d030616..b5cf1d4cc 100644
--- a/evita_external_api/evita_external_api_rest/src/main/java/io/evitadb/externalApi/rest/RestProvider.java
+++ b/evita_external_api/evita_external_api_rest/src/main/java/io/evitadb/externalApi/rest/RestProvider.java
@@ -24,12 +24,16 @@
package io.evitadb.externalApi.rest;
import io.evitadb.externalApi.http.ExternalApiProvider;
+import io.evitadb.externalApi.rest.api.openApi.OpenApiSystemEndpoint;
+import io.evitadb.externalApi.rest.api.system.model.LivenessDescriptor;
import io.evitadb.externalApi.rest.configuration.RestConfig;
+import io.evitadb.utils.NetworkUtils;
import io.undertow.server.HttpHandler;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import javax.annotation.Nonnull;
+import java.util.function.Predicate;
/**
* Descriptor of external API provider that provides REST API.
@@ -49,9 +53,35 @@ public class RestProvider implements ExternalApiProvider {
@Getter
private final HttpHandler apiHandler;
+ /**
+ * Contains url that was at least once found reachable.
+ */
+ private String reachableUrl;
+
@Nonnull
@Override
public String getCode() {
return CODE;
}
+
+ @Override
+ public boolean isReady() {
+ final Predicate isReady = url -> NetworkUtils.fetchContent(url, "GET", "application/json", null)
+ .map(content -> content.contains("true"))
+ .orElse(false);
+ final String[] baseUrls = this.configuration.getBaseUrls(configuration.getExposedHost());
+ if (this.reachableUrl == null) {
+ for (String baseUrl : baseUrls) {
+ final String url = baseUrl + OpenApiSystemEndpoint.URL_PREFIX + "/" + LivenessDescriptor.LIVENESS_SUFFIX;
+ if (isReady.test(url)) {
+ this.reachableUrl = url;
+ return true;
+ }
+ }
+ return false;
+ } else {
+ return isReady.test(this.reachableUrl);
+ }
+ }
+
}
diff --git a/evita_external_api/evita_external_api_rest/src/main/java/io/evitadb/externalApi/rest/RestProviderRegistrar.java b/evita_external_api/evita_external_api_rest/src/main/java/io/evitadb/externalApi/rest/RestProviderRegistrar.java
index fee09c30b..127c80138 100644
--- a/evita_external_api/evita_external_api_rest/src/main/java/io/evitadb/externalApi/rest/RestProviderRegistrar.java
+++ b/evita_external_api/evita_external_api_rest/src/main/java/io/evitadb/externalApi/rest/RestProviderRegistrar.java
@@ -27,6 +27,7 @@
import io.evitadb.externalApi.configuration.ApiOptions;
import io.evitadb.externalApi.http.ExternalApiProvider;
import io.evitadb.externalApi.http.ExternalApiProviderRegistrar;
+import io.evitadb.externalApi.http.ExternalApiServer;
import io.evitadb.externalApi.rest.api.catalog.CatalogRestRefreshingObserver;
import io.evitadb.externalApi.rest.configuration.RestConfig;
@@ -54,7 +55,7 @@ public Class getConfigurationClass() {
@Nonnull
@Override
public ExternalApiProvider register(@Nonnull Evita evita,
- @Nonnull ApiOptions apiOptions,
+ @Nonnull ExternalApiServer externalApiServer, @Nonnull ApiOptions apiOptions,
@Nonnull RestConfig restConfiguration) {
final RestManager restManager = new RestManager(evita, apiOptions.exposedOn(), restConfiguration);
evita.registerStructuralChangeObserver(new CatalogRestRefreshingObserver(restManager));
diff --git a/evita_external_api/evita_external_api_rest/src/main/java/io/evitadb/externalApi/rest/api/system/model/LivenessDescriptor.java b/evita_external_api/evita_external_api_rest/src/main/java/io/evitadb/externalApi/rest/api/system/model/LivenessDescriptor.java
index e5827342d..abb3d0e78 100644
--- a/evita_external_api/evita_external_api_rest/src/main/java/io/evitadb/externalApi/rest/api/system/model/LivenessDescriptor.java
+++ b/evita_external_api/evita_external_api_rest/src/main/java/io/evitadb/externalApi/rest/api/system/model/LivenessDescriptor.java
@@ -37,8 +37,10 @@
*/
public interface LivenessDescriptor {
+ String LIVENESS_SUFFIX = "liveness";
+
PropertyDescriptor LIVENESS = PropertyDescriptor.builder()
- .name("liveness")
+ .name(LIVENESS_SUFFIX)
.description("""
Whether REST API is alive and can handle requests.
""")
diff --git a/evita_external_api/evita_external_api_system/src/main/java/io/evitadb/externalApi/system/SystemProvider.java b/evita_external_api/evita_external_api_system/src/main/java/io/evitadb/externalApi/system/SystemProvider.java
index d3b85a0e5..96c2d1821 100644
--- a/evita_external_api/evita_external_api_system/src/main/java/io/evitadb/externalApi/system/SystemProvider.java
+++ b/evita_external_api/evita_external_api_system/src/main/java/io/evitadb/externalApi/system/SystemProvider.java
@@ -29,6 +29,7 @@
import io.evitadb.utils.ConsoleWriter;
import io.evitadb.utils.ConsoleWriter.ConsoleColor;
import io.evitadb.utils.ConsoleWriter.ConsoleDecoration;
+import io.evitadb.utils.NetworkUtils;
import io.evitadb.utils.StringUtils;
import io.undertow.server.HttpHandler;
import lombok.Getter;
@@ -74,6 +75,11 @@ public class SystemProvider implements ExternalApiProviderWithConsoleOutput readiness,
+ @Nonnull String overallStatus
+ ) {
+ exchange.getResponseSender().send("{\n" +
+ "\t\"status\": \"" + overallStatus + "\",\n" +
+ "\t\"apis\": {\n" +
+ readiness.entrySet().stream()
+ .map(entry -> "\t\t\"" + entry.getKey() + "\": \"" + (entry.getValue() ? "ready" : "not ready") + "\"")
+ .collect(Collectors.joining(",\n")) + "\n" +
+ "\t}\n" +
+ "}"
+ );
+ }
+
+ /**
+ * Renders the status of the evitaDB server as a JSON string.
+ *
+ * @param instanceId the unique identifier of the server instance
+ * @param systemStatus the SystemStatus object containing information about the server
+ * @param apiOptions the common settings shared among all the API endpoints
+ * @return the JSON string representing the server status
+ */
+ @Nonnull
+ private static String renderStatus(
+ @Nonnull String instanceId,
+ @Nonnull SystemStatus systemStatus,
+ @Nonnull ApiOptions apiOptions
+ ) {
+ return String.format("""
+ {
+ "serverName": "%s",
+ "version": "%s",
+ "startedAt": "%s",
+ "uptime": %d,
+ "uptimeForHuman": "%s",
+ "catalogsCorrupted": %d,
+ "catalogsOk": %d,
+ "healthProblems": [%s],
+ "apis": [
+ %s
+ ]
+ }""",
+ instanceId,
+ systemStatus.version(),
+ DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(systemStatus.startedAt()),
+ systemStatus.uptime().toSeconds(),
+ StringUtils.formatDuration(systemStatus.uptime()),
+ systemStatus.catalogsCorrupted(),
+ systemStatus.catalogsOk(),
+ systemStatus.healthProblems().stream()
+ .map(it -> "\"" + it.name() + "\"")
+ .collect(Collectors.joining(", ")),
+ apiOptions.endpoints().entrySet().stream()
+ .map(
+ entry -> " {\n \"" + entry.getKey() + "\": [\n" +
+ Arrays.stream(entry.getValue().getBaseUrls(apiOptions.exposedOn()))
+ .map(it -> " \"" + it + "\"")
+ .collect(Collectors.joining(",\n")) +
+ "\n ]\n }"
+ )
+ .collect(Collectors.joining(",\n"))
+ );
+ }
@Nonnull
@Override
@@ -75,7 +157,7 @@ public Class getConfigurationClass() {
@Nonnull
@Override
- public ExternalApiProvider register(@Nonnull Evita evita, @Nonnull ApiOptions apiOptions, @Nonnull SystemConfig systemConfig) {
+ public ExternalApiProvider register(@Nonnull Evita evita, @Nonnull ExternalApiServer externalApiServer, @Nonnull ApiOptions apiOptions, @Nonnull SystemConfig systemConfig) {
final File file;
final String fileName;
final CertificateSettings certificateSettings = apiOptions.certificate();
@@ -129,7 +211,7 @@ public ExternalApiProvider register(@Nonnull Evita evita, @Nonnull
exchange.setStatusCode(StatusCodes.OK);
exchange.getResponseSender().send("{\"status\": \"healthy\"}");
} else {
- exchange.setStatusCode(StatusCodes.INTERNAL_SERVER_ERROR);
+ exchange.setStatusCode(StatusCodes.SERVICE_UNAVAILABLE);
exchange.getResponseSender().send(
"{\"status\": \"unhealthy\", \"problems\": [" +
systemStatus.healthProblems().stream()
@@ -141,6 +223,36 @@ public ExternalApiProvider register(@Nonnull Evita evita, @Nonnull
}
);
+ router.addExactPath(
+ "/" + ENDPOINT_SYSTEM_READINESS,
+ exchange -> {
+ exchange.getResponseHeaders().put(Headers.CONTENT_TYPE, "application/json");
+ if (evita.isActive()) {
+ // check the end-points availability
+ final Collection availableExternalApis = ExternalApiServer.gatherExternalApiProviders();
+ final Map readiness = CollectionUtils.createHashMap(availableExternalApis.size());
+ for (ExternalApiProviderRegistrar> externalApi : availableExternalApis) {
+ final AbstractApiConfiguration apiConfiguration = apiOptions.getEndpointConfiguration(externalApi.getExternalApiCode());
+ if (apiConfiguration != null && apiConfiguration.isEnabled()) {
+ final ExternalApiProvider> apiProvider = externalApiServer.getExternalApiProviderByCode(externalApi.getExternalApiCode());
+ readiness.put(apiProvider.getCode(), apiProvider.isReady());
+ }
+ }
+ if (readiness.values().stream().allMatch(it -> it)) {
+ exchange.setStatusCode(StatusCodes.OK);
+ printApiStatus(exchange, readiness, "ready");
+ seenReady.set(true);
+ } else {
+ exchange.setStatusCode(StatusCodes.SERVICE_UNAVAILABLE);
+ printApiStatus(exchange, readiness, seenReady.get() ? "starting" : "stalling");
+ }
+ } else {
+ exchange.setStatusCode(StatusCodes.SERVICE_UNAVAILABLE);
+ exchange.getResponseSender().send("{\"status\": \"shut down\"}");
+ }
+ }
+ );
+
final ResourceHandler fileSystemHandler;
try (ResourceManager resourceManager = new FileResourceManager(file, 100)) {
fileSystemHandler = new ResourceHandler(
@@ -195,54 +307,4 @@ public ExternalApiProvider register(@Nonnull Evita evita, @Nonnull
}
}
- /**
- * Renders the status of the evitaDB server as a JSON string.
- *
- * @param instanceId the unique identifier of the server instance
- * @param systemStatus the SystemStatus object containing information about the server
- * @param apiOptions the common settings shared among all the API endpoints
- * @return the JSON string representing the server status
- */
- @Nonnull
- private static String renderStatus(
- @Nonnull String instanceId,
- @Nonnull SystemStatus systemStatus,
- @Nonnull ApiOptions apiOptions
- ) {
- return String.format("""
- {
- "serverName": "%s",
- "version": "%s",
- "startedAt": "%s",
- "uptime": %d,
- "uptimeForHuman": "%s",
- "catalogsCorrupted": %d,
- "catalogsOk": %d,
- "healthProblems": [%s],
- "apis": [
- %s
- ]
- }""",
- instanceId,
- systemStatus.version(),
- DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(systemStatus.startedAt()),
- systemStatus.uptime().toSeconds(),
- StringUtils.formatDuration(systemStatus.uptime()),
- systemStatus.catalogsCorrupted(),
- systemStatus.catalogsOk(),
- systemStatus.healthProblems().stream()
- .map(it -> "\"" + it.name() + "\"")
- .collect(Collectors.joining(", ")),
- apiOptions.endpoints().entrySet().stream()
- .map(
- entry -> " {\n \"" + entry.getKey() + "\": [\n" +
- Arrays.stream(entry.getValue().getBaseUrls(apiOptions.exposedOn()))
- .map(it -> " \"" + it + "\"")
- .collect(Collectors.joining(",\n")) +
- "\n ]\n }"
- )
- .collect(Collectors.joining(",\n"))
- );
- }
-
}
diff --git a/evita_functional_tests/src/test/java/io/evitadb/server/EvitaServerTest.java b/evita_functional_tests/src/test/java/io/evitadb/server/EvitaServerTest.java
index a90bf5573..574f26966 100644
--- a/evita_functional_tests/src/test/java/io/evitadb/server/EvitaServerTest.java
+++ b/evita_functional_tests/src/test/java/io/evitadb/server/EvitaServerTest.java
@@ -24,6 +24,7 @@
package io.evitadb.server;
import io.evitadb.core.Evita;
+import io.evitadb.driver.interceptor.ClientSessionInterceptor;
import io.evitadb.externalApi.grpc.GrpcProvider;
import io.evitadb.externalApi.grpc.TestChannelCreator;
import io.evitadb.externalApi.grpc.generated.EvitaServiceGrpc;
@@ -32,12 +33,13 @@
import io.evitadb.externalApi.grpc.generated.GrpcEvitaSessionTerminationRequest;
import io.evitadb.externalApi.grpc.generated.GrpcEvitaSessionTerminationResponse;
import io.evitadb.externalApi.grpc.generated.GrpcSessionType;
-import io.evitadb.driver.interceptor.ClientSessionInterceptor;
import io.evitadb.externalApi.http.ExternalApiProviderRegistrar;
import io.evitadb.externalApi.http.ExternalApiServer;
+import io.evitadb.externalApi.system.SystemProvider;
import io.evitadb.test.EvitaTestSupport;
import io.evitadb.test.TestConstants;
import io.evitadb.utils.CollectionUtils.Property;
+import io.evitadb.utils.NetworkUtils;
import io.grpc.ManagedChannel;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
@@ -45,6 +47,7 @@
import java.io.IOException;
import java.nio.file.Path;
+import java.util.Optional;
import java.util.Set;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
@@ -73,7 +76,7 @@ void tearDown() throws IOException {
}
@Test
- void shouldStartAndStopServerCorrectly() throws IOException {
+ void shouldStartAndStopServerCorrectly() {
final Path configFilePath = EvitaTestSupport.bootstrapEvitaServerConfigurationFile(DIR_EVITA_SERVER_TEST);
final Set apis = ExternalApiServer.gatherExternalApiProviders()
@@ -143,4 +146,77 @@ void shouldStartAndStopServerCorrectly() throws IOException {
}
}
-}
\ No newline at end of file
+ @Test
+ void shouldSignalizeReadinessAndHealthinessCorrectly() {
+ final Path configFilePath = EvitaTestSupport.bootstrapEvitaServerConfigurationFile(DIR_EVITA_SERVER_TEST);
+
+ final Set apis = ExternalApiServer.gatherExternalApiProviders()
+ .stream()
+ .map(ExternalApiProviderRegistrar::getExternalApiCode)
+ .collect(Collectors.toSet());
+
+ final int[] ports = getPortManager().allocatePorts(DIR_EVITA_SERVER_TEST, apis.size());
+ final AtomicInteger index = new AtomicInteger();
+ //noinspection unchecked
+ final EvitaServer evitaServer = new EvitaServer(
+ configFilePath,
+ createHashMap(
+ Stream.concat(
+ Stream.of(
+ property("storage.storageDirectory", getTestDirectory().resolve(DIR_EVITA_SERVER_TEST).toString()),
+ property("cache.enabled", "false")
+ ),
+ apis.stream()
+ .map(it -> property("api.endpoints." + it + ".host", "localhost:" + ports[index.getAndIncrement()]))
+ )
+ .toArray(Property[]::new)
+ )
+ );
+ try {
+ evitaServer.run();
+
+ Optional response;
+ final long start = System.currentTimeMillis();
+ do {
+ final String[] baseUrls = evitaServer.getExternalApiServer().getExternalApiProviderByCode(SystemProvider.CODE).getConfiguration().getBaseUrls(null);
+ response = NetworkUtils.fetchContent(
+ baseUrls[0] + "readiness",
+ "GET",
+ "text/plain",
+ null
+ );
+
+ if (response.isPresent() && response.get().contains("\"status\": \"ready\"")) {
+ break;
+ }
+
+ } while (System.currentTimeMillis() - start < 20000);
+
+ assertTrue(response.isPresent());
+ assertEquals(
+ """
+ {
+ "status": "ready",
+ "apis": {
+ "rest": "ready",
+ "system": "ready",
+ "graphQL": "ready",
+ "lab": "ready",
+ "gRPC": "ready"
+ }
+ }""",
+ response.get().trim()
+ );
+
+ } catch (Exception ex) {
+ fail(ex);
+ } finally {
+ try {
+ evitaServer.stop();
+ } catch (Exception ex) {
+ fail(ex.getMessage(), ex);
+ }
+ }
+ }
+
+}
diff --git a/evita_server/pom.xml b/evita_server/pom.xml
index 47b4bf648..bda224219 100644
--- a/evita_server/pom.xml
+++ b/evita_server/pom.xml
@@ -115,6 +115,11 @@
snakeyaml
+
+ com.squareup.okhttp3
+ okhttp
+
+
org.apache.commonscommons-text
diff --git a/pom.xml b/pom.xml
index 3043c2039..ebb97ca1b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -159,6 +159,11 @@
proxycian_bytebuddy1.3.10
+
+ com.squareup.okhttp3
+ okhttp
+ 5.0.0-alpha.14
+ org.apache.maven.pluginsmaven-compiler-plugin
From cf9041898ce26be01b1619fe19ad344cea110d02 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20Novotn=C3=BD?=
Date: Fri, 3 May 2024 14:18:24 +0200
Subject: [PATCH 05/24] fix(#550): Provide health check for Docker image
Healthines WIP.
---
.../generated/EvitaSessionServiceGrpc.java | 2 +-
.../grpc/generated/GrpcCatalogState.java | 2 +-
.../grpc/generated/GrpcCloseRequest.java | 8 +-
.../generated/GrpcCloseRequestOrBuilder.java | 2 +-
.../grpc/generated/GrpcCloseResponse.java | 6 +-
.../generated/GrpcCloseResponseOrBuilder.java | 2 +-
.../grpc/generated/GrpcCommitBehavior.java | 2 +-
.../externalApi/grpc/generated/GrpcEnums.java | 4 +-
.../grpc/generated/GrpcEvitaAPI.java | 32 +++----
.../grpc/generated/GrpcEvitaSessionAPI.java | 96 +++++++++----------
.../generated/GrpcEvitaSessionRequest.java | 24 ++---
.../GrpcEvitaSessionRequestOrBuilder.java | 2 +-
.../generated/GrpcEvitaSessionResponse.java | 32 +++----
.../GrpcEvitaSessionResponseOrBuilder.java | 2 +-
.../generated/GrpcGoLiveAndCloseResponse.java | 10 +-
.../GrpcGoLiveAndCloseResponseOrBuilder.java | 2 +-
.../observability/agent/OOMAgent.java | 78 ++++++---------
17 files changed, 143 insertions(+), 163 deletions(-)
diff --git a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/EvitaSessionServiceGrpc.java b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/EvitaSessionServiceGrpc.java
index d906c6db2..bb66938ba 100644
--- a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/EvitaSessionServiceGrpc.java
+++ b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/EvitaSessionServiceGrpc.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023-2024
+ * Copyright (c) 2023
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcCatalogState.java b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcCatalogState.java
index 84207e46c..e9ceafdeb 100644
--- a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcCatalogState.java
+++ b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcCatalogState.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023-2024
+ * Copyright (c) 2023
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcCloseRequest.java b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcCloseRequest.java
index 172d0602c..6fb6d991d 100644
--- a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcCloseRequest.java
+++ b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcCloseRequest.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023-2024
+ * Copyright (c) 2023
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -468,7 +468,7 @@ public Builder mergeFrom(
* @return This builder for chaining.
*/
public Builder setCommitBehaviourValue(int value) {
-
+
commitBehaviour_ = value;
onChanged();
return this;
@@ -500,7 +500,7 @@ public Builder setCommitBehaviour(io.evitadb.externalApi.grpc.generated.GrpcComm
if (value == null) {
throw new NullPointerException();
}
-
+
commitBehaviour_ = value.getNumber();
onChanged();
return this;
@@ -514,7 +514,7 @@ public Builder setCommitBehaviour(io.evitadb.externalApi.grpc.generated.GrpcComm
* @return This builder for chaining.
*/
public Builder clearCommitBehaviour() {
-
+
commitBehaviour_ = 0;
onChanged();
return this;
diff --git a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcCloseRequestOrBuilder.java b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcCloseRequestOrBuilder.java
index 001c02bd1..cef228c77 100644
--- a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcCloseRequestOrBuilder.java
+++ b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcCloseRequestOrBuilder.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023-2024
+ * Copyright (c) 2023
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcCloseResponse.java b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcCloseResponse.java
index 9bf186d69..898286538 100644
--- a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcCloseResponse.java
+++ b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcCloseResponse.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023-2024
+ * Copyright (c) 2023
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -457,7 +457,7 @@ public long getCatalogVersion() {
* @return This builder for chaining.
*/
public Builder setCatalogVersion(long value) {
-
+
catalogVersion_ = value;
onChanged();
return this;
@@ -471,7 +471,7 @@ public Builder setCatalogVersion(long value) {
* @return This builder for chaining.
*/
public Builder clearCatalogVersion() {
-
+
catalogVersion_ = 0L;
onChanged();
return this;
diff --git a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcCloseResponseOrBuilder.java b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcCloseResponseOrBuilder.java
index 16f668f3c..f0e2bd13c 100644
--- a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcCloseResponseOrBuilder.java
+++ b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcCloseResponseOrBuilder.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023-2024
+ * Copyright (c) 2023
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcCommitBehavior.java b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcCommitBehavior.java
index f753675d2..57a873495 100644
--- a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcCommitBehavior.java
+++ b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcCommitBehavior.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023-2024
+ * Copyright (c) 2023
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEnums.java b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEnums.java
index 75866c853..238fbb237 100644
--- a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEnums.java
+++ b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEnums.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023-2024
+ * Copyright (c) 2023
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -39,7 +39,7 @@ public static void registerAllExtensions(
}
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEvitaAssociatedDataDataType_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEvitaAssociatedDataDataType_fieldAccessorTable;
diff --git a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaAPI.java b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaAPI.java
index 8ea71740f..013853fb3 100644
--- a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaAPI.java
+++ b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaAPI.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023-2024
+ * Copyright (c) 2023
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -39,77 +39,77 @@ public static void registerAllExtensions(
}
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEvitaServerStatusResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEvitaServerStatusResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEvitaSessionRequest_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEvitaSessionRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEvitaSessionResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEvitaSessionResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEvitaSessionTerminationRequest_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEvitaSessionTerminationRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEvitaSessionTerminationResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEvitaSessionTerminationResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcCatalogNamesResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcCatalogNamesResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDefineCatalogRequest_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDefineCatalogRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDefineCatalogResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDefineCatalogResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcRenameCatalogRequest_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcRenameCatalogRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcRenameCatalogResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcRenameCatalogResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcReplaceCatalogRequest_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcReplaceCatalogRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcReplaceCatalogResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcReplaceCatalogResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDeleteCatalogIfExistsRequest_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDeleteCatalogIfExistsRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDeleteCatalogIfExistsResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDeleteCatalogIfExistsResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcUpdateEvitaRequest_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcUpdateEvitaRequest_fieldAccessorTable;
diff --git a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaSessionAPI.java b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaSessionAPI.java
index 1acea46ee..77ddce1b8 100644
--- a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaSessionAPI.java
+++ b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaSessionAPI.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023-2024
+ * Copyright (c) 2023
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -39,237 +39,237 @@ public static void registerAllExtensions(
}
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcCatalogStateResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcCatalogStateResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcCatalogSchemaResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcCatalogSchemaResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEntitySchemaRequest_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEntitySchemaRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEntitySchemaResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEntitySchemaResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcUpdateCatalogSchemaRequest_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcUpdateCatalogSchemaRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcUpdateCatalogSchemaResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcUpdateCatalogSchemaResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcUpdateAndFetchCatalogSchemaResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcUpdateAndFetchCatalogSchemaResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDefineEntitySchemaRequest_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDefineEntitySchemaRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDefineEntitySchemaResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDefineEntitySchemaResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcUpdateEntitySchemaRequest_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcUpdateEntitySchemaRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcUpdateEntitySchemaResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcUpdateEntitySchemaResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcUpdateAndFetchEntitySchemaResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcUpdateAndFetchEntitySchemaResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEntityRequest_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEntityRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEntityRequest_NamedQueryParamsEntry_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEntityRequest_NamedQueryParamsEntry_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEntityResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEntityResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcPaginatedList_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcPaginatedList_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcStripList_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcStripList_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDataChunk_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDataChunk_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDeleteCollectionRequest_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDeleteCollectionRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDeleteCollectionResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDeleteCollectionResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcRenameCollectionRequest_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcRenameCollectionRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcRenameCollectionResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcRenameCollectionResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcReplaceCollectionRequest_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcReplaceCollectionRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcReplaceCollectionResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcReplaceCollectionResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEntityCollectionSizeRequest_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEntityCollectionSizeRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEntityCollectionSizeResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEntityCollectionSizeResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcCloseRequest_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcCloseRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcCloseResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcCloseResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcGoLiveAndCloseResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcGoLiveAndCloseResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEntityTypesResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEntityTypesResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcQueryRequest_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcQueryRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcQueryRequest_NamedQueryParamsEntry_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcQueryRequest_NamedQueryParamsEntry_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcQueryResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcQueryResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcQueryOneResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcQueryOneResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcQueryListResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcQueryListResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcUpsertEntityRequest_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcUpsertEntityRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcUpsertEntityRequest_NamedQueryParamsEntry_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcUpsertEntityRequest_NamedQueryParamsEntry_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDeleteEntityRequest_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDeleteEntityRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDeleteEntityRequest_NamedQueryParamsEntry_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDeleteEntityRequest_NamedQueryParamsEntry_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDeleteEntitiesRequest_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDeleteEntitiesRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDeleteEntitiesRequest_NamedQueryParamsEntry_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDeleteEntitiesRequest_NamedQueryParamsEntry_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcUpsertEntityResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcUpsertEntityResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDeleteEntityResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDeleteEntityResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDeleteEntityAndItsHierarchyResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDeleteEntityAndItsHierarchyResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDeleteEntitiesResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcDeleteEntitiesResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcTransactionResponse_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcTransactionResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_io_evitadb_externalApi_grpc_generated_GrpcQueryParam_descriptor;
- static final
+ static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_io_evitadb_externalApi_grpc_generated_GrpcQueryParam_fieldAccessorTable;
diff --git a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaSessionRequest.java b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaSessionRequest.java
index dd61ef83b..0382b83e9 100644
--- a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaSessionRequest.java
+++ b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaSessionRequest.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023-2024
+ * Copyright (c) 2023
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -142,7 +142,7 @@ public java.lang.String getCatalogName() {
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
- com.google.protobuf.ByteString bs =
+ com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
catalogName_ = s;
@@ -162,7 +162,7 @@ public java.lang.String getCatalogName() {
getCatalogNameBytes() {
java.lang.Object ref = catalogName_;
if (ref instanceof java.lang.String) {
- com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
catalogName_ = b;
@@ -587,7 +587,7 @@ public java.lang.String getCatalogName() {
getCatalogNameBytes() {
java.lang.Object ref = catalogName_;
if (ref instanceof String) {
- com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
catalogName_ = b;
@@ -610,7 +610,7 @@ public Builder setCatalogName(
if (value == null) {
throw new NullPointerException();
}
-
+
catalogName_ = value;
onChanged();
return this;
@@ -624,7 +624,7 @@ public Builder setCatalogName(
* @return This builder for chaining.
*/
public Builder clearCatalogName() {
-
+
catalogName_ = getDefaultInstance().getCatalogName();
onChanged();
return this;
@@ -644,7 +644,7 @@ public Builder setCatalogNameBytes(
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
-
+
catalogName_ = value;
onChanged();
return this;
@@ -672,7 +672,7 @@ public Builder setCatalogNameBytes(
* @return This builder for chaining.
*/
public Builder setCommitBehaviorValue(int value) {
-
+
commitBehavior_ = value;
onChanged();
return this;
@@ -704,7 +704,7 @@ public Builder setCommitBehavior(io.evitadb.externalApi.grpc.generated.GrpcCommi
if (value == null) {
throw new NullPointerException();
}
-
+
commitBehavior_ = value.getNumber();
onChanged();
return this;
@@ -718,7 +718,7 @@ public Builder setCommitBehavior(io.evitadb.externalApi.grpc.generated.GrpcCommi
* @return This builder for chaining.
*/
public Builder clearCommitBehavior() {
-
+
commitBehavior_ = 0;
onChanged();
return this;
@@ -747,7 +747,7 @@ public boolean getDryRun() {
* @return This builder for chaining.
*/
public Builder setDryRun(boolean value) {
-
+
dryRun_ = value;
onChanged();
return this;
@@ -761,7 +761,7 @@ public Builder setDryRun(boolean value) {
* @return This builder for chaining.
*/
public Builder clearDryRun() {
-
+
dryRun_ = false;
onChanged();
return this;
diff --git a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaSessionRequestOrBuilder.java b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaSessionRequestOrBuilder.java
index 26ac8e5eb..29ecc4e32 100644
--- a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaSessionRequestOrBuilder.java
+++ b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaSessionRequestOrBuilder.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023-2024
+ * Copyright (c) 2023
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaSessionResponse.java b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaSessionResponse.java
index 595f765c5..604fe3040 100644
--- a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaSessionResponse.java
+++ b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaSessionResponse.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023-2024
+ * Copyright (c) 2023
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -151,7 +151,7 @@ public java.lang.String getSessionId() {
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
- com.google.protobuf.ByteString bs =
+ com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
sessionId_ = s;
@@ -171,7 +171,7 @@ public java.lang.String getSessionId() {
getSessionIdBytes() {
java.lang.Object ref = sessionId_;
if (ref instanceof java.lang.String) {
- com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
sessionId_ = b;
@@ -649,7 +649,7 @@ public java.lang.String getSessionId() {
getSessionIdBytes() {
java.lang.Object ref = sessionId_;
if (ref instanceof String) {
- com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
sessionId_ = b;
@@ -672,7 +672,7 @@ public Builder setSessionId(
if (value == null) {
throw new NullPointerException();
}
-
+
sessionId_ = value;
onChanged();
return this;
@@ -686,7 +686,7 @@ public Builder setSessionId(
* @return This builder for chaining.
*/
public Builder clearSessionId() {
-
+
sessionId_ = getDefaultInstance().getSessionId();
onChanged();
return this;
@@ -706,7 +706,7 @@ public Builder setSessionIdBytes(
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
-
+
sessionId_ = value;
onChanged();
return this;
@@ -734,7 +734,7 @@ public Builder setSessionIdBytes(
* @return This builder for chaining.
*/
public Builder setSessionTypeValue(int value) {
-
+
sessionType_ = value;
onChanged();
return this;
@@ -766,7 +766,7 @@ public Builder setSessionType(io.evitadb.externalApi.grpc.generated.GrpcSessionT
if (value == null) {
throw new NullPointerException();
}
-
+
sessionType_ = value.getNumber();
onChanged();
return this;
@@ -780,7 +780,7 @@ public Builder setSessionType(io.evitadb.externalApi.grpc.generated.GrpcSessionT
* @return This builder for chaining.
*/
public Builder clearSessionType() {
-
+
sessionType_ = 0;
onChanged();
return this;
@@ -808,7 +808,7 @@ public Builder clearSessionType() {
* @return This builder for chaining.
*/
public Builder setCommitBehaviourValue(int value) {
-
+
commitBehaviour_ = value;
onChanged();
return this;
@@ -840,7 +840,7 @@ public Builder setCommitBehaviour(io.evitadb.externalApi.grpc.generated.GrpcComm
if (value == null) {
throw new NullPointerException();
}
-
+
commitBehaviour_ = value.getNumber();
onChanged();
return this;
@@ -854,7 +854,7 @@ public Builder setCommitBehaviour(io.evitadb.externalApi.grpc.generated.GrpcComm
* @return This builder for chaining.
*/
public Builder clearCommitBehaviour() {
-
+
commitBehaviour_ = 0;
onChanged();
return this;
@@ -882,7 +882,7 @@ public Builder clearCommitBehaviour() {
* @return This builder for chaining.
*/
public Builder setCatalogStateValue(int value) {
-
+
catalogState_ = value;
onChanged();
return this;
@@ -914,7 +914,7 @@ public Builder setCatalogState(io.evitadb.externalApi.grpc.generated.GrpcCatalog
if (value == null) {
throw new NullPointerException();
}
-
+
catalogState_ = value.getNumber();
onChanged();
return this;
@@ -928,7 +928,7 @@ public Builder setCatalogState(io.evitadb.externalApi.grpc.generated.GrpcCatalog
* @return This builder for chaining.
*/
public Builder clearCatalogState() {
-
+
catalogState_ = 0;
onChanged();
return this;
diff --git a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaSessionResponseOrBuilder.java b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaSessionResponseOrBuilder.java
index e5fb4c9ac..433179ad4 100644
--- a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaSessionResponseOrBuilder.java
+++ b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaSessionResponseOrBuilder.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023-2024
+ * Copyright (c) 2023
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcGoLiveAndCloseResponse.java b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcGoLiveAndCloseResponse.java
index a9b2e3782..95532aac0 100644
--- a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcGoLiveAndCloseResponse.java
+++ b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcGoLiveAndCloseResponse.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023-2024
+ * Copyright (c) 2023
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -495,7 +495,7 @@ public boolean getSuccess() {
* @return This builder for chaining.
*/
public Builder setSuccess(boolean value) {
-
+
success_ = value;
onChanged();
return this;
@@ -509,7 +509,7 @@ public Builder setSuccess(boolean value) {
* @return This builder for chaining.
*/
public Builder clearSuccess() {
-
+
success_ = false;
onChanged();
return this;
@@ -538,7 +538,7 @@ public long getCatalogVersion() {
* @return This builder for chaining.
*/
public Builder setCatalogVersion(long value) {
-
+
catalogVersion_ = value;
onChanged();
return this;
@@ -552,7 +552,7 @@ public Builder setCatalogVersion(long value) {
* @return This builder for chaining.
*/
public Builder clearCatalogVersion() {
-
+
catalogVersion_ = 0L;
onChanged();
return this;
diff --git a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcGoLiveAndCloseResponseOrBuilder.java b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcGoLiveAndCloseResponseOrBuilder.java
index 29bb35755..2e4f99434 100644
--- a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcGoLiveAndCloseResponseOrBuilder.java
+++ b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcGoLiveAndCloseResponseOrBuilder.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023-2024
+ * Copyright (c) 2023
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/agent/OOMAgent.java b/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/agent/OOMAgent.java
index 8d74388be..0f0be0989 100644
--- a/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/agent/OOMAgent.java
+++ b/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/agent/OOMAgent.java
@@ -23,20 +23,16 @@
package io.evitadb.externalApi.observability.agent;
-import io.evitadb.exception.EvitaInternalError;
import net.bytebuddy.agent.builder.AgentBuilder;
-import net.bytebuddy.implementation.MethodCall;
-import net.bytebuddy.implementation.SuperMethodCall;
+import net.bytebuddy.asm.Advice;
+import net.bytebuddy.asm.Advice.OnMethodEnter;
+import net.bytebuddy.dynamic.loading.ClassInjector;
-import java.io.File;
import java.lang.instrument.Instrumentation;
-import java.lang.reflect.Method;
-import static net.bytebuddy.agent.builder.AgentBuilder.RedefinitionStrategy.REDEFINITION;
-import static net.bytebuddy.agent.builder.AgentBuilder.RedefinitionStrategy.RETRANSFORMATION;
-import static net.bytebuddy.matcher.ElementMatchers.any;
+import static net.bytebuddy.matcher.ElementMatchers.is;
+import static net.bytebuddy.matcher.ElementMatchers.isConstructor;
import static net.bytebuddy.matcher.ElementMatchers.nameStartsWith;
-import static net.bytebuddy.matcher.ElementMatchers.named;
import static net.bytebuddy.matcher.ElementMatchers.none;
/**
@@ -45,50 +41,34 @@
* @author Jan Novotný (novotny@fg.cz), FG Forrest a.s. (c) 2024
*/
public class OOMAgent {
- private static final Method HANDLE_OOM;
-
- static {
- try {
- HANDLE_OOM = OOMAgent.class.getDeclaredMethod("handleOOM");
- } catch (NoSuchMethodException e) {
- throw new EvitaInternalError("!!! OOMAgent initialization failed !!!", e);
- }
- }
public static void premain(String agentArgs, Instrumentation inst) {
- if (HANDLE_OOM != null) {
- new AgentBuilder.Default()
- .disableClassFormatChanges()
- .with(new AgentBuilder.InjectionStrategy.UsingInstrumentation(inst, new File("/www/oss/evitaDB-temporary/evita_external_api/evita_external_api_observability/target/evita_external_api_observability-2024.5-SNAPSHOT.jar")))
- .with(REDEFINITION)
- // Make sure we see helpful logs
- .with(AgentBuilder.RedefinitionStrategy.Listener.StreamWriting.toSystemError())
- .with(AgentBuilder.Listener.StreamWriting.toSystemError().withTransformationsOnly())
- .with(AgentBuilder.InstallationListener.StreamWriting.toSystemError())
- .ignore(none())
- // Ignore Byte Buddy and JDK classes we are not interested in
- .ignore(
- nameStartsWith("net.bytebuddy.")
- .or(nameStartsWith("jdk.internal.reflect."))
- .or(nameStartsWith("java.lang.invoke."))
- .or(nameStartsWith("com.sun.proxy."))
- )
- .disableClassFormatChanges()
- .with(RETRANSFORMATION)
- .with(AgentBuilder.InitializationStrategy.NoOp.INSTANCE)
- .with(AgentBuilder.TypeStrategy.Default.REDEFINE)
- .type(named("java.lang.OutOfMemoryError"))
- .transform(
- (builder, typeDescription, classLoader, javaModule, protectionDomain) -> builder
- .constructor(any())
- .intercept(SuperMethodCall.INSTANCE.andThen(MethodCall.invoke(HANDLE_OOM)))
- )
- .installOn(inst);
- }
+ ClassInjector.UsingUnsafe.Factory factory = ClassInjector.UsingUnsafe.Factory.resolve(inst);
+ AgentBuilder agentBuilder = new AgentBuilder.Default();
+ agentBuilder = agentBuilder.with(new AgentBuilder.InjectionStrategy.UsingUnsafe.OfFactory(factory));
+
+
+ agentBuilder
+ .disableClassFormatChanges()
+ .with(AgentBuilder.RedefinitionStrategy.RETRANSFORMATION)
+ .ignore(none())
+ .ignore(nameStartsWith("net.bytebuddy."))
+ .type(is(OutOfMemoryError.class))
+ .transform((builder, typeDescription, classLoader, module, protectionDomain) -> builder
+ .visit(
+ Advice
+ .to(MyAdvice.class)
+ .on(isConstructor())
+ ))
+ .installOn(inst);
}
- public static void handleOOM() {
- System.out.println("!!! OOM !!!");
+ public static class MyAdvice {
+ @OnMethodEnter
+ public static boolean before() {
+ System.out.println("!!! OOM !!!");
+ return true;
+ }
}
}
From b526a9c88eb75561ceac762357ac6dc174529f31 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20Novotn=C3=BD?=
Date: Fri, 3 May 2024 22:12:33 +0200
Subject: [PATCH 06/24] fix(#550): Provide health check for Docker image
Liveness done, but not manually tested.
---
.../requestResponse/system/SystemStatus.java | 20 +-
.../evitadb/scheduling/RejectingExecutor.java | 15 +-
.../src/main/java/io/evitadb/core/Evita.java | 7 +-
.../api/system/ProbesProvider.java | 123 ++++++
.../api/system/model/HealthProblem.java | 54 +++
.../src/main/java/module-info.java | 3 +-
.../java/io/evitadb/driver/EvitaClient.java | 7 +-
.../externalApi/grpc/generated/GrpcEnums.java | 5 +-
.../grpc/generated/GrpcEvitaAPI.java | 152 ++++----
.../GrpcEvitaServerStatusResponse.java | 338 ----------------
...rpcEvitaServerStatusResponseOrBuilder.java | 49 ---
.../grpc/generated/GrpcHealthProblem.java | 368 ++++++++++++++++++
.../requestResponse/EvitaEnumConverter.java | 16 -
.../evitadb/externalApi/grpc/GrpcEnums.proto | 12 -
.../externalApi/grpc/GrpcEvitaAPI.proto | 2 -
.../observability/ObservabilityManager.java | 146 +++++--
.../observability/ObservabilityProvider.java | 7 +-
.../ObservabilityProviderRegistrar.java | 2 +-
...OMAgent.java => ErrorMonitoringAgent.java} | 44 ++-
.../observability/metric/MetricHandler.java | 26 +-
.../metric/ObservabilityProbesDetector.java | 179 +++++++++
.../src/main/java/module-info.java | 4 +
...tadb.externalApi.api.system.ProbesProvider | 24 ++
.../system/SystemProviderRegistrar.java | 82 ++--
.../src/main/java/module-info.java | 5 +-
evita_functional_tests/pom.xml | 7 -
.../io/evitadb/server/EvitaServerTest.java | 31 +-
evita_server/pom.xml | 2 +-
evita_server/src/main/java/module-info.java | 4 +-
.../main/resources/evita-configuration.yaml | 2 +-
30 files changed, 1093 insertions(+), 643 deletions(-)
create mode 100644 evita_external_api/evita_external_api_core/src/main/java/io/evitadb/externalApi/api/system/ProbesProvider.java
create mode 100644 evita_external_api/evita_external_api_core/src/main/java/io/evitadb/externalApi/api/system/model/HealthProblem.java
rename evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/agent/{OOMAgent.java => ErrorMonitoringAgent.java} (63%)
create mode 100644 evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/metric/ObservabilityProbesDetector.java
create mode 100644 evita_external_api/evita_external_api_observability/src/main/resources/META-INF/services/io.evitadb.externalApi.api.system.ProbesProvider
diff --git a/evita_api/src/main/java/io/evitadb/api/requestResponse/system/SystemStatus.java b/evita_api/src/main/java/io/evitadb/api/requestResponse/system/SystemStatus.java
index 93f286fee..80caa617f 100644
--- a/evita_api/src/main/java/io/evitadb/api/requestResponse/system/SystemStatus.java
+++ b/evita_api/src/main/java/io/evitadb/api/requestResponse/system/SystemStatus.java
@@ -27,7 +27,6 @@
import java.io.Serializable;
import java.time.Duration;
import java.time.OffsetDateTime;
-import java.util.Set;
/**
* Contains basic information about evitaDB server.
@@ -38,7 +37,6 @@
* @param instanceId unique identifier of the server instance
* @param catalogsCorrupted number of corrupted catalogs
* @param catalogsOk number of catalogs that are ok
- * @param healthProblems set of flags that indicate health problems of the server
*/
public record SystemStatus(
@Nonnull String version,
@@ -46,23 +44,7 @@ public record SystemStatus(
@Nonnull Duration uptime,
@Nonnull String instanceId,
int catalogsCorrupted,
- int catalogsOk,
- @Nonnull Set healthProblems
+ int catalogsOk
) implements Serializable {
- public enum HealthProblem {
-
- /**
- * Signalized when the consumed memory never goes below 85% of the maximum heap size and the GC tries to free
- * old generation multiple times consuming a log of CPU power.
- */
- MEMORY_SHORTAGE,
- /**
- * Signalized when the input queues are full and the server is not able to process incoming requests. This flag
- * is cleared when the server is able to process incoming requests again.
- */
- INPUT_QUEUES_OVERLOADED
-
- }
-
}
diff --git a/evita_common/src/main/java/io/evitadb/scheduling/RejectingExecutor.java b/evita_common/src/main/java/io/evitadb/scheduling/RejectingExecutor.java
index 8550c1d41..32d63745c 100644
--- a/evita_common/src/main/java/io/evitadb/scheduling/RejectingExecutor.java
+++ b/evita_common/src/main/java/io/evitadb/scheduling/RejectingExecutor.java
@@ -23,14 +23,13 @@
package io.evitadb.scheduling;
-import lombok.Setter;
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import javax.annotation.Nonnull;
-import java.util.Optional;
import java.util.concurrent.Executor;
import java.util.concurrent.RejectedExecutionException;
-import java.util.function.Supplier;
/**
* Custom rejecting executor that logs the problem when the queue gets full.
@@ -38,16 +37,14 @@
* @author Jan Novotný (novotny@fg.cz), FG Forrest a.s. (c) 2023
*/
@Slf4j
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class RejectingExecutor implements Executor {
- @Setter private Supplier additionalLogger;
+ public static final RejectingExecutor INSTANCE = new RejectingExecutor();
@Override
public void execute(@Nonnull Runnable command) {
- log.error(
- "Evita executor queue full. Please, add more threads to the pool." +
- Optional.ofNullable(additionalLogger).map(Supplier::get).orElse("")
- );
- throw new RejectedExecutionException("Evita executor queue full. Please, add more threads to the pool.");
+ log.error("Evita executor queue full. Please add more threads to the pool.");
+ throw new RejectedExecutionException("Evita executor queue full. Please add more threads to the pool.");
}
}
diff --git a/evita_engine/src/main/java/io/evitadb/core/Evita.java b/evita_engine/src/main/java/io/evitadb/core/Evita.java
index eb3890c80..19322fc63 100644
--- a/evita_engine/src/main/java/io/evitadb/core/Evita.java
+++ b/evita_engine/src/main/java/io/evitadb/core/Evita.java
@@ -51,7 +51,6 @@
import io.evitadb.api.requestResponse.schema.mutation.catalog.ModifyCatalogSchemaNameMutation;
import io.evitadb.api.requestResponse.schema.mutation.catalog.RemoveCatalogSchemaMutation;
import io.evitadb.api.requestResponse.system.SystemStatus;
-import io.evitadb.api.requestResponse.system.SystemStatus.HealthProblem;
import io.evitadb.api.trace.TracingContext;
import io.evitadb.api.trace.TracingContextProvider;
import io.evitadb.core.cache.CacheSupervisor;
@@ -197,12 +196,11 @@ public final class Evita implements EvitaContract {
public Evita(@Nonnull EvitaConfiguration configuration) {
this.configuration = configuration;
- final RejectingExecutor handoffExecutor = new RejectingExecutor();
this.executor = new EnhancedQueueExecutor.Builder()
.setCorePoolSize(configuration.server().coreThreadCount())
.setMaximumPoolSize(configuration.server().maxThreadCount())
.setExceptionHandler((t, e) -> log.error("Uncaught error in thread `" + t.getName() + "`: " + e.getMessage(), e))
- .setHandoffExecutor(handoffExecutor)
+ .setHandoffExecutor(RejectingExecutor.INSTANCE)
.setThreadFactory(new EvitaThreadFactory(configuration.server().threadPriority()))
.setMaximumQueueSize(configuration.server().queueSize())
.setRegisterMBean(false)
@@ -528,8 +526,7 @@ public SystemStatus getSystemStatus() {
Duration.between(this.started, OffsetDateTime.now()),
this.configuration.name(),
corruptedCatalogs,
- this.catalogs.size() - corruptedCatalogs,
- EnumSet.noneOf(HealthProblem.class)
+ this.catalogs.size() - corruptedCatalogs
);
}
diff --git a/evita_external_api/evita_external_api_core/src/main/java/io/evitadb/externalApi/api/system/ProbesProvider.java b/evita_external_api/evita_external_api_core/src/main/java/io/evitadb/externalApi/api/system/ProbesProvider.java
new file mode 100644
index 000000000..468994e6d
--- /dev/null
+++ b/evita_external_api/evita_external_api_core/src/main/java/io/evitadb/externalApi/api/system/ProbesProvider.java
@@ -0,0 +1,123 @@
+/*
+ *
+ * _ _ ____ ____
+ * _____ _(_) |_ __ _| _ \| __ )
+ * / _ \ \ / / | __/ _` | | | | _ \
+ * | __/\ V /| | || (_| | |_| | |_) |
+ * \___| \_/ |_|\__\__,_|____/|____/
+ *
+ * Copyright (c) 2024
+ *
+ * Licensed under the Business Source License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://github.com/FgForrest/evitaDB/blob/main/LICENSE
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package io.evitadb.externalApi.api.system;
+
+import io.evitadb.api.EvitaContract;
+import io.evitadb.externalApi.api.system.model.HealthProblem;
+import io.evitadb.externalApi.http.ExternalApiProviderRegistrar;
+import io.evitadb.externalApi.http.ExternalApiServer;
+
+import javax.annotation.Nonnull;
+import java.util.Set;
+
+/**
+ * Integration interface allowing to provide health and readiness probes for the system API from different module.
+ * In our case from the observability module.
+ *
+ * @author Jan Novotný (novotny@fg.cz), FG Forrest a.s. (c) 2024
+ */
+public interface ProbesProvider {
+
+ /**
+ * Method returns set of health problems identified on the server side.
+ * Result of this method is used for determining the "liveness" or "healthiness" of the server.
+ *
+ * @param evitaContract evita instance
+ * @param externalApiServer external API server
+ * @return set of health problems
+ * @see HealthProblem
+ */
+ @Nonnull
+ Set getHealthProblems(
+ @Nonnull EvitaContract evitaContract,
+ @Nonnull ExternalApiServer externalApiServer
+ );
+
+ /**
+ * Method returns data for determining whether it has already completely started and is ready to serve requests.
+ *
+ * @param evitaContract evita instance
+ * @param externalApiServer external API server
+ * @param apiCodes API codes to check (which are enabled)
+ * @return readiness data
+ */
+ @Nonnull
+ Readiness getReadiness(
+ @Nonnull EvitaContract evitaContract,
+ @Nonnull ExternalApiServer externalApiServer,
+ @Nonnull String... apiCodes
+ );
+
+ /**
+ * Method returns data for determining whether server has already completely started and is ready to serve requests.
+ *
+ * @param state overall readiness state (over all APIs)
+ * @param apiStates detail of readiness state for each API
+ */
+ record Readiness(
+ @Nonnull ReadinessState state,
+ @Nonnull ApiState[] apiStates
+ ) {
+
+ }
+
+ /**
+ * Detail of readiness state for particular API.
+ * @param apiCode API code representing {@link ExternalApiProviderRegistrar#getExternalApiCode()}
+ * @param isReady true if API is ready
+ */
+ record ApiState(
+ @Nonnull String apiCode,
+ boolean isReady
+ ) {}
+
+ /**
+ * Enum representing overall readiness state of the server.
+ */
+ enum ReadinessState {
+
+ /**
+ * At least one API is not ready.
+ */
+ STARTING,
+ /**
+ * All APIs are ready.
+ */
+ READY,
+ /**
+ * At least one API that was ready is not ready anymore.
+ */
+ STALLING,
+ /**
+ * Server is shutting down. None of the APIs are ready.
+ */
+ SHUT_DOWN,
+ /**
+ * Unknown state - cannot determine the state of the APIs (should not happen).
+ */
+ UNKNOWN
+
+ }
+
+}
diff --git a/evita_external_api/evita_external_api_core/src/main/java/io/evitadb/externalApi/api/system/model/HealthProblem.java b/evita_external_api/evita_external_api_core/src/main/java/io/evitadb/externalApi/api/system/model/HealthProblem.java
new file mode 100644
index 000000000..f0691a160
--- /dev/null
+++ b/evita_external_api/evita_external_api_core/src/main/java/io/evitadb/externalApi/api/system/model/HealthProblem.java
@@ -0,0 +1,54 @@
+/*
+ *
+ * _ _ ____ ____
+ * _____ _(_) |_ __ _| _ \| __ )
+ * / _ \ \ / / | __/ _` | | | | _ \
+ * | __/\ V /| | || (_| | |_| | |_) |
+ * \___| \_/ |_|\__\__,_|____/|____/
+ *
+ * Copyright (c) 2024
+ *
+ * Licensed under the Business Source License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://github.com/FgForrest/evitaDB/blob/main/LICENSE
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package io.evitadb.externalApi.api.system.model;
+
+/**
+ * This enum represents the possible health problems that can be signaled by the server.
+ *
+ * @author Jan Novotný (novotny@fg.cz), FG Forrest a.s. (c) 2024
+ */
+public enum HealthProblem {
+
+ /**
+ * Signalized when the consumed memory never goes below 85% of the maximum heap size and the GC tries to free
+ * old generation multiple times consuming a log of CPU power.
+ */
+ MEMORY_SHORTAGE,
+ /**
+ * Signalized when the input queues are full and the server is not able to process incoming requests. This flag
+ * is cleared when the server is able to process incoming requests again.
+ */
+ INPUT_QUEUES_OVERLOADED,
+ /**
+ * Signaled when there are occurrences of Java internal errors. These errors are usually caused by the server
+ * itself and are not related to the client's requests.
+ */
+ JAVA_INTERNAL_ERRORS,
+ /**
+ * Signaled when there are occurrences of database internal errors. These errors are usually caused by the server
+ * itself and are not related to the client's requests.
+ */
+ EVITA_DB_INTERNAL_ERRORS
+
+}
diff --git a/evita_external_api/evita_external_api_core/src/main/java/module-info.java b/evita_external_api/evita_external_api_core/src/main/java/module-info.java
index a03b29316..f95975e0b 100644
--- a/evita_external_api/evita_external_api_core/src/main/java/module-info.java
+++ b/evita_external_api/evita_external_api_core/src/main/java/module-info.java
@@ -51,6 +51,7 @@
exports io.evitadb.externalApi.api.catalog.schemaApi.model;
exports io.evitadb.externalApi.api.catalog.model;
exports io.evitadb.externalApi.api.system.model;
+ exports io.evitadb.externalApi.api.system;
exports io.evitadb.externalApi.certificate;
exports io.evitadb.externalApi.api.catalog.schemaApi.model.mutation.sortableAttributeCompound;
exports io.evitadb.externalApi.api.catalog.schemaApi.resolver.mutation.sortableAttributeCompound;
@@ -75,4 +76,4 @@
requires evita.query;
requires org.bouncycastle.provider;
requires org.bouncycastle.pkix;
-}
\ No newline at end of file
+}
diff --git a/evita_external_api/evita_external_api_grpc/client/src/main/java/io/evitadb/driver/EvitaClient.java b/evita_external_api/evita_external_api_grpc/client/src/main/java/io/evitadb/driver/EvitaClient.java
index 146b7e303..59021d0ff 100644
--- a/evita_external_api/evita_external_api_grpc/client/src/main/java/io/evitadb/driver/EvitaClient.java
+++ b/evita_external_api/evita_external_api_grpc/client/src/main/java/io/evitadb/driver/EvitaClient.java
@@ -91,7 +91,6 @@
import java.util.function.Supplier;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import java.util.stream.Collectors;
import static java.util.Optional.ofNullable;
@@ -629,11 +628,7 @@ public SystemStatus getSystemStatus() {
Duration.of(response.getUptime(), ChronoUnit.SECONDS),
response.getInstanceId(),
response.getCatalogsCorrupted(),
- response.getCatalogsOk(),
- response.getHealthProblemsList()
- .stream()
- .map(EvitaEnumConverter::toHealthProblem)
- .collect(Collectors.toSet())
+ response.getCatalogsOk()
);
}
);
diff --git a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEnums.java b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEnums.java
index 61a66395f..238fbb237 100644
--- a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEnums.java
+++ b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEnums.java
@@ -152,9 +152,8 @@ public static void registerAllExtensions(
"XIST\020\001\022\016\n\nMUST_EXIST\020\002*t\n\022GrpcCommitBeha" +
"vior\022 \n\034WAIT_FOR_CONFLICT_RESOLUTION\020\000\022\034" +
"\n\030WAIT_FOR_LOG_PERSISTENCE\020\001\022\036\n\032WAIT_FOR" +
- "_INDEX_PROPAGATION\020\002*E\n\021GrpcHealthProble" +
- "m\022\023\n\017MEMORY_SHORTAGE\020\000\022\033\n\027INPUT_QUEUES_O" +
- "VERLOADED\020\001B\014P\001\252\002\007EvitaDBb\006proto3"
+ "_INDEX_PROPAGATION\020\002B\014P\001\252\002\007EvitaDBb\006prot" +
+ "o3"
};
descriptor = com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
diff --git a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaAPI.java b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaAPI.java
index 47559e567..013853fb3 100644
--- a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaAPI.java
+++ b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaAPI.java
@@ -125,89 +125,87 @@ public static void registerAllExtensions(
"lApi.grpc.generated\032\033google/protobuf/emp" +
"ty.proto\032\017GrpcEnums.proto\032\030GrpcEvitaData" +
"Types.proto\032\037GrpcCatalogSchemaMutation.p" +
- "roto\"\243\002\n\035GrpcEvitaServerStatusResponse\022\017" +
+ "roto\"\321\001\n\035GrpcEvitaServerStatusResponse\022\017" +
"\n\007version\030\001 \001(\t\022L\n\tstartedAt\030\002 \001(\01329.io." +
"evitadb.externalApi.grpc.generated.GrpcO" +
"ffsetDateTime\022\016\n\006uptime\030\003 \001(\003\022\022\n\ninstanc" +
"eId\030\004 \001(\t\022\031\n\021catalogsCorrupted\030\005 \001(\005\022\022\n\n" +
- "catalogsOk\030\006 \001(\005\022P\n\016healthProblems\030\007 \003(\016" +
- "28.io.evitadb.externalApi.grpc.generated" +
- ".GrpcHealthProblem\"\221\001\n\027GrpcEvitaSessionR" +
- "equest\022\023\n\013catalogName\030\001 \001(\t\022Q\n\016commitBeh" +
- "avior\030\002 \001(\01629.io.evitadb.externalApi.grp" +
- "c.generated.GrpcCommitBehavior\022\016\n\006dryRun" +
- "\030\003 \001(\010\"\235\002\n\030GrpcEvitaSessionResponse\022\021\n\ts" +
- "essionId\030\001 \001(\t\022K\n\013sessionType\030\002 \001(\01626.io" +
+ "catalogsOk\030\006 \001(\005\"\221\001\n\027GrpcEvitaSessionReq" +
+ "uest\022\023\n\013catalogName\030\001 \001(\t\022Q\n\016commitBehav" +
+ "ior\030\002 \001(\01629.io.evitadb.externalApi.grpc." +
+ "generated.GrpcCommitBehavior\022\016\n\006dryRun\030\003" +
+ " \001(\010\"\235\002\n\030GrpcEvitaSessionResponse\022\021\n\tses" +
+ "sionId\030\001 \001(\t\022K\n\013sessionType\030\002 \001(\01626.io.e" +
+ "vitadb.externalApi.grpc.generated.GrpcSe" +
+ "ssionType\022R\n\017commitBehaviour\030\003 \001(\01629.io." +
+ "evitadb.externalApi.grpc.generated.GrpcC" +
+ "ommitBehavior\022M\n\014catalogState\030\004 \001(\01627.io" +
".evitadb.externalApi.grpc.generated.Grpc" +
- "SessionType\022R\n\017commitBehaviour\030\003 \001(\01629.i" +
- "o.evitadb.externalApi.grpc.generated.Grp" +
- "cCommitBehavior\022M\n\014catalogState\030\004 \001(\01627." +
- "io.evitadb.externalApi.grpc.generated.Gr" +
- "pcCatalogState\"L\n\"GrpcEvitaSessionTermin" +
- "ationRequest\022\023\n\013catalogName\030\001 \001(\t\022\021\n\tses" +
- "sionId\030\002 \001(\t\"9\n#GrpcEvitaSessionTerminat" +
- "ionResponse\022\022\n\nterminated\030\001 \001(\010\"0\n\030GrpcC" +
- "atalogNamesResponse\022\024\n\014catalogNames\030\001 \003(" +
- "\t\"/\n\030GrpcDefineCatalogRequest\022\023\n\013catalog" +
- "Name\030\001 \001(\t\",\n\031GrpcDefineCatalogResponse\022" +
- "\017\n\007success\030\001 \001(\010\"G\n\030GrpcRenameCatalogReq" +
- "uest\022\023\n\013catalogName\030\001 \001(\t\022\026\n\016newCatalogN" +
- "ame\030\002 \001(\t\",\n\031GrpcRenameCatalogResponse\022\017" +
- "\n\007success\030\001 \001(\010\"a\n\031GrpcReplaceCatalogReq" +
- "uest\022#\n\033catalogNameToBeReplacedWith\030\001 \001(" +
- "\t\022\037\n\027catalogNameToBeReplaced\030\002 \001(\t\"-\n\032Gr" +
- "pcReplaceCatalogResponse\022\017\n\007success\030\001 \001(" +
- "\010\"7\n GrpcDeleteCatalogIfExistsRequest\022\023\n" +
- "\013catalogName\030\001 \001(\t\"4\n!GrpcDeleteCatalogI" +
- "fExistsResponse\022\017\n\007success\030\001 \001(\010\"{\n\026Grpc" +
- "UpdateEvitaRequest\022a\n\017schemaMutations\030\001 " +
- "\003(\0132H.io.evitadb.externalApi.grpc.genera" +
- "ted.GrpcTopLevelCatalogSchemaMutation2\336\r" +
- "\n\014EvitaService\022l\n\014ServerStatus\022\026.google." +
- "protobuf.Empty\032D.io.evitadb.externalApi." +
- "grpc.generated.GrpcEvitaServerStatusResp" +
- "onse\022\230\001\n\025CreateReadOnlySession\022>.io.evit" +
- "adb.externalApi.grpc.generated.GrpcEvita" +
- "SessionRequest\032?.io.evitadb.externalApi." +
- "grpc.generated.GrpcEvitaSessionResponse\022" +
- "\231\001\n\026CreateReadWriteSession\022>.io.evitadb." +
- "externalApi.grpc.generated.GrpcEvitaSess" +
- "ionRequest\032?.io.evitadb.externalApi.grpc" +
- ".generated.GrpcEvitaSessionResponse\022\236\001\n\033" +
- "CreateBinaryReadOnlySession\022>.io.evitadb" +
+ "CatalogState\"L\n\"GrpcEvitaSessionTerminat" +
+ "ionRequest\022\023\n\013catalogName\030\001 \001(\t\022\021\n\tsessi" +
+ "onId\030\002 \001(\t\"9\n#GrpcEvitaSessionTerminatio" +
+ "nResponse\022\022\n\nterminated\030\001 \001(\010\"0\n\030GrpcCat" +
+ "alogNamesResponse\022\024\n\014catalogNames\030\001 \003(\t\"" +
+ "/\n\030GrpcDefineCatalogRequest\022\023\n\013catalogNa" +
+ "me\030\001 \001(\t\",\n\031GrpcDefineCatalogResponse\022\017\n" +
+ "\007success\030\001 \001(\010\"G\n\030GrpcRenameCatalogReque" +
+ "st\022\023\n\013catalogName\030\001 \001(\t\022\026\n\016newCatalogNam" +
+ "e\030\002 \001(\t\",\n\031GrpcRenameCatalogResponse\022\017\n\007" +
+ "success\030\001 \001(\010\"a\n\031GrpcReplaceCatalogReque" +
+ "st\022#\n\033catalogNameToBeReplacedWith\030\001 \001(\t\022" +
+ "\037\n\027catalogNameToBeReplaced\030\002 \001(\t\"-\n\032Grpc" +
+ "ReplaceCatalogResponse\022\017\n\007success\030\001 \001(\010\"" +
+ "7\n GrpcDeleteCatalogIfExistsRequest\022\023\n\013c" +
+ "atalogName\030\001 \001(\t\"4\n!GrpcDeleteCatalogIfE" +
+ "xistsResponse\022\017\n\007success\030\001 \001(\010\"{\n\026GrpcUp" +
+ "dateEvitaRequest\022a\n\017schemaMutations\030\001 \003(" +
+ "\0132H.io.evitadb.externalApi.grpc.generate" +
+ "d.GrpcTopLevelCatalogSchemaMutation2\336\r\n\014" +
+ "EvitaService\022l\n\014ServerStatus\022\026.google.pr" +
+ "otobuf.Empty\032D.io.evitadb.externalApi.gr" +
+ "pc.generated.GrpcEvitaServerStatusRespon" +
+ "se\022\230\001\n\025CreateReadOnlySession\022>.io.evitad" +
+ "b.externalApi.grpc.generated.GrpcEvitaSe" +
+ "ssionRequest\032?.io.evitadb.externalApi.gr" +
+ "pc.generated.GrpcEvitaSessionResponse\022\231\001" +
+ "\n\026CreateReadWriteSession\022>.io.evitadb.ex" +
+ "ternalApi.grpc.generated.GrpcEvitaSessio" +
+ "nRequest\032?.io.evitadb.externalApi.grpc.g" +
+ "enerated.GrpcEvitaSessionResponse\022\236\001\n\033Cr" +
+ "eateBinaryReadOnlySession\022>.io.evitadb.e" +
+ "xternalApi.grpc.generated.GrpcEvitaSessi" +
+ "onRequest\032?.io.evitadb.externalApi.grpc." +
+ "generated.GrpcEvitaSessionResponse\022\237\001\n\034C" +
+ "reateBinaryReadWriteSession\022>.io.evitadb" +
".externalApi.grpc.generated.GrpcEvitaSes" +
"sionRequest\032?.io.evitadb.externalApi.grp" +
- "c.generated.GrpcEvitaSessionResponse\022\237\001\n" +
- "\034CreateBinaryReadWriteSession\022>.io.evita" +
- "db.externalApi.grpc.generated.GrpcEvitaS" +
- "essionRequest\032?.io.evitadb.externalApi.g" +
- "rpc.generated.GrpcEvitaSessionResponse\022\251" +
- "\001\n\020TerminateSession\022I.io.evitadb.externa" +
- "lApi.grpc.generated.GrpcEvitaSessionTerm" +
- "inationRequest\032J.io.evitadb.externalApi." +
- "grpc.generated.GrpcEvitaSessionTerminati" +
- "onResponse\022j\n\017GetCatalogNames\022\026.google.p" +
- "rotobuf.Empty\032?.io.evitadb.externalApi.g" +
- "rpc.generated.GrpcCatalogNamesResponse\022\222" +
- "\001\n\rDefineCatalog\022?.io.evitadb.externalAp" +
- "i.grpc.generated.GrpcDefineCatalogReques" +
- "t\032@.io.evitadb.externalApi.grpc.generate" +
- "d.GrpcDefineCatalogResponse\022\222\001\n\rRenameCa" +
- "talog\022?.io.evitadb.externalApi.grpc.gene" +
- "rated.GrpcRenameCatalogRequest\032@.io.evit" +
- "adb.externalApi.grpc.generated.GrpcRenam" +
- "eCatalogResponse\022\225\001\n\016ReplaceCatalog\022@.io" +
- ".evitadb.externalApi.grpc.generated.Grpc" +
- "ReplaceCatalogRequest\032A.io.evitadb.exter" +
- "nalApi.grpc.generated.GrpcReplaceCatalog" +
- "Response\022\252\001\n\025DeleteCatalogIfExists\022G.io." +
- "evitadb.externalApi.grpc.generated.GrpcD" +
- "eleteCatalogIfExistsRequest\032H.io.evitadb" +
- ".externalApi.grpc.generated.GrpcDeleteCa" +
- "talogIfExistsResponse\022_\n\006Update\022=.io.evi" +
- "tadb.externalApi.grpc.generated.GrpcUpda" +
- "teEvitaRequest\032\026.google.protobuf.EmptyB\014" +
- "P\001\252\002\007EvitaDBb\006proto3"
+ "c.generated.GrpcEvitaSessionResponse\022\251\001\n" +
+ "\020TerminateSession\022I.io.evitadb.externalA" +
+ "pi.grpc.generated.GrpcEvitaSessionTermin" +
+ "ationRequest\032J.io.evitadb.externalApi.gr" +
+ "pc.generated.GrpcEvitaSessionTermination" +
+ "Response\022j\n\017GetCatalogNames\022\026.google.pro" +
+ "tobuf.Empty\032?.io.evitadb.externalApi.grp" +
+ "c.generated.GrpcCatalogNamesResponse\022\222\001\n" +
+ "\rDefineCatalog\022?.io.evitadb.externalApi." +
+ "grpc.generated.GrpcDefineCatalogRequest\032" +
+ "@.io.evitadb.externalApi.grpc.generated." +
+ "GrpcDefineCatalogResponse\022\222\001\n\rRenameCata" +
+ "log\022?.io.evitadb.externalApi.grpc.genera" +
+ "ted.GrpcRenameCatalogRequest\032@.io.evitad" +
+ "b.externalApi.grpc.generated.GrpcRenameC" +
+ "atalogResponse\022\225\001\n\016ReplaceCatalog\022@.io.e" +
+ "vitadb.externalApi.grpc.generated.GrpcRe" +
+ "placeCatalogRequest\032A.io.evitadb.externa" +
+ "lApi.grpc.generated.GrpcReplaceCatalogRe" +
+ "sponse\022\252\001\n\025DeleteCatalogIfExists\022G.io.ev" +
+ "itadb.externalApi.grpc.generated.GrpcDel" +
+ "eteCatalogIfExistsRequest\032H.io.evitadb.e" +
+ "xternalApi.grpc.generated.GrpcDeleteCata" +
+ "logIfExistsResponse\022_\n\006Update\022=.io.evita" +
+ "db.externalApi.grpc.generated.GrpcUpdate" +
+ "EvitaRequest\032\026.google.protobuf.EmptyB\014P\001" +
+ "\252\002\007EvitaDBb\006proto3"
};
descriptor = com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
@@ -222,7 +220,7 @@ public static void registerAllExtensions(
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEvitaServerStatusResponse_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEvitaServerStatusResponse_descriptor,
- new java.lang.String[] { "Version", "StartedAt", "Uptime", "InstanceId", "CatalogsCorrupted", "CatalogsOk", "HealthProblems", });
+ new java.lang.String[] { "Version", "StartedAt", "Uptime", "InstanceId", "CatalogsCorrupted", "CatalogsOk", });
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEvitaSessionRequest_descriptor =
getDescriptor().getMessageTypes().get(1);
internal_static_io_evitadb_externalApi_grpc_generated_GrpcEvitaSessionRequest_fieldAccessorTable = new
diff --git a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaServerStatusResponse.java b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaServerStatusResponse.java
index 3945e9756..96a32969f 100644
--- a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaServerStatusResponse.java
+++ b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaServerStatusResponse.java
@@ -45,7 +45,6 @@ private GrpcEvitaServerStatusResponse(com.google.protobuf.GeneratedMessageV3.Bui
private GrpcEvitaServerStatusResponse() {
version_ = "";
instanceId_ = "";
- healthProblems_ = java.util.Collections.emptyList();
}
@java.lang.Override
@@ -68,7 +67,6 @@ private GrpcEvitaServerStatusResponse(
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
- int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
@@ -119,29 +117,6 @@ private GrpcEvitaServerStatusResponse(
catalogsOk_ = input.readInt32();
break;
}
- case 56: {
- int rawValue = input.readEnum();
- if (!((mutable_bitField0_ & 0x00000001) != 0)) {
- healthProblems_ = new java.util.ArrayList();
- mutable_bitField0_ |= 0x00000001;
- }
- healthProblems_.add(rawValue);
- break;
- }
- case 58: {
- int length = input.readRawVarint32();
- int oldLimit = input.pushLimit(length);
- while(input.getBytesUntilLimit() > 0) {
- int rawValue = input.readEnum();
- if (!((mutable_bitField0_ & 0x00000001) != 0)) {
- healthProblems_ = new java.util.ArrayList();
- mutable_bitField0_ |= 0x00000001;
- }
- healthProblems_.add(rawValue);
- }
- input.popLimit(oldLimit);
- break;
- }
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
@@ -157,9 +132,6 @@ private GrpcEvitaServerStatusResponse(
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
- if (((mutable_bitField0_ & 0x00000001) != 0)) {
- healthProblems_ = java.util.Collections.unmodifiableList(healthProblems_);
- }
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
@@ -352,84 +324,6 @@ public int getCatalogsOk() {
return catalogsOk_;
}
- public static final int HEALTHPROBLEMS_FIELD_NUMBER = 7;
- private java.util.List healthProblems_;
- private static final com.google.protobuf.Internal.ListAdapter.Converter<
- java.lang.Integer, io.evitadb.externalApi.grpc.generated.GrpcHealthProblem> healthProblems_converter_ =
- new com.google.protobuf.Internal.ListAdapter.Converter<
- java.lang.Integer, io.evitadb.externalApi.grpc.generated.GrpcHealthProblem>() {
- public io.evitadb.externalApi.grpc.generated.GrpcHealthProblem convert(java.lang.Integer from) {
- @SuppressWarnings("deprecation")
- io.evitadb.externalApi.grpc.generated.GrpcHealthProblem result = io.evitadb.externalApi.grpc.generated.GrpcHealthProblem.valueOf(from);
- return result == null ? io.evitadb.externalApi.grpc.generated.GrpcHealthProblem.UNRECOGNIZED : result;
- }
- };
- /**
- *
- * Set of all observed health problems
- *
- *
- * repeated .io.evitadb.externalApi.grpc.generated.GrpcHealthProblem healthProblems = 7;
- * @return A list containing the healthProblems.
- */
- @java.lang.Override
- public java.util.List getHealthProblemsList() {
- return new com.google.protobuf.Internal.ListAdapter<
- java.lang.Integer, io.evitadb.externalApi.grpc.generated.GrpcHealthProblem>(healthProblems_, healthProblems_converter_);
- }
- /**
- *
- * Set of all observed health problems
- *
- *
- * repeated .io.evitadb.externalApi.grpc.generated.GrpcHealthProblem healthProblems = 7;
- * @return The count of healthProblems.
- */
- @java.lang.Override
- public int getHealthProblemsCount() {
- return healthProblems_.size();
- }
- /**
- *
- * Set of all observed health problems
- *
- *
- * repeated .io.evitadb.externalApi.grpc.generated.GrpcHealthProblem healthProblems = 7;
- * @param index The index of the element to return.
- * @return The healthProblems at the given index.
- */
- @java.lang.Override
- public io.evitadb.externalApi.grpc.generated.GrpcHealthProblem getHealthProblems(int index) {
- return healthProblems_converter_.convert(healthProblems_.get(index));
- }
- /**
- *
- * Set of all observed health problems
- *
- *
- * repeated .io.evitadb.externalApi.grpc.generated.GrpcHealthProblem healthProblems = 7;
- * @return A list containing the enum numeric values on the wire for healthProblems.
- */
- @java.lang.Override
- public java.util.List
- getHealthProblemsValueList() {
- return healthProblems_;
- }
- /**
- *
- * Set of all observed health problems
- *
- *
- * repeated .io.evitadb.externalApi.grpc.generated.GrpcHealthProblem healthProblems = 7;
- * @param index The index of the value to return.
- * @return The enum numeric value on the wire of healthProblems at the given index.
- */
- @java.lang.Override
- public int getHealthProblemsValue(int index) {
- return healthProblems_.get(index);
- }
- private int healthProblemsMemoizedSerializedSize;
-
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
@@ -444,7 +338,6 @@ public final boolean isInitialized() {
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
- getSerializedSize();
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(version_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, version_);
}
@@ -463,13 +356,6 @@ public void writeTo(com.google.protobuf.CodedOutputStream output)
if (catalogsOk_ != 0) {
output.writeInt32(6, catalogsOk_);
}
- if (getHealthProblemsList().size() > 0) {
- output.writeUInt32NoTag(58);
- output.writeUInt32NoTag(healthProblemsMemoizedSerializedSize);
- }
- for (int i = 0; i < healthProblems_.size(); i++) {
- output.writeEnumNoTag(healthProblems_.get(i));
- }
unknownFields.writeTo(output);
}
@@ -501,18 +387,6 @@ public int getSerializedSize() {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(6, catalogsOk_);
}
- {
- int dataSize = 0;
- for (int i = 0; i < healthProblems_.size(); i++) {
- dataSize += com.google.protobuf.CodedOutputStream
- .computeEnumSizeNoTag(healthProblems_.get(i));
- }
- size += dataSize;
- if (!getHealthProblemsList().isEmpty()) { size += 1;
- size += com.google.protobuf.CodedOutputStream
- .computeUInt32SizeNoTag(dataSize);
- }healthProblemsMemoizedSerializedSize = dataSize;
- }
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
@@ -543,7 +417,6 @@ public boolean equals(final java.lang.Object obj) {
!= other.getCatalogsCorrupted()) return false;
if (getCatalogsOk()
!= other.getCatalogsOk()) return false;
- if (!healthProblems_.equals(other.healthProblems_)) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@@ -570,10 +443,6 @@ public int hashCode() {
hash = (53 * hash) + getCatalogsCorrupted();
hash = (37 * hash) + CATALOGSOK_FIELD_NUMBER;
hash = (53 * hash) + getCatalogsOk();
- if (getHealthProblemsCount() > 0) {
- hash = (37 * hash) + HEALTHPROBLEMS_FIELD_NUMBER;
- hash = (53 * hash) + healthProblems_.hashCode();
- }
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
@@ -727,8 +596,6 @@ public Builder clear() {
catalogsOk_ = 0;
- healthProblems_ = java.util.Collections.emptyList();
- bitField0_ = (bitField0_ & ~0x00000001);
return this;
}
@@ -755,7 +622,6 @@ public io.evitadb.externalApi.grpc.generated.GrpcEvitaServerStatusResponse build
@java.lang.Override
public io.evitadb.externalApi.grpc.generated.GrpcEvitaServerStatusResponse buildPartial() {
io.evitadb.externalApi.grpc.generated.GrpcEvitaServerStatusResponse result = new io.evitadb.externalApi.grpc.generated.GrpcEvitaServerStatusResponse(this);
- int from_bitField0_ = bitField0_;
result.version_ = version_;
if (startedAtBuilder_ == null) {
result.startedAt_ = startedAt_;
@@ -766,11 +632,6 @@ public io.evitadb.externalApi.grpc.generated.GrpcEvitaServerStatusResponse build
result.instanceId_ = instanceId_;
result.catalogsCorrupted_ = catalogsCorrupted_;
result.catalogsOk_ = catalogsOk_;
- if (((bitField0_ & 0x00000001) != 0)) {
- healthProblems_ = java.util.Collections.unmodifiableList(healthProblems_);
- bitField0_ = (bitField0_ & ~0x00000001);
- }
- result.healthProblems_ = healthProblems_;
onBuilt();
return result;
}
@@ -839,16 +700,6 @@ public Builder mergeFrom(io.evitadb.externalApi.grpc.generated.GrpcEvitaServerSt
if (other.getCatalogsOk() != 0) {
setCatalogsOk(other.getCatalogsOk());
}
- if (!other.healthProblems_.isEmpty()) {
- if (healthProblems_.isEmpty()) {
- healthProblems_ = other.healthProblems_;
- bitField0_ = (bitField0_ & ~0x00000001);
- } else {
- ensureHealthProblemsIsMutable();
- healthProblems_.addAll(other.healthProblems_);
- }
- onChanged();
- }
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
@@ -877,7 +728,6 @@ public Builder mergeFrom(
}
return this;
}
- private int bitField0_;
private java.lang.Object version_ = "";
/**
@@ -1354,194 +1204,6 @@ public Builder clearCatalogsOk() {
onChanged();
return this;
}
-
- private java.util.List healthProblems_ =
- java.util.Collections.emptyList();
- private void ensureHealthProblemsIsMutable() {
- if (!((bitField0_ & 0x00000001) != 0)) {
- healthProblems_ = new java.util.ArrayList(healthProblems_);
- bitField0_ |= 0x00000001;
- }
- }
- /**
- *
- * Set of all observed health problems
- *
- *
- * repeated .io.evitadb.externalApi.grpc.generated.GrpcHealthProblem healthProblems = 7;
- * @return A list containing the healthProblems.
- */
- public java.util.List getHealthProblemsList() {
- return new com.google.protobuf.Internal.ListAdapter<
- java.lang.Integer, io.evitadb.externalApi.grpc.generated.GrpcHealthProblem>(healthProblems_, healthProblems_converter_);
- }
- /**
- *
- * Set of all observed health problems
- *
- *
- * repeated .io.evitadb.externalApi.grpc.generated.GrpcHealthProblem healthProblems = 7;
- * @return The count of healthProblems.
- */
- public int getHealthProblemsCount() {
- return healthProblems_.size();
- }
- /**
- *
- * Set of all observed health problems
- *
- *
- * repeated .io.evitadb.externalApi.grpc.generated.GrpcHealthProblem healthProblems = 7;
- * @param index The index of the element to return.
- * @return The healthProblems at the given index.
- */
- public io.evitadb.externalApi.grpc.generated.GrpcHealthProblem getHealthProblems(int index) {
- return healthProblems_converter_.convert(healthProblems_.get(index));
- }
- /**
- *
- * Set of all observed health problems
- *
- *
- * repeated .io.evitadb.externalApi.grpc.generated.GrpcHealthProblem healthProblems = 7;
- * @param index The index to set the value at.
- * @param value The healthProblems to set.
- * @return This builder for chaining.
- */
- public Builder setHealthProblems(
- int index, io.evitadb.externalApi.grpc.generated.GrpcHealthProblem value) {
- if (value == null) {
- throw new NullPointerException();
- }
- ensureHealthProblemsIsMutable();
- healthProblems_.set(index, value.getNumber());
- onChanged();
- return this;
- }
- /**
- *
- * Set of all observed health problems
- *
- *
- * repeated .io.evitadb.externalApi.grpc.generated.GrpcHealthProblem healthProblems = 7;
- * @param value The healthProblems to add.
- * @return This builder for chaining.
- */
- public Builder addHealthProblems(io.evitadb.externalApi.grpc.generated.GrpcHealthProblem value) {
- if (value == null) {
- throw new NullPointerException();
- }
- ensureHealthProblemsIsMutable();
- healthProblems_.add(value.getNumber());
- onChanged();
- return this;
- }
- /**
- *
- * Set of all observed health problems
- *
- *
- * repeated .io.evitadb.externalApi.grpc.generated.GrpcHealthProblem healthProblems = 7;
- * @param values The healthProblems to add.
- * @return This builder for chaining.
- */
- public Builder addAllHealthProblems(
- java.lang.Iterable extends io.evitadb.externalApi.grpc.generated.GrpcHealthProblem> values) {
- ensureHealthProblemsIsMutable();
- for (io.evitadb.externalApi.grpc.generated.GrpcHealthProblem value : values) {
- healthProblems_.add(value.getNumber());
- }
- onChanged();
- return this;
- }
- /**
- *
- *
- * repeated .io.evitadb.externalApi.grpc.generated.GrpcHealthProblem healthProblems = 7;
- * @return A list containing the enum numeric values on the wire for healthProblems.
- */
- public java.util.List
- getHealthProblemsValueList() {
- return java.util.Collections.unmodifiableList(healthProblems_);
- }
- /**
- *
- * Set of all observed health problems
- *
- *
- * repeated .io.evitadb.externalApi.grpc.generated.GrpcHealthProblem healthProblems = 7;
- * @param index The index of the value to return.
- * @return The enum numeric value on the wire of healthProblems at the given index.
- */
- public int getHealthProblemsValue(int index) {
- return healthProblems_.get(index);
- }
- /**
- *
- * Set of all observed health problems
- *
- *
- * repeated .io.evitadb.externalApi.grpc.generated.GrpcHealthProblem healthProblems = 7;
- * @param index The index of the value to return.
- * @return The enum numeric value on the wire of healthProblems at the given index.
- * @return This builder for chaining.
- */
- public Builder setHealthProblemsValue(
- int index, int value) {
- ensureHealthProblemsIsMutable();
- healthProblems_.set(index, value);
- onChanged();
- return this;
- }
- /**
- *
- * Set of all observed health problems
- *
- *
- * repeated .io.evitadb.externalApi.grpc.generated.GrpcHealthProblem healthProblems = 7;
- * @param value The enum numeric value on the wire for healthProblems to add.
- * @return This builder for chaining.
- */
- public Builder addHealthProblemsValue(int value) {
- ensureHealthProblemsIsMutable();
- healthProblems_.add(value);
- onChanged();
- return this;
- }
- /**
- *
- * Set of all observed health problems
- *
- *
- * repeated .io.evitadb.externalApi.grpc.generated.GrpcHealthProblem healthProblems = 7;
- * @param values The enum numeric values on the wire for healthProblems to add.
- * @return This builder for chaining.
- */
- public Builder addAllHealthProblemsValue(
- java.lang.Iterable values) {
- ensureHealthProblemsIsMutable();
- for (int value : values) {
- healthProblems_.add(value);
- }
- onChanged();
- return this;
- }
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
diff --git a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaServerStatusResponseOrBuilder.java b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaServerStatusResponseOrBuilder.java
index c52d8142a..1520b68fe 100644
--- a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaServerStatusResponseOrBuilder.java
+++ b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcEvitaServerStatusResponseOrBuilder.java
@@ -126,53 +126,4 @@ public interface GrpcEvitaServerStatusResponseOrBuilder extends
* @return The catalogsOk.
*/
int getCatalogsOk();
-
- /**
- *
- * Set of all observed health problems
- *
- *
- * repeated .io.evitadb.externalApi.grpc.generated.GrpcHealthProblem healthProblems = 7;
- * @return A list containing the healthProblems.
- */
- java.util.List getHealthProblemsList();
- /**
- *
- * Set of all observed health problems
- *
- *
- * repeated .io.evitadb.externalApi.grpc.generated.GrpcHealthProblem healthProblems = 7;
- * @return The count of healthProblems.
- */
- int getHealthProblemsCount();
- /**
- *
- * Set of all observed health problems
- *
- *
- * repeated .io.evitadb.externalApi.grpc.generated.GrpcHealthProblem healthProblems = 7;
- * @param index The index of the element to return.
- * @return The healthProblems at the given index.
- */
- io.evitadb.externalApi.grpc.generated.GrpcHealthProblem getHealthProblems(int index);
- /**
- *
- * Set of all observed health problems
- *
- *
- * repeated .io.evitadb.externalApi.grpc.generated.GrpcHealthProblem healthProblems = 7;
- * @return A list containing the enum numeric values on the wire for healthProblems.
- */
- java.util.List
- getHealthProblemsValueList();
- /**
- *
- * Set of all observed health problems
- *
- *
- * repeated .io.evitadb.externalApi.grpc.generated.GrpcHealthProblem healthProblems = 7;
- * @param index The index of the value to return.
- * @return The enum numeric value on the wire of healthProblems at the given index.
- */
- int getHealthProblemsValue(int index);
}
diff --git a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcHealthProblem.java b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcHealthProblem.java
index 9b85d02fb..7a6161a34 100644
--- a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcHealthProblem.java
+++ b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcHealthProblem.java
@@ -21,6 +21,374 @@
* limitations under the License.
*/
+/*
+ *
+ * _ _ ____ ____
+ * _____ _(_) |_ __ _| _ \| __ )
+ * / _ \ \ / / | __/ _` | | | | _ \
+ * | __/\ V /| | || (_| | |_| | |_) |
+ * \___| \_/ |_|\__\__,_|____/|____/
+ *
+ * Copyright (c) 2023
+ *
+ * Licensed under the Business Source License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://github.com/FgForrest/evitaDB/blob/main/LICENSE
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ *
+ * _ _ ____ ____
+ * _____ _(_) |_ __ _| _ \| __ )
+ * / _ \ \ / / | __/ _` | | | | _ \
+ * | __/\ V /| | || (_| | |_| | |_) |
+ * \___| \_/ |_|\__\__,_|____/|____/
+ *
+ * Copyright (c) 2023
+ *
+ * Licensed under the Business Source License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://github.com/FgForrest/evitaDB/blob/main/LICENSE
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ *
+ * _ _ ____ ____
+ * _____ _(_) |_ __ _| _ \| __ )
+ * / _ \ \ / / | __/ _` | | | | _ \
+ * | __/\ V /| | || (_| | |_| | |_) |
+ * \___| \_/ |_|\__\__,_|____/|____/
+ *
+ * Copyright (c) 2023
+ *
+ * Licensed under the Business Source License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://github.com/FgForrest/evitaDB/blob/main/LICENSE
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ *
+ * _ _ ____ ____
+ * _____ _(_) |_ __ _| _ \| __ )
+ * / _ \ \ / / | __/ _` | | | | _ \
+ * | __/\ V /| | || (_| | |_| | |_) |
+ * \___| \_/ |_|\__\__,_|____/|____/
+ *
+ * Copyright (c) 2023
+ *
+ * Licensed under the Business Source License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://github.com/FgForrest/evitaDB/blob/main/LICENSE
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ *
+ * _ _ ____ ____
+ * _____ _(_) |_ __ _| _ \| __ )
+ * / _ \ \ / / | __/ _` | | | | _ \
+ * | __/\ V /| | || (_| | |_| | |_) |
+ * \___| \_/ |_|\__\__,_|____/|____/
+ *
+ * Copyright (c) 2023
+ *
+ * Licensed under the Business Source License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://github.com/FgForrest/evitaDB/blob/main/LICENSE
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ *
+ * _ _ ____ ____
+ * _____ _(_) |_ __ _| _ \| __ )
+ * / _ \ \ / / | __/ _` | | | | _ \
+ * | __/\ V /| | || (_| | |_| | |_) |
+ * \___| \_/ |_|\__\__,_|____/|____/
+ *
+ * Copyright (c) 2023
+ *
+ * Licensed under the Business Source License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://github.com/FgForrest/evitaDB/blob/main/LICENSE
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ *
+ * _ _ ____ ____
+ * _____ _(_) |_ __ _| _ \| __ )
+ * / _ \ \ / / | __/ _` | | | | _ \
+ * | __/\ V /| | || (_| | |_| | |_) |
+ * \___| \_/ |_|\__\__,_|____/|____/
+ *
+ * Copyright (c) 2023
+ *
+ * Licensed under the Business Source License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://github.com/FgForrest/evitaDB/blob/main/LICENSE
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ *
+ * _ _ ____ ____
+ * _____ _(_) |_ __ _| _ \| __ )
+ * / _ \ \ / / | __/ _` | | | | _ \
+ * | __/\ V /| | || (_| | |_| | |_) |
+ * \___| \_/ |_|\__\__,_|____/|____/
+ *
+ * Copyright (c) 2023
+ *
+ * Licensed under the Business Source License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://github.com/FgForrest/evitaDB/blob/main/LICENSE
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ *
+ * _ _ ____ ____
+ * _____ _(_) |_ __ _| _ \| __ )
+ * / _ \ \ / / | __/ _` | | | | _ \
+ * | __/\ V /| | || (_| | |_| | |_) |
+ * \___| \_/ |_|\__\__,_|____/|____/
+ *
+ * Copyright (c) 2023
+ *
+ * Licensed under the Business Source License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://github.com/FgForrest/evitaDB/blob/main/LICENSE
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ *
+ * _ _ ____ ____
+ * _____ _(_) |_ __ _| _ \| __ )
+ * / _ \ \ / / | __/ _` | | | | _ \
+ * | __/\ V /| | || (_| | |_| | |_) |
+ * \___| \_/ |_|\__\__,_|____/|____/
+ *
+ * Copyright (c) 2023
+ *
+ * Licensed under the Business Source License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://github.com/FgForrest/evitaDB/blob/main/LICENSE
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ *
+ * _ _ ____ ____
+ * _____ _(_) |_ __ _| _ \| __ )
+ * / _ \ \ / / | __/ _` | | | | _ \
+ * | __/\ V /| | || (_| | |_| | |_) |
+ * \___| \_/ |_|\__\__,_|____/|____/
+ *
+ * Copyright (c) 2023
+ *
+ * Licensed under the Business Source License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://github.com/FgForrest/evitaDB/blob/main/LICENSE
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ *
+ * _ _ ____ ____
+ * _____ _(_) |_ __ _| _ \| __ )
+ * / _ \ \ / / | __/ _` | | | | _ \
+ * | __/\ V /| | || (_| | |_| | |_) |
+ * \___| \_/ |_|\__\__,_|____/|____/
+ *
+ * Copyright (c) 2023
+ *
+ * Licensed under the Business Source License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://github.com/FgForrest/evitaDB/blob/main/LICENSE
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ *
+ * _ _ ____ ____
+ * _____ _(_) |_ __ _| _ \| __ )
+ * / _ \ \ / / | __/ _` | | | | _ \
+ * | __/\ V /| | || (_| | |_| | |_) |
+ * \___| \_/ |_|\__\__,_|____/|____/
+ *
+ * Copyright (c) 2023
+ *
+ * Licensed under the Business Source License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://github.com/FgForrest/evitaDB/blob/main/LICENSE
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ *
+ * _ _ ____ ____
+ * _____ _(_) |_ __ _| _ \| __ )
+ * / _ \ \ / / | __/ _` | | | | _ \
+ * | __/\ V /| | || (_| | |_| | |_) |
+ * \___| \_/ |_|\__\__,_|____/|____/
+ *
+ * Copyright (c) 2023
+ *
+ * Licensed under the Business Source License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://github.com/FgForrest/evitaDB/blob/main/LICENSE
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ *
+ * _ _ ____ ____
+ * _____ _(_) |_ __ _| _ \| __ )
+ * / _ \ \ / / | __/ _` | | | | _ \
+ * | __/\ V /| | || (_| | |_| | |_) |
+ * \___| \_/ |_|\__\__,_|____/|____/
+ *
+ * Copyright (c) 2023
+ *
+ * Licensed under the Business Source License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://github.com/FgForrest/evitaDB/blob/main/LICENSE
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ *
+ * _ _ ____ ____
+ * _____ _(_) |_ __ _| _ \| __ )
+ * / _ \ \ / / | __/ _` | | | | _ \
+ * | __/\ V /| | || (_| | |_| | |_) |
+ * \___| \_/ |_|\__\__,_|____/|____/
+ *
+ * Copyright (c) 2023
+ *
+ * Licensed under the Business Source License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://github.com/FgForrest/evitaDB/blob/main/LICENSE
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: GrpcEnums.proto
diff --git a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/requestResponse/EvitaEnumConverter.java b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/requestResponse/EvitaEnumConverter.java
index 76d568713..a54c0c9b2 100644
--- a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/requestResponse/EvitaEnumConverter.java
+++ b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/requestResponse/EvitaEnumConverter.java
@@ -46,7 +46,6 @@
import io.evitadb.api.requestResponse.schema.OrderBehaviour;
import io.evitadb.api.requestResponse.schema.dto.AttributeUniquenessType;
import io.evitadb.api.requestResponse.schema.dto.GlobalAttributeUniquenessType;
-import io.evitadb.api.requestResponse.system.SystemStatus.HealthProblem;
import io.evitadb.exception.EvitaInternalError;
import io.evitadb.externalApi.grpc.generated.*;
import lombok.AccessLevel;
@@ -749,19 +748,4 @@ public static CommitBehavior toCommitBehavior(@Nonnull GrpcCommitBehavior commit
};
}
- /**
- * Converts a GrpcHealthProblem to a HealthProblem.
- *
- * @param grpcHealthProblem The GrpcHealthProblem to convert.
- * @return The converted HealthProblem.
- * @throws EvitaInternalError if the given grpcHealthProblem is unrecognized.
- */
- @Nonnull
- public static HealthProblem toHealthProblem(@Nonnull GrpcHealthProblem grpcHealthProblem) {
- return switch (grpcHealthProblem.getNumber()) {
- case 0 -> HealthProblem.MEMORY_SHORTAGE;
- case 1 -> HealthProblem.INPUT_QUEUES_OVERLOADED;
- default -> throw new EvitaInternalError("Unrecognized remote health problem: " + grpcHealthProblem);
- };
- }
}
diff --git a/evita_external_api/evita_external_api_grpc/shared/src/main/resources/META-INF/io/evitadb/externalApi/grpc/GrpcEnums.proto b/evita_external_api/evita_external_api_grpc/shared/src/main/resources/META-INF/io/evitadb/externalApi/grpc/GrpcEnums.proto
index 86d43fe48..96dd40893 100644
--- a/evita_external_api/evita_external_api_grpc/shared/src/main/resources/META-INF/io/evitadb/externalApi/grpc/GrpcEnums.proto
+++ b/evita_external_api/evita_external_api_grpc/shared/src/main/resources/META-INF/io/evitadb/externalApi/grpc/GrpcEnums.proto
@@ -500,15 +500,3 @@ enum GrpcCommitBehavior {
WAIT_FOR_INDEX_PROPAGATION = 2;
}
-
-// This enum represents all possible health problems that are monitored by evitaDB.
-enum GrpcHealthProblem {
-
- // Signalized when the consumed memory never goes below 85% of the maximum heap size and the GC tries to free
- // old generation multiple times consuming a log of CPU power.
- MEMORY_SHORTAGE = 0;
- // Signalized when the input queues are full and the server is not able to process incoming requests. This flag
- // is cleared when the server is able to process incoming requests again.
- INPUT_QUEUES_OVERLOADED = 1;
-
-}
diff --git a/evita_external_api/evita_external_api_grpc/shared/src/main/resources/META-INF/io/evitadb/externalApi/grpc/GrpcEvitaAPI.proto b/evita_external_api/evita_external_api_grpc/shared/src/main/resources/META-INF/io/evitadb/externalApi/grpc/GrpcEvitaAPI.proto
index 6f42fe19b..0f2e2b263 100644
--- a/evita_external_api/evita_external_api_grpc/shared/src/main/resources/META-INF/io/evitadb/externalApi/grpc/GrpcEvitaAPI.proto
+++ b/evita_external_api/evita_external_api_grpc/shared/src/main/resources/META-INF/io/evitadb/externalApi/grpc/GrpcEvitaAPI.proto
@@ -23,8 +23,6 @@ message GrpcEvitaServerStatusResponse {
int32 catalogsCorrupted = 5;
// Number of catalogs that are ok
int32 catalogsOk = 6;
- // Set of all observed health problems
- repeated GrpcHealthProblem healthProblems = 7;
}
// Request to create a session inside of a catalog.
diff --git a/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/ObservabilityManager.java b/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/ObservabilityManager.java
index 849ce46cd..ef653450b 100644
--- a/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/ObservabilityManager.java
+++ b/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/ObservabilityManager.java
@@ -28,6 +28,7 @@
import io.evitadb.core.metric.event.CustomMetricsExecutionEvent;
import io.evitadb.exception.EvitaInternalError;
import io.evitadb.exception.UnexpectedIOException;
+import io.evitadb.externalApi.api.system.model.HealthProblem;
import io.evitadb.externalApi.configuration.ApiOptions;
import io.evitadb.externalApi.http.CorsFilter;
import io.evitadb.externalApi.http.PathNormalizingHandler;
@@ -67,6 +68,7 @@
import java.util.List;
import java.util.Optional;
import java.util.Set;
+import java.util.concurrent.atomic.AtomicLong;
/**
* This class is used as an orchestrator for all observability-related tasks. It is responsible for starting and stopping
@@ -81,10 +83,6 @@
public class ObservabilityManager {
public static final String METRICS_SUFFIX = "metrics";
public static final String METRICS_PATH = "/observability/" + METRICS_SUFFIX;
- /**
- * JFR recording instance.
- */
- private final Recording recording;
/**
* Directory where JFR recording file is stored.
*/
@@ -93,6 +91,26 @@ public class ObservabilityManager {
* Name of the JFR recording file.
*/
private static final String DUMP_FILE_NAME = "recording.jfr";
+ /**
+ * Counter for Java errors.
+ */
+ private static final AtomicLong JAVA_ERRORS = new AtomicLong();
+ /**
+ * Counter for Java OutOfMemory errors.
+ */
+ private static final AtomicLong JAVA_OOM_ERRORS = new AtomicLong();
+ /**
+ * Counter for evitaDB errors.
+ */
+ private static final AtomicLong EVITA_ERRORS = new AtomicLong();
+ /**
+ * Name of the OutOfMemoryError class to detect the problems of OOM kind.
+ */
+ private static final String OOM_NAME = OutOfMemoryError.class.getSimpleName();
+ /**
+ * JFR recording instance.
+ */
+ private final Recording recording;
/**
* Router for observability endpoints.
*/
@@ -114,6 +132,46 @@ public class ObservabilityManager {
*/
@Nonnull @Getter private final ObjectMapper objectMapper = new ObjectMapper();
+ /**
+ * Method increments the counter of Java errors in the Prometheus metrics.
+ */
+ public static void javaErrorEvent(@Nonnull String simpleName) {
+ MetricHandler.JAVA_ERRORS_TOTAL.labelValues(simpleName).inc();
+ JAVA_ERRORS.incrementAndGet();
+ }
+
+ /**
+ * Method increments the counter of evitaDB errors in the Prometheus metrics.
+ */
+ public static void evitaErrorEvent(@Nonnull String simpleName) {
+ MetricHandler.EVITA_ERRORS_TOTAL.labelValues(simpleName).inc();
+ EVITA_ERRORS.incrementAndGet();
+ if (simpleName.equals(OOM_NAME)) {
+ JAVA_OOM_ERRORS.incrementAndGet();
+ }
+ }
+
+ /**
+ * Registers specified events within {@link FlightRecorder}.
+ */
+ private static void registerJfrEvents(@Nonnull String[] allowedEvents) {
+ for (String event : Arrays.stream(allowedEvents).filter(x -> !x.startsWith("jdk.")).toList()) {
+ if (event.endsWith(".*")) {
+ final Set> classes = CustomEventProvider.getEventClassesFromPackage(event);
+ for (Class extends CustomMetricsExecutionEvent> clazz : classes) {
+ if (!Modifier.isAbstract(clazz.getModifiers())) {
+ FlightRecorder.register(clazz);
+ }
+ }
+ } else {
+ final Class extends CustomMetricsExecutionEvent> clazz = CustomEventProvider.getEventClass(event);
+ if (!Modifier.isAbstract(clazz.getModifiers())) {
+ FlightRecorder.register(clazz);
+ }
+ }
+ }
+ }
+
public ObservabilityManager(ObservabilityConfig config, ApiOptions apiOptions, Evita evita) {
this.recording = new Recording();
this.config = config;
@@ -124,6 +182,49 @@ public ObservabilityManager(ObservabilityConfig config, ApiOptions apiOptions, E
registerRecordingFileResourceHandler();
}
+ /**
+ * Returns the number of Java errors.
+ *
+ * @return the number of Java errors
+ */
+ public long getJavaErrorCount() {
+ return JAVA_ERRORS.get();
+ }
+
+ /**
+ * Returns the number of Java OutOfMemory errors.
+ *
+ * @return the number of Java OutOfMemory errors
+ */
+ public long getJavaOutOfMemoryErrorCount() {
+ return JAVA_OOM_ERRORS.get();
+ }
+
+ /**
+ * Returns the number of evitaDB errors.
+ *
+ * @return the number of evitaDB errors
+ */
+ public long getEvitaErrorCount() {
+ return EVITA_ERRORS.get();
+ }
+
+ /**
+ * Records health problem to the Prometheus metrics.
+ * @param healthProblem the health problem to be recorded
+ */
+ public void recordHealthProblem(@Nonnull HealthProblem healthProblem) {
+ MetricHandler.HEALTH_PROBLEMS.labelValues(healthProblem.name()).set(1);
+ }
+
+ /**
+ * Clears health problem from the Prometheus metrics.
+ * @param healthProblem the health problem to be cleared
+ */
+ public void clearHealthProblem(@Nonnull HealthProblem healthProblem) {
+ MetricHandler.HEALTH_PROBLEMS.labelValues(healthProblem.name()).set(0);
+ }
+
/**
* Starts JFR recording that logs all specified events.
*/
@@ -176,6 +277,14 @@ public void registerPrometheusMetricHandler() {
new MetricHandler(config).registerHandlers(evita.getExecutor());
}
+ /**
+ * Gets {@link HttpHandler} for observability endpoints.
+ */
+ @Nonnull
+ public HttpHandler getObservabilityRouter() {
+ return new PathNormalizingHandler(observabilityRouter);
+ }
+
/**
* Registers resource handler for file containing JFR recording.
*/
@@ -205,14 +314,6 @@ private void registerRecordingFileResourceHandler() {
}
}
- /**
- * Gets {@link HttpHandler} for observability endpoints.
- */
- @Nonnull
- public HttpHandler getObservabilityRouter() {
- return new PathNormalizingHandler(observabilityRouter);
- }
-
/**
* Creates and registers Prometheus scraping servlet for metrics publishing.
*/
@@ -262,25 +363,4 @@ private void registerJfrControlEndpoints() {
)
);
}
-
- /**
- * Registers specified events within {@link FlightRecorder}.
- */
- private static void registerJfrEvents(@Nonnull String[] allowedEvents) {
- for (String event : Arrays.stream(allowedEvents).filter(x -> !x.startsWith("jdk.")).toList()) {
- if (event.endsWith(".*")) {
- final Set> classes = CustomEventProvider.getEventClassesFromPackage(event);
- for (Class extends CustomMetricsExecutionEvent> clazz : classes) {
- if (!Modifier.isAbstract(clazz.getModifiers())) {
- FlightRecorder.register(clazz);
- }
- }
- } else {
- final Class extends CustomMetricsExecutionEvent> clazz = CustomEventProvider.getEventClass(event);
- if (!Modifier.isAbstract(clazz.getModifiers())) {
- FlightRecorder.register(clazz);
- }
- }
- }
- }
}
diff --git a/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/ObservabilityProvider.java b/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/ObservabilityProvider.java
index b9a04916c..101eb905e 100644
--- a/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/ObservabilityProvider.java
+++ b/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/ObservabilityProvider.java
@@ -51,7 +51,7 @@ public class ObservabilityProvider implements ExternalApiProvider register(@Nonnull Evita evita, @
observabilityManager.registerPrometheusMetricHandler();
return new ObservabilityProvider(
observabilityConfig,
- observabilityManager.getObservabilityRouter(),
+ observabilityManager,
Arrays.stream(observabilityConfig.getBaseUrls(apiOptions.exposedOn()))
.toArray(String[]::new)
);
diff --git a/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/agent/OOMAgent.java b/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/agent/ErrorMonitoringAgent.java
similarity index 63%
rename from evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/agent/OOMAgent.java
rename to evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/agent/ErrorMonitoringAgent.java
index 0f0be0989..da2195c47 100644
--- a/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/agent/OOMAgent.java
+++ b/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/agent/ErrorMonitoringAgent.java
@@ -23,6 +23,8 @@
package io.evitadb.externalApi.observability.agent;
+import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.externalApi.observability.ObservabilityManager;
import net.bytebuddy.agent.builder.AgentBuilder;
import net.bytebuddy.asm.Advice;
import net.bytebuddy.asm.Advice.OnMethodEnter;
@@ -30,45 +32,69 @@
import java.lang.instrument.Instrumentation;
-import static net.bytebuddy.matcher.ElementMatchers.is;
import static net.bytebuddy.matcher.ElementMatchers.isConstructor;
+import static net.bytebuddy.matcher.ElementMatchers.isSubTypeOf;
import static net.bytebuddy.matcher.ElementMatchers.nameStartsWith;
import static net.bytebuddy.matcher.ElementMatchers.none;
/**
- * TODO JNO - document me
+ * Agent that intercepts all Error constructors and sends a metric to the MetricHandler.
*
* @author Jan Novotný (novotny@fg.cz), FG Forrest a.s. (c) 2024
*/
-public class OOMAgent {
+public class ErrorMonitoringAgent {
public static void premain(String agentArgs, Instrumentation inst) {
ClassInjector.UsingUnsafe.Factory factory = ClassInjector.UsingUnsafe.Factory.resolve(inst);
AgentBuilder agentBuilder = new AgentBuilder.Default();
agentBuilder = agentBuilder.with(new AgentBuilder.InjectionStrategy.UsingUnsafe.OfFactory(factory));
-
agentBuilder
.disableClassFormatChanges()
.with(AgentBuilder.RedefinitionStrategy.RETRANSFORMATION)
.ignore(none())
.ignore(nameStartsWith("net.bytebuddy."))
- .type(is(OutOfMemoryError.class))
+ .type(isSubTypeOf(Error.class))
+ .transform((builder, typeDescription, classLoader, module, protectionDomain) -> builder
+ .visit(
+ Advice
+ .to(JavaErrorConstructorInterceptAdvice.class)
+ .on(isConstructor())
+ ))
+ .type(isSubTypeOf(EvitaInternalError.class))
.transform((builder, typeDescription, classLoader, module, protectionDomain) -> builder
.visit(
Advice
- .to(MyAdvice.class)
+ .to(EvitaDbErrorConstructorInterceptAdvice.class)
.on(isConstructor())
))
.installOn(inst);
}
- public static class MyAdvice {
+ /**
+ * Advice that sends a metric to the MetricHandler when an Error is constructed.
+ */
+ public static class JavaErrorConstructorInterceptAdvice {
+
@OnMethodEnter
- public static boolean before() {
- System.out.println("!!! OOM !!!");
+ public static boolean before(@Advice.This Object thiz) {
+ ObservabilityManager.javaErrorEvent(thiz.getClass().getSimpleName());
return true;
}
+
+ }
+
+ /**
+ * Advice that sends a metric to the MetricHandler when an Error is constructed.
+ */
+ public static class EvitaDbErrorConstructorInterceptAdvice {
+
+ @OnMethodEnter
+ public static boolean before(@Advice.This Object thiz) {
+ ObservabilityManager.evitaErrorEvent(thiz.getClass().getSimpleName());
+ return true;
+ }
+
}
}
diff --git a/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/metric/MetricHandler.java b/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/metric/MetricHandler.java
index d19791b55..3a9d29f4e 100644
--- a/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/metric/MetricHandler.java
+++ b/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/metric/MetricHandler.java
@@ -69,10 +69,21 @@ public class MetricHandler {
private static final Map DEFAULT_JVM_METRICS;
private static final String DEFAULT_JVM_METRICS_NAME = "AllMetrics";
- // Define a Prometheus counter for OutOfMemoryError events
- private static final Counter OUT_OF_MEMORY_ERRORS_TOTAL = Counter.builder()
- .name("jvm_out_of_memory_errors_total")
- .help("Total number of Out of Memory errors")
+ // define a Prometheus counter for errors
+ public static final Counter JAVA_ERRORS_TOTAL = Counter.builder()
+ .name("jvm_errors_total")
+ .labelNames("error_type")
+ .help("Total number of internal Java errors")
+ .register();
+ public static final Counter EVITA_ERRORS_TOTAL = Counter.builder()
+ .name("evita_errors_total")
+ .labelNames("error_type")
+ .help("Total number of internal evitaDB errors")
+ .register();
+ public static final Gauge HEALTH_PROBLEMS = Gauge.builder()
+ .name("evita_health_problem")
+ .labelNames("problem_type")
+ .help("Health problems detected in the system")
.register();
static {
@@ -94,13 +105,6 @@ public MetricHandler(@Nonnull ObservabilityConfig observabilityConfig) {
this.observabilityConfig = observabilityConfig;
}
- /**
- * TODO JNO - document me
- */
- public static void outOfMemoryErrorEvent() {
- OUT_OF_MEMORY_ERRORS_TOTAL.inc();
- }
-
/**
* Based on configuration, this method enables collecting and publishing metrics into Prometheus scraping endpoint.
* If no configuration of such event has been provided, all JVM and custom events are logged. For limiting the logged
diff --git a/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/metric/ObservabilityProbesDetector.java b/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/metric/ObservabilityProbesDetector.java
new file mode 100644
index 000000000..12e209009
--- /dev/null
+++ b/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/metric/ObservabilityProbesDetector.java
@@ -0,0 +1,179 @@
+/*
+ *
+ * _ _ ____ ____
+ * _____ _(_) |_ __ _| _ \| __ )
+ * / _ \ \ / / | __/ _` | | | | _ \
+ * | __/\ V /| | || (_| | |_| | |_) |
+ * \___| \_/ |_|\__\__,_|____/|____/
+ *
+ * Copyright (c) 2024
+ *
+ * Licensed under the Business Source License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://github.com/FgForrest/evitaDB/blob/main/LICENSE
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package io.evitadb.externalApi.observability.metric;
+
+import io.evitadb.api.EvitaContract;
+import io.evitadb.core.Evita;
+import io.evitadb.externalApi.api.system.ProbesProvider;
+import io.evitadb.externalApi.api.system.model.HealthProblem;
+import io.evitadb.externalApi.http.ExternalApiProvider;
+import io.evitadb.externalApi.http.ExternalApiProviderRegistrar;
+import io.evitadb.externalApi.http.ExternalApiServer;
+import io.evitadb.externalApi.observability.ObservabilityManager;
+import io.evitadb.externalApi.observability.ObservabilityProvider;
+import io.evitadb.utils.CollectionUtils;
+import org.jboss.threads.EnhancedQueueExecutor;
+
+import javax.annotation.Nonnull;
+import java.lang.management.GarbageCollectorMXBean;
+import java.lang.management.ManagementFactory;
+import java.util.Collection;
+import java.util.EnumSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+
+/**
+ * This class is responsible for detecting health problems in the system. It monitors:
+ *
+ * 1. The ratio of rejected tasks to submitted tasks in the executor. If the ratio is greater than 2, the input queues
+ * are considered overloaded.
+ * 2. The number of Java internal errors. If the number of errors has increased since the last check, the system is
+ * considered unhealthy.
+ * 3. The number of database internal errors. If the number of errors has increased since the last check, the system is
+ * considered unhealthy.
+ * 4. The number of Java OutOfMemory errors or Old generation garbage collections. If the current memory usage is above
+ * 90% of the total available memory and the number of errors has increased since the last check, the system is considered
+ * unhealthy.
+ */
+public class ObservabilityProbesDetector implements ProbesProvider {
+ private static final Set NO_HEALTH_PROBLEMS = EnumSet.noneOf(HealthProblem.class);
+ private static final Set OLD_GENERATION_GC_NAMES = Set.of("G1 Old Generation", "PS MarkSweep", "ConcurrentMarkSweep");
+
+ private final Runtime runtime = Runtime.getRuntime();
+ private final List garbageCollectorMXBeans = ManagementFactory.getGarbageCollectorMXBeans()
+ .stream()
+ .filter(gc -> OLD_GENERATION_GC_NAMES.contains(gc.getName()))
+ .toList();
+
+ private ObservabilityManager observabilityManager;
+ private long lastSeenRejectedTaskCount;
+ private long lastSeenSubmittedTaskCount;
+ private long lastSeenJavaErrorCount;
+ private long lastSeenJavaOOMErrorCount;
+ private long lastSeenEvitaErrorCount;
+ private long lastSeenJavaGarbageCollections;
+ private boolean seenReady;
+
+ @Nonnull
+ @Override
+ public Set getHealthProblems(@Nonnull EvitaContract evitaContract, @Nonnull ExternalApiServer externalApiServer) {
+ final EnumSet healthProblems = EnumSet.noneOf(HealthProblem.class);
+ final Optional theObservabilityManager = getObservabilityManager(externalApiServer);
+ if (evitaContract instanceof Evita evita) {
+ final EnhancedQueueExecutor executor = evita.getExecutor();
+ final long rejectedTaskCount = executor.getRejectedTaskCount();
+ final long submittedTaskCount = executor.getSubmittedTaskCount();
+ // if the ratio of rejected task to submitted tasks is greater than 2, we could consider queues as overloaded
+ if ((rejectedTaskCount - lastSeenRejectedTaskCount) / (Math.max(submittedTaskCount - lastSeenSubmittedTaskCount, 1)) > 2) {
+ healthProblems.add(HealthProblem.INPUT_QUEUES_OVERLOADED);
+ theObservabilityManager.ifPresent(it -> it.recordHealthProblem(HealthProblem.INPUT_QUEUES_OVERLOADED));
+ } else {
+ theObservabilityManager.ifPresent(it -> it.clearHealthProblem(HealthProblem.INPUT_QUEUES_OVERLOADED));
+ }
+ this.lastSeenRejectedTaskCount = rejectedTaskCount;
+ this.lastSeenSubmittedTaskCount = submittedTaskCount;
+ }
+
+ // if the number of errors has increased since the last check, we could consider the system as unhealthy
+ final long javaErrorCount = theObservabilityManager
+ .map(ObservabilityManager::getJavaErrorCount)
+ .orElse(0L);
+ if (javaErrorCount > this.lastSeenJavaErrorCount) {
+ healthProblems.add(HealthProblem.JAVA_INTERNAL_ERRORS);
+ theObservabilityManager.ifPresent(it -> it.recordHealthProblem(HealthProblem.JAVA_INTERNAL_ERRORS));
+ } else {
+ theObservabilityManager.ifPresent(it -> it.clearHealthProblem(HealthProblem.JAVA_INTERNAL_ERRORS));
+ }
+ this.lastSeenJavaErrorCount = javaErrorCount;
+
+ // if the number of errors has increased since the last check, we could consider the system as unhealthy
+ final long evitaErrorCount = theObservabilityManager
+ .map(ObservabilityManager::getEvitaErrorCount)
+ .orElse(0L);
+ if (evitaErrorCount > this.lastSeenEvitaErrorCount) {
+ healthProblems.add(HealthProblem.EVITA_DB_INTERNAL_ERRORS);
+ theObservabilityManager.ifPresent(it -> it.recordHealthProblem(HealthProblem.EVITA_DB_INTERNAL_ERRORS));
+ } else {
+ theObservabilityManager.ifPresent(it -> it.clearHealthProblem(HealthProblem.EVITA_DB_INTERNAL_ERRORS));
+ }
+ this.lastSeenEvitaErrorCount = evitaErrorCount;
+
+ // if the number of errors has increased since the last check, we could consider the system as unhealthy
+ final long javaOOMErrorCount = theObservabilityManager
+ .map(ObservabilityManager::getJavaOutOfMemoryErrorCount)
+ .orElse(0L);
+ // get used memory of the JVM
+ final float usedMemory = 1.0f - ((float) runtime.freeMemory() / (float) runtime.maxMemory());
+ final long oldGenerationCollectionCount = garbageCollectorMXBeans.stream().mapToLong(GarbageCollectorMXBean::getCollectionCount).sum();
+ if (usedMemory > 0.9f && (javaOOMErrorCount > this.lastSeenJavaOOMErrorCount || oldGenerationCollectionCount > this.lastSeenJavaGarbageCollections)) {
+ healthProblems.add(HealthProblem.MEMORY_SHORTAGE);
+ theObservabilityManager.ifPresent(it -> it.recordHealthProblem(HealthProblem.MEMORY_SHORTAGE));
+ } else {
+ theObservabilityManager.ifPresent(it -> it.clearHealthProblem(HealthProblem.MEMORY_SHORTAGE));
+ }
+ this.lastSeenJavaOOMErrorCount = javaOOMErrorCount;
+ this.lastSeenJavaGarbageCollections = oldGenerationCollectionCount;
+
+ return healthProblems.isEmpty() ? NO_HEALTH_PROBLEMS : healthProblems;
+ }
+
+ @Nonnull
+ @Override
+ public Readiness getReadiness(@Nonnull EvitaContract evitaContract, @Nonnull ExternalApiServer externalApiServer, @Nonnull String... apiCodes) {
+ // check the end-points availability
+ final Collection availableExternalApis = ExternalApiServer.gatherExternalApiProviders();
+ final Map readiness = CollectionUtils.createHashMap(availableExternalApis.size());
+ for (String apiCode : apiCodes) {
+ final ExternalApiProvider> apiProvider = externalApiServer.getExternalApiProviderByCode(apiCode);
+ readiness.put(apiProvider.getCode(), apiProvider.isReady());
+ }
+ final boolean ready = readiness.values().stream().allMatch(Boolean::booleanValue);
+ if (ready) {
+ this.seenReady = true;
+ }
+ return new Readiness(
+ ready ? ReadinessState.READY : (this.seenReady ? ReadinessState.STALLING : ReadinessState.STARTING),
+ readiness.entrySet().stream()
+ .map(entry -> new ApiState(entry.getKey(), entry.getValue()))
+ .toArray(ApiState[]::new)
+ );
+ }
+
+ @Nonnull
+ private Optional getObservabilityManager(@Nonnull ExternalApiServer externalApiServer) {
+ if (this.observabilityManager == null) {
+ final Optional apiProvider = Optional.ofNullable(
+ externalApiServer.getExternalApiProviderByCode(ObservabilityProvider.CODE)
+ );
+ this.observabilityManager = apiProvider
+ .map(ObservabilityProvider::getObservabilityManager)
+ .orElse(null);
+ }
+ return Optional.ofNullable(this.observabilityManager);
+ }
+
+
+}
diff --git a/evita_external_api/evita_external_api_observability/src/main/java/module-info.java b/evita_external_api/evita_external_api_observability/src/main/java/module-info.java
index 41a715dea..9d3533c47 100644
--- a/evita_external_api/evita_external_api_observability/src/main/java/module-info.java
+++ b/evita_external_api/evita_external_api_observability/src/main/java/module-info.java
@@ -22,8 +22,10 @@
*/
import io.evitadb.api.trace.TracingContext;
+import io.evitadb.externalApi.api.system.ProbesProvider;
import io.evitadb.externalApi.http.ExternalApiProviderRegistrar;
import io.evitadb.externalApi.observability.ObservabilityProviderRegistrar;
+import io.evitadb.externalApi.observability.metric.ObservabilityProbesDetector;
import io.evitadb.externalApi.observability.trace.DelegateExternalApiTracingContext;
import io.evitadb.externalApi.observability.trace.ObservabilityTracingContext;
import io.evitadb.externalApi.utils.ExternalApiTracingContext;
@@ -41,6 +43,7 @@
provides TracingContext with ObservabilityTracingContext;
provides ExternalApiTracingContext with DelegateExternalApiTracingContext;
provides ExternalApiProviderRegistrar with ObservabilityProviderRegistrar;
+ provides ProbesProvider with ObservabilityProbesDetector;
opens io.evitadb.externalApi.observability.configuration to com.fasterxml.jackson.databind;
@@ -81,4 +84,5 @@
exports io.evitadb.externalApi.observability.configuration;
exports io.evitadb.externalApi.observability.trace;
+ exports io.evitadb.externalApi.observability.metric;
}
diff --git a/evita_external_api/evita_external_api_observability/src/main/resources/META-INF/services/io.evitadb.externalApi.api.system.ProbesProvider b/evita_external_api/evita_external_api_observability/src/main/resources/META-INF/services/io.evitadb.externalApi.api.system.ProbesProvider
new file mode 100644
index 000000000..bc0919ecb
--- /dev/null
+++ b/evita_external_api/evita_external_api_observability/src/main/resources/META-INF/services/io.evitadb.externalApi.api.system.ProbesProvider
@@ -0,0 +1,24 @@
+#
+#
+# _ _ ____ ____
+# _____ _(_) |_ __ _| _ \| __ )
+# / _ \ \ / / | __/ _` | | | | _ \
+# | __/\ V /| | || (_| | |_| | |_) |
+# \___| \_/ |_|\__\__,_|____/|____/
+#
+# Copyright (c) 2024
+#
+# Licensed under the Business Source License, Version 1.1 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# https://github.com/FgForrest/evitaDB/blob/main/LICENSE
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+io.evitadb.externalApi.observability.metric.ObservabilityProbesDetector
diff --git a/evita_external_api/evita_external_api_system/src/main/java/io/evitadb/externalApi/system/SystemProviderRegistrar.java b/evita_external_api/evita_external_api_system/src/main/java/io/evitadb/externalApi/system/SystemProviderRegistrar.java
index a66191cee..43a1ca8d0 100644
--- a/evita_external_api/evita_external_api_system/src/main/java/io/evitadb/externalApi/system/SystemProviderRegistrar.java
+++ b/evita_external_api/evita_external_api_system/src/main/java/io/evitadb/externalApi/system/SystemProviderRegistrar.java
@@ -26,7 +26,10 @@
import io.evitadb.api.requestResponse.system.SystemStatus;
import io.evitadb.core.Evita;
import io.evitadb.exception.EvitaInternalError;
-import io.evitadb.externalApi.configuration.AbstractApiConfiguration;
+import io.evitadb.externalApi.api.system.ProbesProvider;
+import io.evitadb.externalApi.api.system.ProbesProvider.Readiness;
+import io.evitadb.externalApi.api.system.ProbesProvider.ReadinessState;
+import io.evitadb.externalApi.api.system.model.HealthProblem;
import io.evitadb.externalApi.configuration.ApiOptions;
import io.evitadb.externalApi.configuration.CertificatePath;
import io.evitadb.externalApi.configuration.CertificateSettings;
@@ -36,7 +39,6 @@
import io.evitadb.externalApi.http.ExternalApiServer;
import io.evitadb.externalApi.system.configuration.SystemConfig;
import io.evitadb.utils.CertificateUtils;
-import io.evitadb.utils.CollectionUtils;
import io.evitadb.utils.StringUtils;
import io.undertow.Handlers;
import io.undertow.server.HttpServerExchange;
@@ -53,9 +55,10 @@
import java.io.IOException;
import java.time.format.DateTimeFormatter;
import java.util.Arrays;
-import java.util.Collection;
-import java.util.Map;
-import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.Map.Entry;
+import java.util.Optional;
+import java.util.ServiceLoader;
+import java.util.Set;
import java.util.stream.Collectors;
/**
@@ -68,26 +71,23 @@ public class SystemProviderRegistrar implements ExternalApiProviderRegistrar readiness,
- @Nonnull String overallStatus
+ @Nonnull Readiness readiness
) {
exchange.getResponseSender().send("{\n" +
- "\t\"status\": \"" + overallStatus + "\",\n" +
+ "\t\"status\": \"" + readiness.state().name() + "\",\n" +
"\t\"apis\": {\n" +
- readiness.entrySet().stream()
- .map(entry -> "\t\t\"" + entry.getKey() + "\": \"" + (entry.getValue() ? "ready" : "not ready") + "\"")
- .collect(Collectors.joining(",\n")) + "\n" +
+ Arrays.stream(readiness.apiStates())
+ .map(entry -> "\t\t\"" + entry.apiCode() + "\": \"" + (entry.isReady() ? "ready" : "not ready") + "\"")
+ .collect(Collectors.joining(",\n")) + "\n" +
"\t}\n" +
"}"
);
@@ -128,9 +128,6 @@ private static String renderStatus(
StringUtils.formatDuration(systemStatus.uptime()),
systemStatus.catalogsCorrupted(),
systemStatus.catalogsOk(),
- systemStatus.healthProblems().stream()
- .map(it -> "\"" + it.name() + "\"")
- .collect(Collectors.joining(", ")),
apiOptions.endpoints().entrySet().stream()
.map(
entry -> " {\n \"" + entry.getKey() + "\": [\n" +
@@ -157,7 +154,12 @@ public Class getConfigurationClass() {
@Nonnull
@Override
- public ExternalApiProvider register(@Nonnull Evita evita, @Nonnull ExternalApiServer externalApiServer, @Nonnull ApiOptions apiOptions, @Nonnull SystemConfig systemConfig) {
+ public ExternalApiProvider register(
+ @Nonnull Evita evita,
+ @Nonnull ExternalApiServer externalApiServer,
+ @Nonnull ApiOptions apiOptions,
+ @Nonnull SystemConfig systemConfig
+ ) {
final File file;
final String fileName;
final CertificateSettings certificateSettings = apiOptions.certificate();
@@ -206,15 +208,20 @@ public ExternalApiProvider register(@Nonnull Evita evita, @Nonnull
"/" + ENDPOINT_SYSTEM_LIVENESS,
exchange -> {
exchange.getResponseHeaders().put(Headers.CONTENT_TYPE, "application/json");
- final SystemStatus systemStatus = evita.getSystemStatus();
- if (systemStatus.healthProblems().isEmpty()) {
+ final Set healthProblems = ServiceLoader.load(ProbesProvider.class)
+ .stream()
+ .flatMap(it -> it.get().getHealthProblems(evita, externalApiServer).stream())
+ .collect(Collectors.toSet());
+
+ if (healthProblems.isEmpty()) {
exchange.setStatusCode(StatusCodes.OK);
exchange.getResponseSender().send("{\"status\": \"healthy\"}");
} else {
exchange.setStatusCode(StatusCodes.SERVICE_UNAVAILABLE);
exchange.getResponseSender().send(
"{\"status\": \"unhealthy\", \"problems\": [" +
- systemStatus.healthProblems().stream()
+ healthProblems.stream()
+ .sorted()
.map(it -> "\"" + it.name() + "\"")
.collect(Collectors.joining(", ")) +
"]}"
@@ -223,32 +230,37 @@ public ExternalApiProvider register(@Nonnull Evita evita, @Nonnull
}
);
+ final String[] enabledEndPoints = apiOptions.endpoints()
+ .entrySet()
+ .stream()
+ .filter(entry -> entry.getValue() != null)
+ .filter(entry -> entry.getValue().isEnabled())
+ .map(Entry::getKey)
+ .toArray(String[]::new);
+
router.addExactPath(
"/" + ENDPOINT_SYSTEM_READINESS,
exchange -> {
exchange.getResponseHeaders().put(Headers.CONTENT_TYPE, "application/json");
if (evita.isActive()) {
- // check the end-points availability
- final Collection availableExternalApis = ExternalApiServer.gatherExternalApiProviders();
- final Map readiness = CollectionUtils.createHashMap(availableExternalApis.size());
- for (ExternalApiProviderRegistrar> externalApi : availableExternalApis) {
- final AbstractApiConfiguration apiConfiguration = apiOptions.getEndpointConfiguration(externalApi.getExternalApiCode());
- if (apiConfiguration != null && apiConfiguration.isEnabled()) {
- final ExternalApiProvider> apiProvider = externalApiServer.getExternalApiProviderByCode(externalApi.getExternalApiCode());
- readiness.put(apiProvider.getCode(), apiProvider.isReady());
- }
- }
- if (readiness.values().stream().allMatch(it -> it)) {
+ final Optional readiness = ServiceLoader.load(ProbesProvider.class)
+ .stream()
+ .map(it -> it.get().getReadiness(evita, externalApiServer, enabledEndPoints))
+ .findFirst();
+
+ if (readiness.map(it -> it.state() == ReadinessState.READY).orElse(false)) {
exchange.setStatusCode(StatusCodes.OK);
- printApiStatus(exchange, readiness, "ready");
- seenReady.set(true);
+ printApiStatus(exchange, readiness.get());
+ } else if (readiness.isPresent()) {
+ exchange.setStatusCode(StatusCodes.SERVICE_UNAVAILABLE);
+ printApiStatus(exchange, readiness.get());
} else {
exchange.setStatusCode(StatusCodes.SERVICE_UNAVAILABLE);
- printApiStatus(exchange, readiness, seenReady.get() ? "starting" : "stalling");
+ exchange.getResponseSender().send("{\"status\": \"" + ReadinessState.UNKNOWN.name() + "\"}");
}
} else {
exchange.setStatusCode(StatusCodes.SERVICE_UNAVAILABLE);
- exchange.getResponseSender().send("{\"status\": \"shut down\"}");
+ exchange.getResponseSender().send("{\"status\": \"" + ReadinessState.SHUT_DOWN.name() + "\"}");
}
}
);
diff --git a/evita_external_api/evita_external_api_system/src/main/java/module-info.java b/evita_external_api/evita_external_api_system/src/main/java/module-info.java
index 5157d9ba8..3982647f8 100644
--- a/evita_external_api/evita_external_api_system/src/main/java/module-info.java
+++ b/evita_external_api/evita_external_api_system/src/main/java/module-info.java
@@ -21,6 +21,7 @@
* limitations under the License.
*/
+import io.evitadb.externalApi.api.system.ProbesProvider;
import io.evitadb.externalApi.http.ExternalApiProviderRegistrar;
import io.evitadb.store.spi.CatalogPersistenceServiceFactory;
/**
@@ -30,6 +31,7 @@
uses CatalogPersistenceServiceFactory;
uses ExternalApiProviderRegistrar;
+ uses ProbesProvider;
provides ExternalApiProviderRegistrar with io.evitadb.externalApi.system.SystemProviderRegistrar;
@@ -48,7 +50,8 @@
requires com.fasterxml.jackson.annotation;
requires com.fasterxml.jackson.databind;
requires java.management;
+ requires org.bouncycastle.provider;
exports io.evitadb.externalApi.system.configuration;
exports io.evitadb.externalApi.system;
-}
\ No newline at end of file
+}
diff --git a/evita_functional_tests/pom.xml b/evita_functional_tests/pom.xml
index 00528e1bf..78a232578 100644
--- a/evita_functional_tests/pom.xml
+++ b/evita_functional_tests/pom.xml
@@ -109,13 +109,6 @@
evita_server${project.parent.version}test
-
-
-
- ${project.parent.groupId}
- evita_external_api_observability
-
- ${project.parent.groupId}
diff --git a/evita_functional_tests/src/test/java/io/evitadb/server/EvitaServerTest.java b/evita_functional_tests/src/test/java/io/evitadb/server/EvitaServerTest.java
index 574f26966..b83e407a0 100644
--- a/evita_functional_tests/src/test/java/io/evitadb/server/EvitaServerTest.java
+++ b/evita_functional_tests/src/test/java/io/evitadb/server/EvitaServerTest.java
@@ -167,26 +167,33 @@ void shouldSignalizeReadinessAndHealthinessCorrectly() {
property("cache.enabled", "false")
),
apis.stream()
- .map(it -> property("api.endpoints." + it + ".host", "localhost:" + ports[index.getAndIncrement()]))
+ .flatMap(
+ it -> Stream.of(
+ property("api.endpoints." + it + ".host", "localhost:" + ports[index.getAndIncrement()]),
+ property("api.endpoints." + it + ".enabled", "true")
+ )
+ )
)
.toArray(Property[]::new)
)
);
try {
evitaServer.run();
+ final String[] baseUrls = evitaServer.getExternalApiServer().getExternalApiProviderByCode(SystemProvider.CODE)
+ .getConfiguration()
+ .getBaseUrls(null);
Optional response;
final long start = System.currentTimeMillis();
do {
- final String[] baseUrls = evitaServer.getExternalApiServer().getExternalApiProviderByCode(SystemProvider.CODE).getConfiguration().getBaseUrls(null);
response = NetworkUtils.fetchContent(
baseUrls[0] + "readiness",
"GET",
- "text/plain",
+ "application/json",
null
);
- if (response.isPresent() && response.get().contains("\"status\": \"ready\"")) {
+ if (response.isPresent() && response.get().contains("\"status\": \"READY\"")) {
break;
}
@@ -196,18 +203,32 @@ void shouldSignalizeReadinessAndHealthinessCorrectly() {
assertEquals(
"""
{
- "status": "ready",
+ "status": "READY",
"apis": {
"rest": "ready",
"system": "ready",
"graphQL": "ready",
"lab": "ready",
+ "observability": "ready",
"gRPC": "ready"
}
}""",
response.get().trim()
);
+ final Optional liveness = NetworkUtils.fetchContent(
+ baseUrls[0] + "liveness",
+ "GET",
+ "application/json",
+ null
+ );
+
+ assertTrue(liveness.isPresent());
+ assertEquals(
+ "{\"status\": \"healthy\"}",
+ liveness.get().trim()
+ );
+
} catch (Exception ex) {
fail(ex);
} finally {
diff --git a/evita_server/pom.xml b/evita_server/pom.xml
index ca43a5db1..8643e3ee8 100644
--- a/evita_server/pom.xml
+++ b/evita_server/pom.xml
@@ -149,7 +149,7 @@
true
- io.evitadb.externalApi.observability.agent.OOMAgent
+ io.evitadb.externalApi.observability.agent.ErrorMonitoringAgenttruetrue
diff --git a/evita_server/src/main/java/module-info.java b/evita_server/src/main/java/module-info.java
index ed8cf4f18..392423717 100644
--- a/evita_server/src/main/java/module-info.java
+++ b/evita_server/src/main/java/module-info.java
@@ -21,6 +21,7 @@
* limitations under the License.
*/
+import io.evitadb.externalApi.api.system.ProbesProvider;
import io.evitadb.externalApi.http.ExternalApiProviderRegistrar;
import io.evitadb.store.spi.CatalogPersistenceServiceFactory;
@@ -31,6 +32,7 @@
uses CatalogPersistenceServiceFactory;
uses ExternalApiProviderRegistrar;
+ uses ProbesProvider;
opens io.evitadb.server.configuration to com.fasterxml.jackson.databind;
exports io.evitadb.server;
@@ -52,4 +54,4 @@
requires evita.engine;
requires evita.external.api.core;
requires ch.qos.logback.classic;
-}
\ No newline at end of file
+}
diff --git a/evita_test_support/src/main/resources/evita-configuration.yaml b/evita_test_support/src/main/resources/evita-configuration.yaml
index 4c4b673d8..f6f6b087a 100644
--- a/evita_test_support/src/main/resources/evita-configuration.yaml
+++ b/evita_test_support/src/main/resources/evita-configuration.yaml
@@ -87,7 +87,7 @@ api:
readOnly: ${api.endpoints.lab.gui.readOnly:false}
preconfiguredConnections: !include ${api.endpoints.lab.gui.preconfiguredConnections:null}
observability:
- enabled: false
+ enabled: ${api.endpoints.observability.enabled:false}
host: ${api.endpoints.observability.host:localhost:5557}
exposedHost: ${api.endpoints.observability.exposedHost:null}
tlsEnabled: ${api.endpoints.observability.tlsEnabled:false}
From 5eee65ff2c07c0c5c17c64106a9cbaee6e4523ef Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20Novotn=C3=BD?=
Date: Fri, 3 May 2024 22:14:57 +0200
Subject: [PATCH 07/24] fix(#550): Provide health check for Docker image
Enable agent in entry point.
---
docker/entrypoint.sh | 1 +
1 file changed, 1 insertion(+)
diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh
index 065addb72..011057407 100755
--- a/docker/entrypoint.sh
+++ b/docker/entrypoint.sh
@@ -27,6 +27,7 @@ set -e
if [ "$1" = "" ]; then
set -x
exec java \
+ -javaagent:${EVITA_HOME}/bin/${EVITA_JAR_NAME} \
$EVITA_JAVA_OPTS \
-jar "${EVITA_HOME}/bin/${EVITA_JAR_NAME}" \
"-DconfigFile=$EVITA_CONFIG_FILE" \
From 885eb6d396d367a2d489105f8aee8b96fa9dcd91 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20Novotn=C3=BD?=
Date: Sat, 4 May 2024 12:42:20 +0200
Subject: [PATCH 08/24] fix(#550): Provide health check for Docker image
Full implementation manually tested.
---
.../api/configuration/EvitaConfiguration.java | 4 +-
.../proxy/impl/AbstractEntityProxyState.java | 6 +-
.../proxy/impl/SealedEntityProxyState.java | 10 +-
.../impl/UnsatisfiedDependencyFactory.java | 17 +-
.../api/requestResponse/EvitaResponse.java | 6 +-
.../requestResponse/data/PricesContract.java | 8 +-
.../reference/ReferenceAttributeMutation.java | 6 +-
.../data/structure/EntityDecorator.java | 8 +-
.../ExistingAssociatedDataBuilder.java | 6 +-
.../structure/ExistingAttributesBuilder.java | 6 +-
.../data/structure/ExistingEntityBuilder.java | 6 +-
.../data/structure/ExistingPricesBuilder.java | 6 +-
.../data/structure/Prices.java | 8 +-
.../extraResult/FacetSummary.java | 10 +-
.../AbstractAttributeSchemaBuilder.java | 6 +-
.../builder/AssociatedDataSchemaBuilder.java | 8 +-
.../builder/InternalCatalogSchemaBuilder.java | 6 +-
.../builder/InternalEntitySchemaBuilder.java | 4 +-
.../builder/ReferenceSchemaBuilder.java | 6 +-
...ortableAttributeCompoundSchemaBuilder.java | 6 +-
.../CreateAssociatedDataSchemaMutation.java | 6 +-
...AttributeSchemaGloballyUniqueMutation.java | 8 +-
.../catalog/ModifyEntitySchemaMutation.java | 6 +-
.../ModifyEntitySchemaNameMutation.java | 6 +-
.../catalog/RemoveEntitySchemaMutation.java | 6 +-
.../CreateReferenceSchemaMutation.java | 4 +-
.../api/trace/TracingContextProvider.java | 3 +-
.../io/evitadb/dataType/EvitaDataTypes.java | 6 +-
.../evitadb/exception/EvitaInternalError.java | 22 +-
.../exception/GenericEvitaInternalError.java | 64 +++
.../main/java/io/evitadb/utils/Assert.java | 7 +-
.../java/io/evitadb/utils/ClassUtils.java | 6 +-
.../io/evitadb/utils/NamingConvention.java | 6 +-
.../main/java/io/evitadb/core/Catalog.java | 6 +-
.../io/evitadb/core/EntityCollection.java | 6 +-
.../java/io/evitadb/core/SessionRegistry.java | 5 +-
.../java/io/evitadb/core/cache/CacheEden.java | 4 +-
.../io/evitadb/core/query/QueryContext.java | 8 +-
.../algebra/attribute/AttributeFormula.java | 6 +-
.../FilteredPriceRecords.java | 4 +-
...riceTerminationFormulaWithPriceFilter.java | 4 +-
.../PriceIdToEntityIdTranslateFormula.java | 4 +-
.../ExtraResultPlanningVisitor.java | 6 +-
.../AbstractFacetFormulaGenerator.java | 4 +-
.../facet/producer/FacetSummaryProducer.java | 8 +-
.../producer/AttributeHistogramComputer.java | 6 +-
.../core/query/filter/FilterByVisitor.java | 6 +-
.../attribute/AttributeBetweenTranslator.java | 18 +-
.../facet/FacetHavingTranslator.java | 6 +-
...riceListCompositionTerminationVisitor.java | 6 +-
.../indexSelection/IndexSelectionVisitor.java | 6 +-
.../core/query/sort/OrderByVisitor.java | 6 +-
.../query/sort/ReferenceOrderByVisitor.java | 4 +-
.../EntityPrimaryKeyNaturalTranslator.java | 4 +-
.../TransactionTrunkFinalizer.java | 4 +-
.../TrunkIncorporationTransactionStage.java | 4 +-
.../index/attribute/AttributeIndex.java | 4 +-
.../io/evitadb/index/attribute/SortIndex.java | 4 +-
.../index/cardinality/CardinalityIndex.java | 4 +-
.../evitadb/index/list/TransactionalList.java | 6 +-
.../evitadb/index/map/TransactionalMap.java | 4 +-
.../ContainerizedLocalMutationExecutor.java | 6 +-
.../EntityIndexLocalMutationExecutor.java | 16 +-
.../price/PriceListAndCurrencyPriceIndex.java | 4 +-
.../io/evitadb/index/range/RangeIndex.java | 4 +-
.../evitadb/index/set/TransactionalSet.java | 4 +-
.../certificate/ServerCertificateManager.java | 8 +-
.../externalApi/configuration/ApiOptions.java | 6 +-
.../externalApi/http/ExternalApiServer.java | 12 +-
.../CatalogGraphQLSchemaBuildingContext.java | 6 +-
.../java/io/evitadb/driver/EvitaClient.java | 7 +-
.../io/evitadb/driver/EvitaClientSession.java | 7 +-
.../certificate/ClientCertificateManager.java | 6 +-
.../trace/ClientTracingContextProvider.java | 4 +-
.../grpc/services/EvitaSessionService.java | 22 +-
.../externalApi/grpc/utils/GrpcServer.java | 6 +-
.../dataType/EvitaDataTypesConverter.java | 12 +-
.../grpc/generated/GrpcHealthProblem.java | 370 +-----------------
.../requestResponse/EvitaEnumConverter.java | 43 +-
.../requestResponse/ResponseConverter.java | 6 +-
.../requestResponse/data/EntityConverter.java | 6 +-
.../observability/ObservabilityManager.java | 44 ++-
.../observability/agent/ErrorMonitor.java | 62 +++
.../agent/ErrorMonitoringAgent.java | 62 ++-
.../observability/metric/MetricHandler.java | 9 +-
.../metric/ObservabilityProbesDetector.java | 2 +
.../builder/CatalogRestBuildingContext.java | 6 +-
.../system/SystemProviderRegistrar.java | 44 ++-
.../api/exception/EvitaInternalErrorTest.java | 9 +-
.../evitadb/api/query/parser/ValueTest.java | 5 +-
.../io/evitadb/documentation/JavaDocCopy.java | 17 +-
.../evitadb/documentation/csharp/CShell.java | 19 +-
.../ExternalApiFunctionTestsSupport.java | 12 +-
...TestMutationResolvingExceptionFactory.java | 7 +-
...ogGraphQLGetEntityQueryFunctionalTest.java | 4 +-
...QLGetUnknownEntityQueryFunctionalTest.java | 6 +-
...istUnknownEntitiesQueryFunctionalTest.java | 23 +-
.../client/ClientDataFullDatabaseState.java | 6 +-
.../client/state/ClientPageReadState.java | 6 +-
.../client/state/ClientSingleReadState.java | 6 +-
.../state/ClientTransactionalWriteState.java | 6 +-
.../GraphQLArtificialBenchmarkState.java | 4 +-
.../RestArtificialBenchmarkState.java | 4 +-
.../generators/RandomQueryGenerator.java | 6 +-
.../generators/TestDatasetGenerator.java | 6 +-
.../java/io/evitadb/spike/TrieIngestion.java | 6 +-
.../query/descriptor/ConstraintCreator.java | 27 +-
.../descriptor/ConstraintDescriptor.java | 19 +-
.../ConstraintDescriptorProvider.java | 6 +-
.../query/descriptor/ConstraintProcessor.java | 50 +--
.../evitadb/api/query/parser/Classifier.java | 4 +-
.../api/query/parser/ParserExecutor.java | 8 +-
.../io/evitadb/api/query/parser/Value.java | 32 +-
.../EvitaQLRequireConstraintVisitor.java | 24 +-
...ntityContentRequireCombiningCollector.java | 6 +-
.../query/require/HierarchyOfReference.java | 10 +-
.../query/require/HierarchyStatistics.java | 23 +-
.../query/visitor/ConstraintCloneVisitor.java | 117 +++---
.../query/visitor/QueryPurifierVisitor.java | 98 ++---
.../serializer/DateTimeRangeSerializer.java | 6 +-
.../schema/CatalogSchemaStoragePart.java | 6 +-
.../serializer/EntitySchemaContext.java | 6 +-
.../store/offsetIndex/OffsetIndex.java | 6 +-
.../WriteOnlyOffHeapWithFileBackupHandle.java | 5 +-
.../model/OffsetIndexRecordTypeRegistry.java | 8 +-
.../AbstractFlattenedFormulaSerializer.java | 8 +-
.../DefaultCatalogPersistenceService.java | 18 +-
...ultEntityCollectionPersistenceService.java | 4 +-
...rrencySuperIndexStoragePartSerializer.java | 6 +-
.../filter/AttributeInRangeSerializer.java | 6 +-
.../serializer/ReferenceSchemaSerializer.java | 6 +-
.../io/evitadb/test/EvitaTestSupport.java | 10 +-
.../test/builder/JsonArrayBuilder.java | 6 +-
.../io/evitadb/test/client/ApiClient.java | 6 +-
.../io/evitadb/test/client/GraphQLClient.java | 16 +-
.../io/evitadb/test/client/RestClient.java | 10 +-
.../ConstraintParameterValueResolver.java | 8 +-
.../client/query/ObjectJsonSerializer.java | 5 +-
.../query/graphql/EntityFetchConverter.java | 93 ++---
.../query/graphql/FacetSummaryConverter.java | 4 +-
.../evitadb/test/generator/DataGenerator.java | 6 +-
141 files changed, 956 insertions(+), 1103 deletions(-)
create mode 100644 evita_common/src/main/java/io/evitadb/exception/GenericEvitaInternalError.java
create mode 100644 evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/agent/ErrorMonitor.java
diff --git a/evita_api/src/main/java/io/evitadb/api/configuration/EvitaConfiguration.java b/evita_api/src/main/java/io/evitadb/api/configuration/EvitaConfiguration.java
index 48aa6e7a3..32572f077 100644
--- a/evita_api/src/main/java/io/evitadb/api/configuration/EvitaConfiguration.java
+++ b/evita_api/src/main/java/io/evitadb/api/configuration/EvitaConfiguration.java
@@ -24,7 +24,7 @@
package io.evitadb.api.configuration;
import io.evitadb.dataType.ClassifierType;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.utils.Assert;
import io.evitadb.utils.ClassifierUtils;
import io.evitadb.utils.NetworkUtils;
@@ -105,7 +105,7 @@ public EvitaConfiguration(
this.transaction = transaction;
this.cache = cache;
} catch (IOException ex) {
- throw new EvitaInternalError("Unable to access storage directory creation time!", ex);
+ throw new GenericEvitaInternalError("Unable to access storage directory creation time!", ex);
}
}
diff --git a/evita_api/src/main/java/io/evitadb/api/proxy/impl/AbstractEntityProxyState.java b/evita_api/src/main/java/io/evitadb/api/proxy/impl/AbstractEntityProxyState.java
index 1fbcb52db..1e54944e2 100644
--- a/evita_api/src/main/java/io/evitadb/api/proxy/impl/AbstractEntityProxyState.java
+++ b/evita_api/src/main/java/io/evitadb/api/proxy/impl/AbstractEntityProxyState.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023
+ * Copyright (c) 2023-2024
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -38,7 +38,7 @@
import io.evitadb.api.requestResponse.data.structure.EntityReference;
import io.evitadb.api.requestResponse.data.structure.InitialEntityBuilder;
import io.evitadb.api.requestResponse.schema.EntitySchemaContract;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.utils.Assert;
import io.evitadb.utils.ReflectionLookup;
import lombok.EqualsAndHashCode;
@@ -604,7 +604,7 @@ public T proxy(@Nonnull Class classToImplement, @Nonnull Supplier {
- throw new EvitaInternalError("Should not happen - the supplier should provide correct type!");
+ throw new GenericEvitaInternalError("Should not happen - the supplier should provide correct type!");
}
);
this.proxies.add(proxy);
diff --git a/evita_api/src/main/java/io/evitadb/api/proxy/impl/SealedEntityProxyState.java b/evita_api/src/main/java/io/evitadb/api/proxy/impl/SealedEntityProxyState.java
index 6ac12f5c2..6aded38ad 100644
--- a/evita_api/src/main/java/io/evitadb/api/proxy/impl/SealedEntityProxyState.java
+++ b/evita_api/src/main/java/io/evitadb/api/proxy/impl/SealedEntityProxyState.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023
+ * Copyright (c) 2023-2024
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -41,8 +41,8 @@
import io.evitadb.api.requestResponse.data.structure.InitialReferenceBuilder;
import io.evitadb.api.requestResponse.schema.EntitySchemaContract;
import io.evitadb.api.requestResponse.schema.ReferenceSchemaContract;
-import io.evitadb.exception.EvitaInternalError;
import io.evitadb.exception.EvitaInvalidUsageException;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.utils.Assert;
import io.evitadb.utils.ReflectionLookup;
import lombok.Setter;
@@ -156,9 +156,9 @@ public EntityBuilder getEntityBuilderWithMutations(@Nonnull Collection T createEntityProxy(
@Nonnull EntityContract entity,
@Nonnull Map referencedEntitySchemas
) throws EntityClassInvalidException {
+ if (UNSATISFIED_DEPENDENCY_EXCEPTION == null) {
+ UNSATISFIED_DEPENDENCY_EXCEPTION = new UnsatisfiedDependencyException(
+ "ProxyFactory requires a Proxycian (https://github.com/FgForrest/Proxycian) and " +
+ "ByteBuddy (https://github.com/raphw/byte-buddy) to be present on the classpath.",
+ "Required dependency is not available in evitaDB engine, contact developers of the application."
+ );
+ }
throw UNSATISFIED_DEPENDENCY_EXCEPTION;
}
-
+
}
diff --git a/evita_api/src/main/java/io/evitadb/api/requestResponse/EvitaResponse.java b/evita_api/src/main/java/io/evitadb/api/requestResponse/EvitaResponse.java
index 2390d4606..b09c2297a 100644
--- a/evita_api/src/main/java/io/evitadb/api/requestResponse/EvitaResponse.java
+++ b/evita_api/src/main/java/io/evitadb/api/requestResponse/EvitaResponse.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023
+ * Copyright (c) 2023-2024
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,7 +26,7 @@
import io.evitadb.api.query.Query;
import io.evitadb.api.requestResponse.extraResult.QueryTelemetry;
import io.evitadb.dataType.DataChunk;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
@@ -128,7 +128,7 @@ public void addExtraResult(@Nonnull EvitaResponseExtraResult extraResult) {
public S getExtraResult(Class resultType) {
final Object extraResult = this.extraResults.get(resultType);
if (extraResult != null && !resultType.isInstance(extraResult)) {
- throw new EvitaInternalError("This should never happen!");
+ throw new GenericEvitaInternalError("This should never happen!");
}
//noinspection unchecked
return (S) extraResult;
diff --git a/evita_api/src/main/java/io/evitadb/api/requestResponse/data/PricesContract.java b/evita_api/src/main/java/io/evitadb/api/requestResponse/data/PricesContract.java
index ea80a8c0b..372bc56cc 100644
--- a/evita_api/src/main/java/io/evitadb/api/requestResponse/data/PricesContract.java
+++ b/evita_api/src/main/java/io/evitadb/api/requestResponse/data/PricesContract.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023
+ * Copyright (c) 2023-2024
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,7 +31,7 @@
import io.evitadb.api.requestResponse.data.structure.Entity;
import io.evitadb.api.requestResponse.data.structure.Price;
import io.evitadb.api.requestResponse.data.structure.Price.PriceKey;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.utils.ArrayUtils;
import io.evitadb.utils.Assert;
@@ -140,7 +140,7 @@ static Optional computePriceForSale(@Nonnull Collection throw new EvitaInternalError("Unknown price inner record handling mode: " + innerRecordHandling);
+ default -> throw new GenericEvitaInternalError("Unknown price inner record handling mode: " + innerRecordHandling);
}
}
@@ -413,7 +413,7 @@ default boolean hasPriceInInterval(@Nonnull BigDecimal from, @Nonnull BigDecimal
.orElse(null));
}
default ->
- throw new EvitaInternalError("Unknown price inner record handling mode: " + getPriceInnerRecordHandling());
+ throw new GenericEvitaInternalError("Unknown price inner record handling mode: " + getPriceInnerRecordHandling());
}
}
diff --git a/evita_api/src/main/java/io/evitadb/api/requestResponse/data/mutation/reference/ReferenceAttributeMutation.java b/evita_api/src/main/java/io/evitadb/api/requestResponse/data/mutation/reference/ReferenceAttributeMutation.java
index a0a0258cf..6a9a108d3 100644
--- a/evita_api/src/main/java/io/evitadb/api/requestResponse/data/mutation/reference/ReferenceAttributeMutation.java
+++ b/evita_api/src/main/java/io/evitadb/api/requestResponse/data/mutation/reference/ReferenceAttributeMutation.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023
+ * Copyright (c) 2023-2024
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -41,7 +41,7 @@
import io.evitadb.api.requestResponse.schema.EntitySchemaEditor.EntitySchemaBuilder;
import io.evitadb.api.requestResponse.schema.ReferenceSchemaContract;
import io.evitadb.api.requestResponse.schema.ReferenceSchemaEditor.ReferenceSchemaBuilder;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.utils.Assert;
import lombok.EqualsAndHashCode;
import lombok.Getter;
@@ -99,7 +99,7 @@ public Serializable getSkipToken(@Nonnull CatalogSchemaContract catalogSchema, @
public void verifyOrEvolveSchema(@Nonnull CatalogSchemaContract catalogSchema, @Nonnull EntitySchemaBuilder entitySchemaBuilder) throws InvalidMutationException {
if (attributeMutation instanceof final AttributeSchemaEvolvingMutation schemaValidatingMutation) {
final ReferenceSchemaContract referenceSchema = entitySchemaBuilder.getReference(referenceKey.referenceName())
- .orElseThrow(() -> new EvitaInternalError("Reference to type `" + referenceKey.referenceName() + "` was not found!"));
+ .orElseThrow(() -> new GenericEvitaInternalError("Reference to type `" + referenceKey.referenceName() + "` was not found!"));
attributeMutation.verifyOrEvolveSchema(
catalogSchema,
diff --git a/evita_api/src/main/java/io/evitadb/api/requestResponse/data/structure/EntityDecorator.java b/evita_api/src/main/java/io/evitadb/api/requestResponse/data/structure/EntityDecorator.java
index 308061861..309901df0 100644
--- a/evita_api/src/main/java/io/evitadb/api/requestResponse/data/structure/EntityDecorator.java
+++ b/evita_api/src/main/java/io/evitadb/api/requestResponse/data/structure/EntityDecorator.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023
+ * Copyright (c) 2023-2024
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -52,8 +52,8 @@
import io.evitadb.api.requestResponse.schema.EntitySchemaContract;
import io.evitadb.api.requestResponse.schema.ReferenceSchemaContract;
import io.evitadb.dataType.data.ComplexDataObjectConverter;
-import io.evitadb.exception.EvitaInternalError;
import io.evitadb.exception.EvitaInvalidUsageException;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.utils.Assert;
import io.evitadb.utils.ReflectionLookup;
import lombok.Getter;
@@ -342,7 +342,7 @@ public EntityDecorator(
if (referenceSchema == null) {
index = i;
referenceSchema = entitySchema.getReference(thisReferenceName)
- .orElseThrow(() -> new EvitaInternalError("Sanity check!"));
+ .orElseThrow(() -> new GenericEvitaInternalError("Sanity check!"));
entityFetcher = referenceFetcher.getEntityFetcher(referenceSchema);
entityGroupFetcher = referenceFetcher.getEntityGroupFetcher(referenceSchema);
fetchedReferenceComparator = referenceFetcher.getEntityComparator(referenceSchema);
@@ -355,7 +355,7 @@ public EntityDecorator(
);
index = i;
referenceSchema = entitySchema.getReference(thisReferenceName)
- .orElseThrow(() -> new EvitaInternalError("Sanity check!"));
+ .orElseThrow(() -> new GenericEvitaInternalError("Sanity check!"));
entityFetcher = referenceFetcher.getEntityFetcher(referenceSchema);
entityGroupFetcher = referenceFetcher.getEntityGroupFetcher(referenceSchema);
fetchedReferenceComparator = referenceFetcher.getEntityComparator(referenceSchema);
diff --git a/evita_api/src/main/java/io/evitadb/api/requestResponse/data/structure/ExistingAssociatedDataBuilder.java b/evita_api/src/main/java/io/evitadb/api/requestResponse/data/structure/ExistingAssociatedDataBuilder.java
index 87447df4a..177e5ccce 100644
--- a/evita_api/src/main/java/io/evitadb/api/requestResponse/data/structure/ExistingAssociatedDataBuilder.java
+++ b/evita_api/src/main/java/io/evitadb/api/requestResponse/data/structure/ExistingAssociatedDataBuilder.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023
+ * Copyright (c) 2023-2024
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,7 +31,7 @@
import io.evitadb.api.requestResponse.schema.AssociatedDataSchemaContract;
import io.evitadb.api.requestResponse.schema.EntitySchemaContract;
import io.evitadb.dataType.data.ComplexDataObjectConverter;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.utils.ArrayUtils;
import io.evitadb.utils.Assert;
import io.evitadb.utils.ReflectionLookup;
@@ -134,7 +134,7 @@ public void addMutation(@Nonnull AssociatedDataMutation localMutation) {
this.associatedDataMutations.put(associatedDataKey, removeAssociatedDataMutation);
}
} else {
- throw new EvitaInternalError("Unknown Evita price mutation: `" + localMutation.getClass() + "`!");
+ throw new GenericEvitaInternalError("Unknown Evita price mutation: `" + localMutation.getClass() + "`!");
}
}
diff --git a/evita_api/src/main/java/io/evitadb/api/requestResponse/data/structure/ExistingAttributesBuilder.java b/evita_api/src/main/java/io/evitadb/api/requestResponse/data/structure/ExistingAttributesBuilder.java
index 125f6507d..20b58607d 100644
--- a/evita_api/src/main/java/io/evitadb/api/requestResponse/data/structure/ExistingAttributesBuilder.java
+++ b/evita_api/src/main/java/io/evitadb/api/requestResponse/data/structure/ExistingAttributesBuilder.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023
+ * Copyright (c) 2023-2024
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,8 +31,8 @@
import io.evitadb.api.requestResponse.data.mutation.attribute.UpsertAttributeMutation;
import io.evitadb.api.requestResponse.schema.AttributeSchemaContract;
import io.evitadb.api.requestResponse.schema.EntitySchemaContract;
-import io.evitadb.exception.EvitaInternalError;
import io.evitadb.exception.EvitaInvalidUsageException;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.utils.ArrayUtils;
import javax.annotation.Nonnull;
@@ -224,7 +224,7 @@ public T addMutation(@Nonnull AttributeMutation localMutation) {
this.attributeMutations.put(attributeKey, new UpsertAttributeMutation(attributeKey, Objects.requireNonNull(updatedValue.value())));
}
} else {
- throw new EvitaInternalError("Unknown Evita price mutation: `" + localMutation.getClass() + "`!");
+ throw new GenericEvitaInternalError("Unknown Evita price mutation: `" + localMutation.getClass() + "`!");
}
//noinspection unchecked
return (T) this;
diff --git a/evita_api/src/main/java/io/evitadb/api/requestResponse/data/structure/ExistingEntityBuilder.java b/evita_api/src/main/java/io/evitadb/api/requestResponse/data/structure/ExistingEntityBuilder.java
index f0cc81321..8d4370f24 100644
--- a/evita_api/src/main/java/io/evitadb/api/requestResponse/data/structure/ExistingEntityBuilder.java
+++ b/evita_api/src/main/java/io/evitadb/api/requestResponse/data/structure/ExistingEntityBuilder.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023
+ * Copyright (c) 2023-2024
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -61,7 +61,7 @@
import io.evitadb.api.requestResponse.schema.EntitySchemaContract;
import io.evitadb.api.requestResponse.schema.ReferenceSchemaContract;
import io.evitadb.dataType.DateTimeRange;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.utils.Assert;
import lombok.Getter;
import lombok.experimental.Delegate;
@@ -196,7 +196,7 @@ public void addMutation(@Nonnull LocalMutation, ?> localMutation) {
this.pricesBuilder.addMutation(innerRecordHandlingMutation);
} else {
// SHOULD NOT EVER HAPPEN
- throw new EvitaInternalError("Unknown mutation: " + localMutation.getClass());
+ throw new GenericEvitaInternalError("Unknown mutation: " + localMutation.getClass());
}
}
diff --git a/evita_api/src/main/java/io/evitadb/api/requestResponse/data/structure/ExistingPricesBuilder.java b/evita_api/src/main/java/io/evitadb/api/requestResponse/data/structure/ExistingPricesBuilder.java
index ac9760741..cb7c78149 100644
--- a/evita_api/src/main/java/io/evitadb/api/requestResponse/data/structure/ExistingPricesBuilder.java
+++ b/evita_api/src/main/java/io/evitadb/api/requestResponse/data/structure/ExistingPricesBuilder.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023
+ * Copyright (c) 2023-2024
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -40,7 +40,7 @@
import io.evitadb.api.requestResponse.data.structure.predicate.PriceContractSerializablePredicate;
import io.evitadb.api.requestResponse.schema.EntitySchemaContract;
import io.evitadb.dataType.DateTimeRange;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.utils.ArrayUtils;
import io.evitadb.utils.Assert;
import io.evitadb.utils.CollectionUtils;
@@ -136,7 +136,7 @@ public void addMutation(@Nonnull PriceMutation localMutation) {
final RemovePriceMutation mutation = new RemovePriceMutation(priceKey);
this.priceMutations.put(priceKey, mutation);
} else {
- throw new EvitaInternalError("Unknown Evita price mutation: `" + localMutation.getClass() + "`!");
+ throw new GenericEvitaInternalError("Unknown Evita price mutation: `" + localMutation.getClass() + "`!");
}
}
diff --git a/evita_api/src/main/java/io/evitadb/api/requestResponse/data/structure/Prices.java b/evita_api/src/main/java/io/evitadb/api/requestResponse/data/structure/Prices.java
index fd5caffbe..240a6ca00 100644
--- a/evita_api/src/main/java/io/evitadb/api/requestResponse/data/structure/Prices.java
+++ b/evita_api/src/main/java/io/evitadb/api/requestResponse/data/structure/Prices.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023
+ * Copyright (c) 2023-2024
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -38,7 +38,7 @@
import io.evitadb.api.requestResponse.data.Versioned;
import io.evitadb.api.requestResponse.data.structure.Price.PriceKey;
import io.evitadb.api.requestResponse.schema.EntitySchemaContract;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.utils.Assert;
import lombok.EqualsAndHashCode;
import lombok.Getter;
@@ -136,7 +136,7 @@ public Prices(
Collectors.toMap(
PriceContract::priceKey, Function.identity(),
(oldValue, newValue) -> {
- throw new EvitaInternalError("Duplicate price key " + oldValue.priceKey());
+ throw new GenericEvitaInternalError("Duplicate price key " + oldValue.priceKey());
},
() -> new LinkedHashMap<>(prices.size())
)
@@ -171,7 +171,7 @@ public Prices(
Collectors.toMap(
PriceContract::priceKey, Function.identity(),
(oldValue, newValue) -> {
- throw new EvitaInternalError("Duplicate price key " + oldValue.priceKey());
+ throw new GenericEvitaInternalError("Duplicate price key " + oldValue.priceKey());
},
() -> new LinkedHashMap<>(prices.size())
)
diff --git a/evita_api/src/main/java/io/evitadb/api/requestResponse/extraResult/FacetSummary.java b/evita_api/src/main/java/io/evitadb/api/requestResponse/extraResult/FacetSummary.java
index d697e7fdc..8048d7a5f 100644
--- a/evita_api/src/main/java/io/evitadb/api/requestResponse/extraResult/FacetSummary.java
+++ b/evita_api/src/main/java/io/evitadb/api/requestResponse/extraResult/FacetSummary.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023
+ * Copyright (c) 2023-2024
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -36,7 +36,7 @@
import io.evitadb.api.requestResponse.schema.NamedSchemaContract;
import io.evitadb.api.requestResponse.schema.ReferenceSchemaContract;
import io.evitadb.dataType.EvitaDataTypes;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.utils.Assert;
import io.evitadb.utils.PrettyPrintable;
import lombok.AccessLevel;
@@ -105,7 +105,7 @@ public FacetSummary(@Nonnull Map> refer
it -> it.getGroupEntity().getPrimaryKey(),
Function.identity(),
(o, o2) -> {
- throw new EvitaInternalError(
+ throw new GenericEvitaInternalError(
"Unexpected duplicate facet group statistics."
);
},
@@ -140,7 +140,7 @@ public FacetSummary(@Nonnull Collection referenceStatistic
group -> group.getGroupEntity().getPrimaryKey(),
Function.identity(),
(o, o2) -> {
- throw new EvitaInternalError(
+ throw new GenericEvitaInternalError(
"There is already facet group for reference `" + it.getKey() +
"` with id `" + o.getGroupEntity().getPrimaryKey() + "`."
);
@@ -563,7 +563,7 @@ public FacetGroupStatistics(
it -> it.getFacetEntity().getPrimaryKey(),
Function.identity(),
(facetStatistics1, facetStatistics2) -> {
- throw new EvitaInternalError("Statistics are expected to be unique!");
+ throw new GenericEvitaInternalError("Statistics are expected to be unique!");
},
LinkedHashMap::new
)
diff --git a/evita_api/src/main/java/io/evitadb/api/requestResponse/schema/builder/AbstractAttributeSchemaBuilder.java b/evita_api/src/main/java/io/evitadb/api/requestResponse/schema/builder/AbstractAttributeSchemaBuilder.java
index 4c612b09a..e24dbbb83 100644
--- a/evita_api/src/main/java/io/evitadb/api/requestResponse/schema/builder/AbstractAttributeSchemaBuilder.java
+++ b/evita_api/src/main/java/io/evitadb/api/requestResponse/schema/builder/AbstractAttributeSchemaBuilder.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023
+ * Copyright (c) 2023-2024
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -42,7 +42,7 @@
import io.evitadb.api.requestResponse.schema.mutation.attribute.SetAttributeSchemaUniqueMutation;
import io.evitadb.dataType.EvitaDataTypes;
import io.evitadb.dataType.Predecessor;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.utils.Assert;
import io.evitadb.utils.ReflectionLookup;
@@ -394,7 +394,7 @@ public S toInstance() {
final AttributeSchemaMutation mutation = attributeMutations.get(i);
currentSchema = mutation.mutate(null, currentSchema, getAttributeSchemaType());
if (currentSchema == null) {
- throw new EvitaInternalError("Attribute unexpectedly removed from inside!");
+ throw new GenericEvitaInternalError("Attribute unexpectedly removed from inside!");
}
}
validate(currentSchema);
diff --git a/evita_api/src/main/java/io/evitadb/api/requestResponse/schema/builder/AssociatedDataSchemaBuilder.java b/evita_api/src/main/java/io/evitadb/api/requestResponse/schema/builder/AssociatedDataSchemaBuilder.java
index 59d083dd3..c03b9d1cc 100644
--- a/evita_api/src/main/java/io/evitadb/api/requestResponse/schema/builder/AssociatedDataSchemaBuilder.java
+++ b/evita_api/src/main/java/io/evitadb/api/requestResponse/schema/builder/AssociatedDataSchemaBuilder.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023
+ * Copyright (c) 2023-2024
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -37,7 +37,7 @@
import io.evitadb.api.requestResponse.schema.mutation.associatedData.ModifyAssociatedDataSchemaDescriptionMutation;
import io.evitadb.api.requestResponse.schema.mutation.associatedData.SetAssociatedDataSchemaLocalizedMutation;
import io.evitadb.api.requestResponse.schema.mutation.associatedData.SetAssociatedDataSchemaNullableMutation;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import lombok.experimental.Delegate;
import javax.annotation.Nonnull;
@@ -232,7 +232,7 @@ public AssociatedDataSchemaContract toInstance() {
final EntitySchemaMutation mutation = this.mutations.get(i);
currentSchema = ((AssociatedDataSchemaMutation) mutation).mutate(currentSchema);
if (currentSchema == null) {
- throw new EvitaInternalError("Attribute unexpectedly removed from inside!");
+ throw new GenericEvitaInternalError("Attribute unexpectedly removed from inside!");
}
}
this.updatedSchema = currentSchema;
@@ -253,4 +253,4 @@ public Collection toMutation() {
return this.mutations;
}
-}
\ No newline at end of file
+}
diff --git a/evita_api/src/main/java/io/evitadb/api/requestResponse/schema/builder/InternalCatalogSchemaBuilder.java b/evita_api/src/main/java/io/evitadb/api/requestResponse/schema/builder/InternalCatalogSchemaBuilder.java
index e4608f98b..4a629aedd 100644
--- a/evita_api/src/main/java/io/evitadb/api/requestResponse/schema/builder/InternalCatalogSchemaBuilder.java
+++ b/evita_api/src/main/java/io/evitadb/api/requestResponse/schema/builder/InternalCatalogSchemaBuilder.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023
+ * Copyright (c) 2023-2024
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -45,7 +45,7 @@
import io.evitadb.api.requestResponse.schema.mutation.catalog.ModifyCatalogSchemaMutation;
import io.evitadb.api.requestResponse.schema.mutation.catalog.MutationEntitySchemaAccessor;
import io.evitadb.dataType.EvitaDataTypes;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.utils.Assert;
import io.evitadb.utils.NamingConvention;
import lombok.experimental.Delegate;
@@ -337,7 +337,7 @@ public CatalogSchemaContract toInstance() {
final LocalCatalogSchemaMutation mutation = this.mutations.get(i);
final CatalogSchemaWithImpactOnEntitySchemas mutationImpact = mutation.mutate(currentSchema, updatedEntitySchemaAccessor);
if (mutationImpact == null || mutationImpact.updatedCatalogSchema() == null) {
- throw new EvitaInternalError("Catalog schema unexpectedly removed from inside!");
+ throw new GenericEvitaInternalError("Catalog schema unexpectedly removed from inside!");
}
currentSchema = mutationImpact.updatedCatalogSchema();
}
diff --git a/evita_api/src/main/java/io/evitadb/api/requestResponse/schema/builder/InternalEntitySchemaBuilder.java b/evita_api/src/main/java/io/evitadb/api/requestResponse/schema/builder/InternalEntitySchemaBuilder.java
index 474f4e2f4..838dbece9 100644
--- a/evita_api/src/main/java/io/evitadb/api/requestResponse/schema/builder/InternalEntitySchemaBuilder.java
+++ b/evita_api/src/main/java/io/evitadb/api/requestResponse/schema/builder/InternalEntitySchemaBuilder.java
@@ -45,7 +45,7 @@
import io.evitadb.dataType.ClassifierType;
import io.evitadb.dataType.ComplexDataObject;
import io.evitadb.dataType.EvitaDataTypes;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.utils.ClassifierUtils;
import io.evitadb.utils.NamingConvention;
import lombok.experimental.Delegate;
@@ -736,7 +736,7 @@ public EntitySchemaContract toInstance() {
final EntitySchemaMutation mutation = this.mutations.get(i);
currentSchema = mutation.mutate(catalogSchemaAccessor.get(), currentSchema);
if (currentSchema == null) {
- throw new EvitaInternalError("Catalog schema unexpectedly removed from inside!");
+ throw new GenericEvitaInternalError("Catalog schema unexpectedly removed from inside!");
}
}
this.updatedSchema = currentSchema;
diff --git a/evita_api/src/main/java/io/evitadb/api/requestResponse/schema/builder/ReferenceSchemaBuilder.java b/evita_api/src/main/java/io/evitadb/api/requestResponse/schema/builder/ReferenceSchemaBuilder.java
index 2ed87e9d4..88c49873d 100644
--- a/evita_api/src/main/java/io/evitadb/api/requestResponse/schema/builder/ReferenceSchemaBuilder.java
+++ b/evita_api/src/main/java/io/evitadb/api/requestResponse/schema/builder/ReferenceSchemaBuilder.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023
+ * Copyright (c) 2023-2024
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -48,7 +48,7 @@
import io.evitadb.api.requestResponse.schema.mutation.reference.SetReferenceSchemaFacetedMutation;
import io.evitadb.api.requestResponse.schema.mutation.reference.SetReferenceSchemaIndexedMutation;
import io.evitadb.api.requestResponse.schema.mutation.sortableAttributeCompound.RemoveSortableAttributeCompoundSchemaMutation;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.utils.Assert;
import lombok.experimental.Delegate;
@@ -457,7 +457,7 @@ public ReferenceSchemaContract toInstance() {
final EntitySchemaMutation mutation = this.mutations.get(i);
currentSchema = ((ReferenceSchemaMutation) mutation).mutate(entitySchema, currentSchema);
if (currentSchema == null) {
- throw new EvitaInternalError("Attribute unexpectedly removed from inside!");
+ throw new GenericEvitaInternalError("Attribute unexpectedly removed from inside!");
}
}
this.updatedSchema = currentSchema;
diff --git a/evita_api/src/main/java/io/evitadb/api/requestResponse/schema/builder/SortableAttributeCompoundSchemaBuilder.java b/evita_api/src/main/java/io/evitadb/api/requestResponse/schema/builder/SortableAttributeCompoundSchemaBuilder.java
index c195f9723..941ffd6e2 100644
--- a/evita_api/src/main/java/io/evitadb/api/requestResponse/schema/builder/SortableAttributeCompoundSchemaBuilder.java
+++ b/evita_api/src/main/java/io/evitadb/api/requestResponse/schema/builder/SortableAttributeCompoundSchemaBuilder.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023
+ * Copyright (c) 2023-2024
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -37,7 +37,7 @@
import io.evitadb.api.requestResponse.schema.mutation.sortableAttributeCompound.CreateSortableAttributeCompoundSchemaMutation;
import io.evitadb.api.requestResponse.schema.mutation.sortableAttributeCompound.ModifySortableAttributeCompoundSchemaDeprecationNoticeMutation;
import io.evitadb.api.requestResponse.schema.mutation.sortableAttributeCompound.ModifySortableAttributeCompoundSchemaDescriptionMutation;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import lombok.experimental.Delegate;
import javax.annotation.Nonnull;
@@ -185,7 +185,7 @@ public SortableAttributeCompoundSchemaContract toInstance() {
final EntitySchemaMutation mutation = this.mutations.get(i);
currentSchema = ((SortableAttributeCompoundSchemaMutation) mutation).mutate(entitySchema, referenceSchema, currentSchema);
if (currentSchema == null) {
- throw new EvitaInternalError("Attribute unexpectedly removed from inside!");
+ throw new GenericEvitaInternalError("Attribute unexpectedly removed from inside!");
}
}
this.updatedSchema = currentSchema;
diff --git a/evita_api/src/main/java/io/evitadb/api/requestResponse/schema/mutation/associatedData/CreateAssociatedDataSchemaMutation.java b/evita_api/src/main/java/io/evitadb/api/requestResponse/schema/mutation/associatedData/CreateAssociatedDataSchemaMutation.java
index cd43b5bb9..0456ca906 100644
--- a/evita_api/src/main/java/io/evitadb/api/requestResponse/schema/mutation/associatedData/CreateAssociatedDataSchemaMutation.java
+++ b/evita_api/src/main/java/io/evitadb/api/requestResponse/schema/mutation/associatedData/CreateAssociatedDataSchemaMutation.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023
+ * Copyright (c) 2023-2024
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -39,7 +39,7 @@
import io.evitadb.dataType.ComplexDataObject;
import io.evitadb.dataType.EvitaDataTypes;
import io.evitadb.dataType.Predecessor;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.utils.Assert;
import io.evitadb.utils.ClassifierUtils;
import lombok.EqualsAndHashCode;
@@ -106,7 +106,7 @@ public MutationCombinationResult combineWith(@Nonnull Cata
if (existingMutation instanceof RemoveAssociatedDataSchemaMutation removeAssociatedDataSchema && Objects.equals(removeAssociatedDataSchema.getName(), name)) {
final AssociatedDataSchemaContract createdVersion = mutate(null);
final AssociatedDataSchemaContract existingVersion = currentEntitySchema.getAssociatedData(name)
- .orElseThrow(() -> new EvitaInternalError("Sanity check!"));
+ .orElseThrow(() -> new GenericEvitaInternalError("Sanity check!"));
return new MutationCombinationResult<>(
null,
diff --git a/evita_api/src/main/java/io/evitadb/api/requestResponse/schema/mutation/attribute/SetAttributeSchemaGloballyUniqueMutation.java b/evita_api/src/main/java/io/evitadb/api/requestResponse/schema/mutation/attribute/SetAttributeSchemaGloballyUniqueMutation.java
index 4029c6d36..f31229cec 100644
--- a/evita_api/src/main/java/io/evitadb/api/requestResponse/schema/mutation/attribute/SetAttributeSchemaGloballyUniqueMutation.java
+++ b/evita_api/src/main/java/io/evitadb/api/requestResponse/schema/mutation/attribute/SetAttributeSchemaGloballyUniqueMutation.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023
+ * Copyright (c) 2023-2024
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -35,7 +35,7 @@
import io.evitadb.api.requestResponse.schema.mutation.CombinableCatalogSchemaMutation;
import io.evitadb.api.requestResponse.schema.mutation.CombinableEntitySchemaMutation;
import io.evitadb.api.requestResponse.schema.mutation.LocalCatalogSchemaMutation;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.utils.Assert;
import lombok.EqualsAndHashCode;
import lombok.Getter;
@@ -102,7 +102,7 @@ public S mutate(@Nullable CatalogSchemaContr
globalAttributeSchema.getIndexedDecimalPlaces()
);
} else {
- throw new EvitaInternalError("Unexpected input!");
+ throw new GenericEvitaInternalError("Unexpected input!");
}
}
@@ -129,4 +129,4 @@ public String toString() {
"uniqueGlobally=" + uniqueGlobally;
}
-}
\ No newline at end of file
+}
diff --git a/evita_api/src/main/java/io/evitadb/api/requestResponse/schema/mutation/catalog/ModifyEntitySchemaMutation.java b/evita_api/src/main/java/io/evitadb/api/requestResponse/schema/mutation/catalog/ModifyEntitySchemaMutation.java
index 4d1f9bdcc..da5e60f25 100644
--- a/evita_api/src/main/java/io/evitadb/api/requestResponse/schema/mutation/catalog/ModifyEntitySchemaMutation.java
+++ b/evita_api/src/main/java/io/evitadb/api/requestResponse/schema/mutation/catalog/ModifyEntitySchemaMutation.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023
+ * Copyright (c) 2023-2024
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,7 +31,7 @@
import io.evitadb.api.requestResponse.schema.mutation.CombinableCatalogSchemaMutation;
import io.evitadb.api.requestResponse.schema.mutation.EntitySchemaMutation;
import io.evitadb.api.requestResponse.schema.mutation.LocalCatalogSchemaMutation;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import lombok.EqualsAndHashCode;
import lombok.Getter;
@@ -98,7 +98,7 @@ public CatalogSchemaWithImpactOnEntitySchemas mutate(@Nullable CatalogSchemaCont
.ifPresentOrElse(
mutationEntitySchemaAccessor::addUpsertedEntitySchema,
() -> {
- throw new EvitaInternalError("Entity schema not found: " + entityType);
+ throw new GenericEvitaInternalError("Entity schema not found: " + entityType);
}
);
}
diff --git a/evita_api/src/main/java/io/evitadb/api/requestResponse/schema/mutation/catalog/ModifyEntitySchemaNameMutation.java b/evita_api/src/main/java/io/evitadb/api/requestResponse/schema/mutation/catalog/ModifyEntitySchemaNameMutation.java
index 5ac2bf987..1951f9127 100644
--- a/evita_api/src/main/java/io/evitadb/api/requestResponse/schema/mutation/catalog/ModifyEntitySchemaNameMutation.java
+++ b/evita_api/src/main/java/io/evitadb/api/requestResponse/schema/mutation/catalog/ModifyEntitySchemaNameMutation.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023
+ * Copyright (c) 2023-2024
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -33,7 +33,7 @@
import io.evitadb.api.requestResponse.schema.mutation.CombinableEntitySchemaMutation;
import io.evitadb.api.requestResponse.schema.mutation.EntitySchemaMutation;
import io.evitadb.api.requestResponse.schema.mutation.LocalCatalogSchemaMutation;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.utils.Assert;
import io.evitadb.utils.NamingConvention;
import lombok.AllArgsConstructor;
@@ -73,7 +73,7 @@ public CatalogSchemaWithImpactOnEntitySchemas mutate(@Nullable CatalogSchemaCont
.ifPresentOrElse(
it -> mutationEntitySchemaAccessor.replaceEntitySchema(name, it),
() -> {
- throw new EvitaInternalError("Entity schema not found: " + name);
+ throw new GenericEvitaInternalError("Entity schema not found: " + name);
}
);
}
diff --git a/evita_api/src/main/java/io/evitadb/api/requestResponse/schema/mutation/catalog/RemoveEntitySchemaMutation.java b/evita_api/src/main/java/io/evitadb/api/requestResponse/schema/mutation/catalog/RemoveEntitySchemaMutation.java
index facce3856..327c33a1f 100644
--- a/evita_api/src/main/java/io/evitadb/api/requestResponse/schema/mutation/catalog/RemoveEntitySchemaMutation.java
+++ b/evita_api/src/main/java/io/evitadb/api/requestResponse/schema/mutation/catalog/RemoveEntitySchemaMutation.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023
+ * Copyright (c) 2023-2024
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -30,7 +30,7 @@
import io.evitadb.api.requestResponse.schema.dto.EntitySchemaProvider;
import io.evitadb.api.requestResponse.schema.mutation.CatalogSchemaMutation;
import io.evitadb.api.requestResponse.schema.mutation.LocalCatalogSchemaMutation;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.Getter;
@@ -65,7 +65,7 @@ public CatalogSchemaWithImpactOnEntitySchemas mutate(@Nullable CatalogSchemaCont
.ifPresentOrElse(
it -> mutationEntitySchemaAccessor.removeEntitySchema(name),
() -> {
- throw new EvitaInternalError("Entity schema not found: " + name);
+ throw new GenericEvitaInternalError("Entity schema not found: " + name);
}
);
}
diff --git a/evita_api/src/main/java/io/evitadb/api/requestResponse/schema/mutation/reference/CreateReferenceSchemaMutation.java b/evita_api/src/main/java/io/evitadb/api/requestResponse/schema/mutation/reference/CreateReferenceSchemaMutation.java
index c2bb17c50..3512ab002 100644
--- a/evita_api/src/main/java/io/evitadb/api/requestResponse/schema/mutation/reference/CreateReferenceSchemaMutation.java
+++ b/evita_api/src/main/java/io/evitadb/api/requestResponse/schema/mutation/reference/CreateReferenceSchemaMutation.java
@@ -39,7 +39,7 @@
import io.evitadb.api.requestResponse.schema.mutation.attribute.RemoveAttributeSchemaMutation;
import io.evitadb.api.requestResponse.schema.mutation.sortableAttributeCompound.RemoveSortableAttributeCompoundSchemaMutation;
import io.evitadb.dataType.ClassifierType;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.utils.Assert;
import io.evitadb.utils.ClassifierUtils;
import lombok.EqualsAndHashCode;
@@ -115,7 +115,7 @@ public MutationCombinationResult combineWith(@Nonnull Cata
if (existingMutation instanceof RemoveReferenceSchemaMutation removeReferenceMutation && Objects.equals(removeReferenceMutation.getName(), name)) {
final ReferenceSchemaContract createdVersion = mutate(currentEntitySchema, null);
final ReferenceSchemaContract existingVersion = currentEntitySchema.getReference(name)
- .orElseThrow(() -> new EvitaInternalError("Sanity check!"));
+ .orElseThrow(() -> new GenericEvitaInternalError("Sanity check!"));
return new MutationCombinationResult<>(
null,
diff --git a/evita_api/src/main/java/io/evitadb/api/trace/TracingContextProvider.java b/evita_api/src/main/java/io/evitadb/api/trace/TracingContextProvider.java
index 3b64d543d..ae92f9965 100644
--- a/evita_api/src/main/java/io/evitadb/api/trace/TracingContextProvider.java
+++ b/evita_api/src/main/java/io/evitadb/api/trace/TracingContextProvider.java
@@ -24,6 +24,7 @@
package io.evitadb.api.trace;
import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import javax.annotation.Nonnull;
import java.util.List;
@@ -47,7 +48,7 @@ public class TracingContextProvider {
.map(Provider::get)
.toList();
if (collectedContexts.size() > 1) {
- throw new EvitaInternalError("There are multiple registered implementations of TracingContext.");
+ throw new GenericEvitaInternalError("There are multiple registered implementations of TracingContext.");
}
if (collectedContexts.size() == 1) {
TRACING_CONTEXT = collectedContexts.stream().findFirst().get();
diff --git a/evita_common/src/main/java/io/evitadb/dataType/EvitaDataTypes.java b/evita_common/src/main/java/io/evitadb/dataType/EvitaDataTypes.java
index 6948e22fd..47fb3469c 100644
--- a/evita_common/src/main/java/io/evitadb/dataType/EvitaDataTypes.java
+++ b/evita_common/src/main/java/io/evitadb/dataType/EvitaDataTypes.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023
+ * Copyright (c) 2023-2024
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,7 +26,7 @@
import io.evitadb.dataType.data.DataItem;
import io.evitadb.dataType.exception.InconvertibleDataTypeException;
import io.evitadb.dataType.exception.UnsupportedDataTypeException;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.utils.Assert;
import io.evitadb.utils.MemoryMeasuringConstants;
import io.evitadb.utils.NumberUtils;
@@ -706,7 +706,7 @@ else if (value instanceof Number) {
} else if (value instanceof Predecessor) {
return value.toString();
} else if (value == null) {
- throw new EvitaInternalError(
+ throw new GenericEvitaInternalError(
"Null argument value should never ever happen. Null values are excluded in constructor of the class!"
);
}
diff --git a/evita_common/src/main/java/io/evitadb/exception/EvitaInternalError.java b/evita_common/src/main/java/io/evitadb/exception/EvitaInternalError.java
index 3f646f62b..81a47dc8f 100644
--- a/evita_common/src/main/java/io/evitadb/exception/EvitaInternalError.java
+++ b/evita_common/src/main/java/io/evitadb/exception/EvitaInternalError.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023
+ * Copyright (c) 2023-2024
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -36,20 +36,12 @@
*
* @author Jan Novotný (novotny@fg.cz), FG Forrest a.s. (c) 2022
*/
-public class EvitaInternalError extends IllegalStateException implements EvitaError {
+public abstract class EvitaInternalError extends IllegalStateException implements EvitaError {
@Serial private static final long serialVersionUID = -1040832658535384105L;
@Getter private final String publicMessage;
@Getter private final String errorCode;
- /**
- * Method is targeted to be used on the client.
- */
- @Nonnull
- public static EvitaInternalError createExceptionWithErrorCode(@Nonnull String publicMessage, @Nonnull String errorCode) {
- return new EvitaInternalError(publicMessage, publicMessage, errorCode);
- }
-
- public EvitaInternalError(@Nonnull String privateMessage, @Nonnull String publicMessage) {
+ protected EvitaInternalError(@Nonnull String privateMessage, @Nonnull String publicMessage) {
super(privateMessage);
this.publicMessage = publicMessage;
final StackTraceElement stackTraceElement = getProperStackLine();
@@ -59,11 +51,11 @@ public EvitaInternalError(@Nonnull String privateMessage, @Nonnull String public
stackTraceElement.getLineNumber();
}
- public EvitaInternalError(@Nonnull String publicMessage) {
+ protected EvitaInternalError(@Nonnull String publicMessage) {
this(publicMessage, publicMessage);
}
- public EvitaInternalError(@Nonnull String privateMessage, @Nonnull String publicMessage, @Nonnull Throwable cause) {
+ protected EvitaInternalError(@Nonnull String privateMessage, @Nonnull String publicMessage, @Nonnull Throwable cause) {
super(privateMessage, cause);
this.publicMessage = publicMessage;
final StackTraceElement stackTraceElement = getProperStackLine();
@@ -72,11 +64,11 @@ public EvitaInternalError(@Nonnull String privateMessage, @Nonnull String public
stackTraceElement.getLineNumber();
}
- public EvitaInternalError(@Nonnull String publicMessage, @Nonnull Throwable cause) {
+ protected EvitaInternalError(@Nonnull String publicMessage, @Nonnull Throwable cause) {
this(publicMessage, publicMessage, cause);
}
- private EvitaInternalError(@Nonnull String privateMessage, @Nonnull String publicMessage, @Nonnull String errorCode) {
+ protected EvitaInternalError(@Nonnull String privateMessage, @Nonnull String publicMessage, @Nonnull String errorCode) {
super(privateMessage);
this.publicMessage = publicMessage;
this.errorCode = errorCode;
diff --git a/evita_common/src/main/java/io/evitadb/exception/GenericEvitaInternalError.java b/evita_common/src/main/java/io/evitadb/exception/GenericEvitaInternalError.java
new file mode 100644
index 000000000..b50bc3d53
--- /dev/null
+++ b/evita_common/src/main/java/io/evitadb/exception/GenericEvitaInternalError.java
@@ -0,0 +1,64 @@
+/*
+ *
+ * _ _ ____ ____
+ * _____ _(_) |_ __ _| _ \| __ )
+ * / _ \ \ / / | __/ _` | | | | _ \
+ * | __/\ V /| | || (_| | |_| | |_) |
+ * \___| \_/ |_|\__\__,_|____/|____/
+ *
+ * Copyright (c) 2024
+ *
+ * Licensed under the Business Source License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://github.com/FgForrest/evitaDB/blob/main/LICENSE
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package io.evitadb.exception;
+
+import javax.annotation.Nonnull;
+import java.io.Serial;
+
+/**
+ * Uncategorized evitaDB internal error. All details must be passed in the messages.
+ *
+ * @author Jan Novotný (novotny@fg.cz), FG Forrest a.s. (c) 2024
+ */
+public class GenericEvitaInternalError extends EvitaInternalError {
+ @Serial private static final long serialVersionUID = 7967637521505334780L;
+
+ /**
+ * Method is targeted to be used on the client.
+ */
+ @Nonnull
+ public static EvitaInternalError createExceptionWithErrorCode(@Nonnull String publicMessage, @Nonnull String errorCode) {
+ return new GenericEvitaInternalError(publicMessage, publicMessage, errorCode);
+ }
+
+ public GenericEvitaInternalError(@Nonnull String privateMessage, @Nonnull String publicMessage) {
+ super(privateMessage, publicMessage);
+ }
+
+ public GenericEvitaInternalError(@Nonnull String publicMessage) {
+ super(publicMessage);
+ }
+
+ public GenericEvitaInternalError(@Nonnull String privateMessage, @Nonnull String publicMessage, @Nonnull Throwable cause) {
+ super(privateMessage, publicMessage, cause);
+ }
+
+ public GenericEvitaInternalError(@Nonnull String publicMessage, @Nonnull Throwable cause) {
+ super(publicMessage, cause);
+ }
+
+ public GenericEvitaInternalError(@Nonnull String privateMessage, @Nonnull String publicMessage, @Nonnull String errorCode) {
+ super(privateMessage, publicMessage, errorCode);
+ }
+}
diff --git a/evita_common/src/main/java/io/evitadb/utils/Assert.java b/evita_common/src/main/java/io/evitadb/utils/Assert.java
index 5e15135f1..417182d9a 100644
--- a/evita_common/src/main/java/io/evitadb/utils/Assert.java
+++ b/evita_common/src/main/java/io/evitadb/utils/Assert.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023
+ * Copyright (c) 2023-2024
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,7 @@
import io.evitadb.exception.EvitaInternalError;
import io.evitadb.exception.EvitaInvalidUsageException;
+import io.evitadb.exception.GenericEvitaInternalError;
import javax.annotation.Nonnull;
import java.util.function.Supplier;
@@ -85,7 +86,7 @@ public static void notNull(Object object, @Nonnull InvalidUsageExceptionFactory<
*/
public static void isPremiseValid(boolean theValue, @Nonnull String message) {
if (!theValue) {
- throw new EvitaInternalError(message);
+ throw new GenericEvitaInternalError(message);
}
}
@@ -94,7 +95,7 @@ public static void isPremiseValid(boolean theValue, @Nonnull String message) {
*/
public static void isPremiseValid(boolean theValue, @Nonnull Supplier message) {
if (!theValue) {
- throw new EvitaInternalError(message.get());
+ throw new GenericEvitaInternalError(message.get());
}
}
diff --git a/evita_common/src/main/java/io/evitadb/utils/ClassUtils.java b/evita_common/src/main/java/io/evitadb/utils/ClassUtils.java
index 54100d1c7..89a6b9eba 100644
--- a/evita_common/src/main/java/io/evitadb/utils/ClassUtils.java
+++ b/evita_common/src/main/java/io/evitadb/utils/ClassUtils.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023
+ * Copyright (c) 2023-2024
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,7 +23,7 @@
package io.evitadb.utils;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.function.ExceptionRethrowingSupplier;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
@@ -82,7 +82,7 @@ public static Optional whenPresentOnClasspath(@Nonnull String className,
try {
return of(factory.get());
} catch (Exception e) {
- throw new EvitaInternalError(
+ throw new GenericEvitaInternalError(
"Failed to evaluate lambda expression when a class `" + className + "` is present on classpath.",
"Internal error.", e
);
diff --git a/evita_common/src/main/java/io/evitadb/utils/NamingConvention.java b/evita_common/src/main/java/io/evitadb/utils/NamingConvention.java
index d6c7d470e..9e8f131ef 100644
--- a/evita_common/src/main/java/io/evitadb/utils/NamingConvention.java
+++ b/evita_common/src/main/java/io/evitadb/utils/NamingConvention.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023
+ * Copyright (c) 2023-2024
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,7 +23,7 @@
package io.evitadb.utils;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import javax.annotation.Nonnull;
import java.util.Arrays;
@@ -86,7 +86,7 @@ public static Map generate(@Nonnull String name) {
Collectors.toMap(
Function.identity(),
it -> StringUtils.toSpecificCase(name, it),
- (s, s2) -> { throw new EvitaInternalError("Should not ever occur!"); },
+ (s, s2) -> { throw new GenericEvitaInternalError("Should not ever occur!"); },
LinkedHashMap::new
)
)
diff --git a/evita_engine/src/main/java/io/evitadb/core/Catalog.java b/evita_engine/src/main/java/io/evitadb/core/Catalog.java
index 41ced301d..b0adc50e9 100644
--- a/evita_engine/src/main/java/io/evitadb/core/Catalog.java
+++ b/evita_engine/src/main/java/io/evitadb/core/Catalog.java
@@ -88,7 +88,7 @@
import io.evitadb.core.transaction.stage.TrunkIncorporationTransactionStage;
import io.evitadb.core.transaction.stage.WalAppendingTransactionStage;
import io.evitadb.dataType.PaginatedList;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.index.CatalogIndex;
import io.evitadb.index.CatalogIndexKey;
import io.evitadb.index.EntityIndex;
@@ -1257,7 +1257,7 @@ private TrunkIncorporationTransactionStage getTrunkIncorporationStage() {
}
}
}
- throw new EvitaInternalError(
+ throw new GenericEvitaInternalError(
"TrunkIncorporationTransactionStage is not present in the transactional pipeline!"
);
}
@@ -1583,7 +1583,7 @@ public CatalogIndex getIndexIfExists(@Nonnull CatalogIndexKey entityIndexKey) {
*/
@Override
public void removeIndex(@Nonnull CatalogIndexKey entityIndexKey) {
- throw new EvitaInternalError("Global catalog index is not expected to be removed!");
+ throw new GenericEvitaInternalError("Global catalog index is not expected to be removed!");
}
}
diff --git a/evita_engine/src/main/java/io/evitadb/core/EntityCollection.java b/evita_engine/src/main/java/io/evitadb/core/EntityCollection.java
index 014eb9738..df9e98525 100644
--- a/evita_engine/src/main/java/io/evitadb/core/EntityCollection.java
+++ b/evita_engine/src/main/java/io/evitadb/core/EntityCollection.java
@@ -93,8 +93,8 @@
import io.evitadb.core.transaction.memory.TransactionalObjectVersion;
import io.evitadb.core.transaction.stage.mutation.VerifiedEntityRemoveMutation;
import io.evitadb.core.transaction.stage.mutation.VerifiedEntityUpsertMutation;
-import io.evitadb.exception.EvitaInternalError;
import io.evitadb.exception.EvitaInvalidUsageException;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.index.EntityIndex;
import io.evitadb.index.EntityIndexKey;
import io.evitadb.index.EntityIndexType;
@@ -1246,7 +1246,7 @@ private TransactionalMap loadIndexes(@Nonnull Entit
entityHeader.globalEntityIndexId(),
this::getInternalSchema,
() -> {
- throw new EvitaInternalError("Global index is currently loading!");
+ throw new GenericEvitaInternalError("Global index is currently loading!");
},
this::getPriceSuperIndex
);
@@ -1640,7 +1640,7 @@ public void removeIndex(@Nonnull EntityIndexKey entityIndexKey) {
entityIndexKey, EntityCollection.this.indexes::remove
);
if (removedIndex == null) {
- throw new EvitaInternalError("Entity index for key " + entityIndexKey + " doesn't exists!");
+ throw new GenericEvitaInternalError("Entity index for key " + entityIndexKey + " doesn't exists!");
} else {
ofNullable(getTransactionalLayerMaintainer())
.ifPresent(removedIndex::removeTransactionalMemoryOfReferencedProducers);
diff --git a/evita_engine/src/main/java/io/evitadb/core/SessionRegistry.java b/evita_engine/src/main/java/io/evitadb/core/SessionRegistry.java
index 627180e39..27810f103 100644
--- a/evita_engine/src/main/java/io/evitadb/core/SessionRegistry.java
+++ b/evita_engine/src/main/java/io/evitadb/core/SessionRegistry.java
@@ -33,6 +33,7 @@
import io.evitadb.dataType.EvitaDataTypes;
import io.evitadb.exception.EvitaInternalError;
import io.evitadb.exception.EvitaInvalidUsageException;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.utils.Assert;
import io.evitadb.utils.CollectionUtils;
import lombok.RequiredArgsConstructor;
@@ -216,7 +217,7 @@ public Object invoke(Object proxy, Method method, Object[] args) {
"Unexpected internal Evita error occurred: " + ex.getCause().getMessage(),
targetException == null ? ex : targetException
);
- throw new EvitaInternalError(
+ throw new GenericEvitaInternalError(
"Unexpected internal Evita error occurred: " + ex.getCause().getMessage(),
"Unexpected internal Evita error occurred.",
targetException == null ? ex : targetException
@@ -224,7 +225,7 @@ public Object invoke(Object proxy, Method method, Object[] args) {
}
} catch (Throwable ex) {
log.error("Unexpected system error occurred: " + ex.getMessage(), ex);
- throw new EvitaInternalError(
+ throw new GenericEvitaInternalError(
"Unexpected system error occurred: " + ex.getMessage(),
"Unexpected system error occurred.",
ex
diff --git a/evita_engine/src/main/java/io/evitadb/core/cache/CacheEden.java b/evita_engine/src/main/java/io/evitadb/core/cache/CacheEden.java
index 9532f148a..9b70bc96c 100644
--- a/evita_engine/src/main/java/io/evitadb/core/cache/CacheEden.java
+++ b/evita_engine/src/main/java/io/evitadb/core/cache/CacheEden.java
@@ -37,7 +37,7 @@
import io.evitadb.core.query.response.TransactionalDataRelatedStructure;
import io.evitadb.core.query.sort.CacheableSorter;
import io.evitadb.dataType.array.CompositeLongArray;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.utils.StringUtils;
import lombok.extern.slf4j.Slf4j;
import net.openhft.hashing.LongHashFunction;
@@ -180,7 +180,7 @@ public S getCachedRecord(
} else if (computationalObject instanceof final EntityComputationalObjectAdapter entityWrapper) {
return fetchAndCacheEntity(recordHash, cachedRecord, hashFunction, entityWrapper);
} else {
- throw new EvitaInternalError("Unexpected object in cache `" + computationalObject.getClass() + "`!");
+ throw new GenericEvitaInternalError("Unexpected object in cache `" + computationalObject.getClass() + "`!");
}
}
}
diff --git a/evita_engine/src/main/java/io/evitadb/core/query/QueryContext.java b/evita_engine/src/main/java/io/evitadb/core/query/QueryContext.java
index 885358395..96a583298 100644
--- a/evita_engine/src/main/java/io/evitadb/core/query/QueryContext.java
+++ b/evita_engine/src/main/java/io/evitadb/core/query/QueryContext.java
@@ -66,7 +66,7 @@
import io.evitadb.core.query.extraResult.ExtraResultCacheAccessor;
import io.evitadb.core.query.extraResult.translator.facet.producer.FilteringFormulaPredicate;
import io.evitadb.dataType.array.CompositeIntArray;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.function.TriFunction;
import io.evitadb.index.CatalogIndexKey;
import io.evitadb.index.EntityIndex;
@@ -322,7 +322,7 @@ public void executeInDryRun(@Nonnull Runnable lambda) {
os.writeObject(new Random());
this.frozenRandom = bos.toByteArray();
} catch (IOException e) {
- throw new EvitaInternalError("Unexpected error during debug mode evaluation!", e);
+ throw new GenericEvitaInternalError("Unexpected error during debug mode evaluation!", e);
}
lambda.run();
} finally {
@@ -349,7 +349,7 @@ public Random getRandom() {
try (var is = new ObjectInputStream(new ByteArrayInputStream(it))) {
return (Random) is.readObject();
} catch (IOException | ClassNotFoundException e) {
- throw new EvitaInternalError("Unexpected error during debug mode evaluation!", e);
+ throw new GenericEvitaInternalError("Unexpected error during debug mode evaluation!", e);
}
})
.orElseGet(ThreadLocalRandom::current);
@@ -805,7 +805,7 @@ public Optional getGlobalEntityIndexIfExists() {
public GlobalEntityIndex getGlobalEntityIndex() {
return getGlobalEntityIndexIfExists()
.map(GlobalEntityIndex.class::cast)
- .orElseThrow(() -> new EvitaInternalError("Global index of entity unexpectedly not found!"));
+ .orElseThrow(() -> new GenericEvitaInternalError("Global index of entity unexpectedly not found!"));
}
/**
diff --git a/evita_engine/src/main/java/io/evitadb/core/query/algebra/attribute/AttributeFormula.java b/evita_engine/src/main/java/io/evitadb/core/query/algebra/attribute/AttributeFormula.java
index 61f190db9..4319b588a 100644
--- a/evita_engine/src/main/java/io/evitadb/core/query/algebra/attribute/AttributeFormula.java
+++ b/evita_engine/src/main/java/io/evitadb/core/query/algebra/attribute/AttributeFormula.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023
+ * Copyright (c) 2023-2024
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -30,7 +30,7 @@
import io.evitadb.core.query.algebra.AbstractFormula;
import io.evitadb.core.query.algebra.Formula;
import io.evitadb.core.query.algebra.prefetch.RequirementsDefiner;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.index.bitmap.Bitmap;
import io.evitadb.index.bitmap.EmptyBitmap;
import io.evitadb.utils.Assert;
@@ -121,7 +121,7 @@ protected Bitmap computeInternal() {
} else if (innerFormulas.length == 1) {
return innerFormulas[0].compute();
} else {
- throw new EvitaInternalError(ERROR_SINGLE_FORMULA_EXPECTED);
+ throw new GenericEvitaInternalError(ERROR_SINGLE_FORMULA_EXPECTED);
}
}
diff --git a/evita_engine/src/main/java/io/evitadb/core/query/algebra/price/filteredPriceRecords/FilteredPriceRecords.java b/evita_engine/src/main/java/io/evitadb/core/query/algebra/price/filteredPriceRecords/FilteredPriceRecords.java
index 6c8e77b53..076d4b955 100644
--- a/evita_engine/src/main/java/io/evitadb/core/query/algebra/price/filteredPriceRecords/FilteredPriceRecords.java
+++ b/evita_engine/src/main/java/io/evitadb/core/query/algebra/price/filteredPriceRecords/FilteredPriceRecords.java
@@ -32,7 +32,7 @@
import io.evitadb.dataType.array.CompositeIntArray;
import io.evitadb.dataType.array.CompositeObjectArray;
import io.evitadb.dataType.iterator.BatchArrayIterator;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.index.bitmap.Bitmap;
import io.evitadb.index.bitmap.RoaringBitmapBackedBitmap;
import io.evitadb.index.iterator.RoaringBitmapBatchArrayIterator;
@@ -126,7 +126,7 @@ static FilteredPriceRecords createFromFormulas(
lazyEvaluatedEntityPriceRecords.get()
);
} else {
- throw new EvitaInternalError("Both resolved and lazy price records are present!");
+ throw new GenericEvitaInternalError("Both resolved and lazy price records are present!");
}
}
}
diff --git a/evita_engine/src/main/java/io/evitadb/core/query/algebra/price/termination/PlainPriceTerminationFormulaWithPriceFilter.java b/evita_engine/src/main/java/io/evitadb/core/query/algebra/price/termination/PlainPriceTerminationFormulaWithPriceFilter.java
index 6cddfa272..119921326 100644
--- a/evita_engine/src/main/java/io/evitadb/core/query/algebra/price/termination/PlainPriceTerminationFormulaWithPriceFilter.java
+++ b/evita_engine/src/main/java/io/evitadb/core/query/algebra/price/termination/PlainPriceTerminationFormulaWithPriceFilter.java
@@ -42,7 +42,7 @@
import io.evitadb.core.query.extraResult.translator.histogram.producer.PriceHistogramProducer;
import io.evitadb.dataType.array.CompositeObjectArray;
import io.evitadb.dataType.iterator.BatchArrayIterator;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.index.bitmap.BaseBitmap;
import io.evitadb.index.bitmap.Bitmap;
import io.evitadb.index.bitmap.EmptyBitmap;
@@ -290,7 +290,7 @@ protected Bitmap computeInternal() {
}
if (noPriceFoundAtAll) {
- throw new EvitaInternalError("No price found for entity with id " + entityId + "!");
+ throw new GenericEvitaInternalError("No price found for entity with id " + entityId + "!");
}
}
}
diff --git a/evita_engine/src/main/java/io/evitadb/core/query/algebra/price/translate/PriceIdToEntityIdTranslateFormula.java b/evita_engine/src/main/java/io/evitadb/core/query/algebra/price/translate/PriceIdToEntityIdTranslateFormula.java
index d006330b3..a42c3df0d 100644
--- a/evita_engine/src/main/java/io/evitadb/core/query/algebra/price/translate/PriceIdToEntityIdTranslateFormula.java
+++ b/evita_engine/src/main/java/io/evitadb/core/query/algebra/price/translate/PriceIdToEntityIdTranslateFormula.java
@@ -38,7 +38,7 @@
import io.evitadb.core.query.algebra.utils.visitor.FormulaFinder;
import io.evitadb.core.query.algebra.utils.visitor.FormulaFinder.LookUp;
import io.evitadb.dataType.array.CompositeObjectArray;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.index.bitmap.BaseBitmap;
import io.evitadb.index.bitmap.Bitmap;
import io.evitadb.index.bitmap.EmptyBitmap;
@@ -207,7 +207,7 @@ protected Bitmap computeInternal() {
}
if (!priceIdBitmap.isEmpty()) {
- throw new EvitaInternalError(
+ throw new GenericEvitaInternalError(
"These prices weren't translated to entity id: " + Arrays.toString(priceIdBitmap.getArray())
);
}
diff --git a/evita_engine/src/main/java/io/evitadb/core/query/extraResult/ExtraResultPlanningVisitor.java b/evita_engine/src/main/java/io/evitadb/core/query/extraResult/ExtraResultPlanningVisitor.java
index 08bc69db7..a932f9f07 100644
--- a/evita_engine/src/main/java/io/evitadb/core/query/extraResult/ExtraResultPlanningVisitor.java
+++ b/evita_engine/src/main/java/io/evitadb/core/query/extraResult/ExtraResultPlanningVisitor.java
@@ -81,7 +81,7 @@
import io.evitadb.core.query.sort.OrderByVisitor;
import io.evitadb.core.query.sort.Sorter;
import io.evitadb.core.query.sort.attribute.translator.EntityAttributeExtractor;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.index.EntityIndex;
import io.evitadb.index.GlobalEntityIndex;
import io.evitadb.utils.ArrayUtils;
@@ -480,7 +480,7 @@ public void visit(@Nonnull Constraint> constraint) {
registerProducer(translator.apply(requireConstraint, this));
} else {
// sanity check only
- throw new EvitaInternalError("Should never happen");
+ throw new GenericEvitaInternalError("Should never happen");
}
} else {
@SuppressWarnings("unchecked") final RequireConstraintTranslator translator =
@@ -535,7 +535,7 @@ public final T executeInContext(
@Nonnull
public ProcessingScope getProcessingScope() {
if (isScopeEmpty()) {
- throw new EvitaInternalError("Scope should never be empty");
+ throw new GenericEvitaInternalError("Scope should never be empty");
} else {
return scope.peek();
}
diff --git a/evita_engine/src/main/java/io/evitadb/core/query/extraResult/translator/facet/producer/AbstractFacetFormulaGenerator.java b/evita_engine/src/main/java/io/evitadb/core/query/extraResult/translator/facet/producer/AbstractFacetFormulaGenerator.java
index f48da2799..024a0d7b8 100644
--- a/evita_engine/src/main/java/io/evitadb/core/query/extraResult/translator/facet/producer/AbstractFacetFormulaGenerator.java
+++ b/evita_engine/src/main/java/io/evitadb/core/query/extraResult/translator/facet/producer/AbstractFacetFormulaGenerator.java
@@ -46,7 +46,7 @@
import io.evitadb.core.query.filter.FilterByVisitor;
import io.evitadb.core.query.filter.translator.facet.FacetHavingTranslator;
import io.evitadb.dataType.array.CompositeObjectArray;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.index.bitmap.BaseBitmap;
import io.evitadb.index.bitmap.Bitmap;
import io.evitadb.index.bitmap.EmptyBitmap;
@@ -680,7 +680,7 @@ public void visit(@Nonnull Formula formula) {
if (!targetFound) {
if (formula instanceof MutableFormula mutableFormula) {
if (targetFound) {
- throw new EvitaInternalError("Expected single MutableFormula in the formula tree!");
+ throw new GenericEvitaInternalError("Expected single MutableFormula in the formula tree!");
} else {
targetFound = true;
mutableFormula.setDelegate(formulaToReplaceSupplier.get());
diff --git a/evita_engine/src/main/java/io/evitadb/core/query/extraResult/translator/facet/producer/FacetSummaryProducer.java b/evita_engine/src/main/java/io/evitadb/core/query/extraResult/translator/facet/producer/FacetSummaryProducer.java
index 75f012205..791b28223 100644
--- a/evita_engine/src/main/java/io/evitadb/core/query/extraResult/translator/facet/producer/FacetSummaryProducer.java
+++ b/evita_engine/src/main/java/io/evitadb/core/query/extraResult/translator/facet/producer/FacetSummaryProducer.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023
+ * Copyright (c) 2023-2024
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -46,7 +46,7 @@
import io.evitadb.core.query.extraResult.ExtraResultProducer;
import io.evitadb.core.query.sort.NestedContextSorter;
import io.evitadb.core.query.sort.utils.SortUtils;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.index.bitmap.BaseBitmap;
import io.evitadb.index.bitmap.Bitmap;
import io.evitadb.index.bitmap.RoaringBitmapBackedBitmap;
@@ -362,7 +362,7 @@ private static Map fetchGroups(@Nonnull Entry new EvitaInternalError(ERROR_SANITY_CHECK));
+ .orElseThrow(() -> new GenericEvitaInternalError(ERROR_SANITY_CHECK));
return Arrays.stream(
groupAcc.getFacetSummaryRequest()
.getGroupEntityFetcher(groupAcc.getReferenceSchema())
@@ -398,7 +398,7 @@ private static Map fetchFacetEntities(@Nonnull Entry<
final GroupAccumulator groupAcc = entry.getValue()
.stream()
.findFirst()
- .orElseThrow(() -> new EvitaInternalError(ERROR_SANITY_CHECK));
+ .orElseThrow(() -> new GenericEvitaInternalError(ERROR_SANITY_CHECK));
return Arrays.stream(
groupAcc.getFacetSummaryRequest()
.getFacetEntityFetcher(groupAcc.getReferenceSchema())
diff --git a/evita_engine/src/main/java/io/evitadb/core/query/extraResult/translator/histogram/producer/AttributeHistogramComputer.java b/evita_engine/src/main/java/io/evitadb/core/query/extraResult/translator/histogram/producer/AttributeHistogramComputer.java
index e64991595..973d62e32 100644
--- a/evita_engine/src/main/java/io/evitadb/core/query/extraResult/translator/histogram/producer/AttributeHistogramComputer.java
+++ b/evita_engine/src/main/java/io/evitadb/core/query/extraResult/translator/histogram/producer/AttributeHistogramComputer.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023
+ * Copyright (c) 2023-2024
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -34,7 +34,7 @@
import io.evitadb.core.query.extraResult.translator.histogram.cache.FlattenedHistogramComputer;
import io.evitadb.core.query.extraResult.translator.histogram.producer.AttributeHistogramProducer.AttributeHistogramRequest;
import io.evitadb.core.query.response.TransactionalDataRelatedStructure;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.index.attribute.FilterIndex;
import io.evitadb.index.invertedIndex.InvertedIndexSubSet;
import io.evitadb.index.invertedIndex.ValueToRecordBitmap;
@@ -204,7 +204,7 @@ private static > ToIntFunction createNumberToIntegerC
.scaleByPowerOfTen(histogramRequest.getDecimalPlaces())
.intValue();
} else {
- throw new EvitaInternalError(
+ throw new GenericEvitaInternalError(
"Unsupported histogram number type: " + histogramRequest.attributeSchema().getType() +
", supported are byte, short, int. Number types long and BigDecimal are allowed as long as their " +
"fit into an integer range!"
diff --git a/evita_engine/src/main/java/io/evitadb/core/query/filter/FilterByVisitor.java b/evita_engine/src/main/java/io/evitadb/core/query/filter/FilterByVisitor.java
index 079e12a0d..148d6cc5e 100644
--- a/evita_engine/src/main/java/io/evitadb/core/query/filter/FilterByVisitor.java
+++ b/evita_engine/src/main/java/io/evitadb/core/query/filter/FilterByVisitor.java
@@ -79,7 +79,7 @@
import io.evitadb.core.query.indexSelection.TargetIndexes;
import io.evitadb.core.query.response.TransactionalDataRelatedStructure.CalculationContext;
import io.evitadb.core.query.sort.attribute.translator.EntityNestedQueryComparator;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.function.TriFunction;
import io.evitadb.index.CatalogIndex;
import io.evitadb.index.CatalogIndexKey;
@@ -493,7 +493,7 @@ public void visit(@Nonnull Constraint> constraint) {
constraintFormula = translator.translate(filterConstraint, this);
} else {
// sanity check only
- throw new EvitaInternalError("Should never happen");
+ throw new GenericEvitaInternalError("Should never happen");
}
// if current query is FilterBy we know we're at the top of the filtering query tree
@@ -533,7 +533,7 @@ public T registerFormulaPostProcessorIfNotPrese
public ProcessingScope extends Index>> getProcessingScope() {
final ProcessingScope extends Index>> processingScope;
if (scope.isEmpty()) {
- throw new EvitaInternalError("Scope should never be empty");
+ throw new GenericEvitaInternalError("Scope should never be empty");
} else {
processingScope = scope.peek();
isPremiseValid(processingScope != null, "Scope could never be null!");
diff --git a/evita_engine/src/main/java/io/evitadb/core/query/filter/translator/attribute/AttributeBetweenTranslator.java b/evita_engine/src/main/java/io/evitadb/core/query/filter/translator/attribute/AttributeBetweenTranslator.java
index 68e60f7fd..c02881deb 100644
--- a/evita_engine/src/main/java/io/evitadb/core/query/filter/translator/attribute/AttributeBetweenTranslator.java
+++ b/evita_engine/src/main/java/io/evitadb/core/query/filter/translator/attribute/AttributeBetweenTranslator.java
@@ -46,7 +46,7 @@
import io.evitadb.dataType.NumberRange;
import io.evitadb.dataType.Range;
import io.evitadb.dataType.ShortNumberRange;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
@@ -109,7 +109,7 @@ public Formula translate(@Nonnull AttributeBetween filterConstraint, @Nonnull Fi
comparableTo = getOffsetDateTimeComparable(toTargetType(to, OffsetDateTime.class), Long.MAX_VALUE);
requestedPredicate = null;
} else {
- throw new EvitaInternalError("Unexpected Range type!");
+ throw new GenericEvitaInternalError("Unexpected Range type!");
}
filteringFormula = new AttributeFormula(
attributeDefinition.isLocalized() ?
@@ -198,7 +198,7 @@ private static AttributeBitmapFilter createAlternativeBitmapFilter(
} else if (DateTimeRange.class.isAssignableFrom(attributeSchema.getPlainType())) {
return getDateTimePredicate((OffsetDateTime) comparableFrom, (OffsetDateTime) comparableTo);
} else {
- throw new EvitaInternalError("Unexpected type!");
+ throw new GenericEvitaInternalError("Unexpected type!");
}
} else {
return getComparablePredicate(comparableFrom, comparableTo);
@@ -242,7 +242,7 @@ public static Predicate>> getDateTimePredicate(@
} else if (comparableValueTo != null) {
return ((DateTimeRange) theValue).overlaps(DateTimeRange.until(comparableValueTo));
} else {
- throw new EvitaInternalError("Between query can never be created with both bounds null!");
+ throw new GenericEvitaInternalError("Between query can never be created with both bounds null!");
}
};
final Serializable theValue = attr.get().value();
@@ -279,7 +279,7 @@ public static Predicate>> getNumberRangePredicat
} else if (comparableValueFrom instanceof Byte || comparableValueTo instanceof Byte) {
return ((ByteNumberRange) theValue).overlaps(ByteNumberRange.between((Byte) comparableValueFrom, (Byte) comparableValueTo));
} else {
- throw new EvitaInternalError("Unexpected input type: " + comparableValueFrom + ", " + comparableValueTo);
+ throw new GenericEvitaInternalError("Unexpected input type: " + comparableValueFrom + ", " + comparableValueTo);
}
} else if (comparableValueFrom != null) {
if (comparableValueFrom instanceof BigDecimal) {
@@ -293,7 +293,7 @@ public static Predicate>> getNumberRangePredicat
} else if (comparableValueFrom instanceof Byte) {
return ((ByteNumberRange) theValue).overlaps(ByteNumberRange.from((Byte) comparableValueFrom));
} else {
- throw new EvitaInternalError("Unexpected input type: " + comparableValueFrom);
+ throw new GenericEvitaInternalError("Unexpected input type: " + comparableValueFrom);
}
} else if (comparableValueTo != null) {
if (comparableValueTo instanceof BigDecimal) {
@@ -307,10 +307,10 @@ public static Predicate>> getNumberRangePredicat
} else if (comparableValueTo instanceof Byte) {
return ((ByteNumberRange) theValue).overlaps(ByteNumberRange.to((Byte) comparableValueTo));
} else {
- throw new EvitaInternalError("Unexpected input type: " + comparableValueTo);
+ throw new GenericEvitaInternalError("Unexpected input type: " + comparableValueTo);
}
} else {
- throw new EvitaInternalError("Between query can never be created with both bounds null!");
+ throw new GenericEvitaInternalError("Between query can never be created with both bounds null!");
}
};
final Serializable theValue = attr.get().value();
@@ -342,7 +342,7 @@ public static Predicate>> getComparablePredicate
} else if (comparableTo != null) {
return theValue.compareTo(comparableTo) <= 0;
} else {
- throw new EvitaInternalError("Between query can never be created with both bounds null!");
+ throw new GenericEvitaInternalError("Between query can never be created with both bounds null!");
}
};
final Serializable theValue = attr.get().value();
diff --git a/evita_engine/src/main/java/io/evitadb/core/query/filter/translator/facet/FacetHavingTranslator.java b/evita_engine/src/main/java/io/evitadb/core/query/filter/translator/facet/FacetHavingTranslator.java
index c32e9ec93..cb1c6d857 100644
--- a/evita_engine/src/main/java/io/evitadb/core/query/filter/translator/facet/FacetHavingTranslator.java
+++ b/evita_engine/src/main/java/io/evitadb/core/query/filter/translator/facet/FacetHavingTranslator.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023
+ * Copyright (c) 2023-2024
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -43,7 +43,7 @@
import io.evitadb.core.query.common.translator.SelfTraversingTranslator;
import io.evitadb.core.query.filter.FilterByVisitor;
import io.evitadb.core.query.filter.translator.FilteringConstraintTranslator;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.index.bitmap.Bitmap;
import io.evitadb.utils.ArrayUtils;
@@ -157,7 +157,7 @@ public Formula translate(@Nonnull FacetHaving facetHaving, @Nonnull FilterByVisi
if (notFormula == null) {
if (andFormula == null && orFormula == null) {
- throw new EvitaInternalError("This should be not possible!");
+ throw new GenericEvitaInternalError("This should be not possible!");
} else if (andFormula == null) {
return orFormula;
} else if (orFormula == null) {
diff --git a/evita_engine/src/main/java/io/evitadb/core/query/filter/translator/price/PriceListCompositionTerminationVisitor.java b/evita_engine/src/main/java/io/evitadb/core/query/filter/translator/price/PriceListCompositionTerminationVisitor.java
index b1f2e80e0..30a6950b0 100644
--- a/evita_engine/src/main/java/io/evitadb/core/query/filter/translator/price/PriceListCompositionTerminationVisitor.java
+++ b/evita_engine/src/main/java/io/evitadb/core/query/filter/translator/price/PriceListCompositionTerminationVisitor.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023
+ * Copyright (c) 2023-2024
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -41,7 +41,7 @@
import io.evitadb.core.query.algebra.utils.FormulaFactory;
import io.evitadb.core.query.algebra.utils.visitor.FormulaFinder;
import io.evitadb.core.query.algebra.utils.visitor.FormulaFinder.LookUp;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.index.price.model.PriceIndexKey;
import io.evitadb.utils.Assert;
import lombok.Getter;
@@ -185,7 +185,7 @@ public void visit(@Nonnull Formula formula) {
containerFormula, priceEvaluationContext, queryPriceMode,
ofNullable(priceFilter).orElse(PricePredicate.ALL_RECORD_FILTER)
);
- case UNKNOWN -> throw new EvitaInternalError("Can't handle unknown price inner record handling!");
+ case UNKNOWN -> throw new GenericEvitaInternalError("Can't handle unknown price inner record handling!");
};
} else {
// otherwise, use the produced formula
diff --git a/evita_engine/src/main/java/io/evitadb/core/query/indexSelection/IndexSelectionVisitor.java b/evita_engine/src/main/java/io/evitadb/core/query/indexSelection/IndexSelectionVisitor.java
index 38a603cd1..a830eec83 100644
--- a/evita_engine/src/main/java/io/evitadb/core/query/indexSelection/IndexSelectionVisitor.java
+++ b/evita_engine/src/main/java/io/evitadb/core/query/indexSelection/IndexSelectionVisitor.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023
+ * Copyright (c) 2023-2024
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -44,7 +44,7 @@
import io.evitadb.core.query.filter.FilterByVisitor;
import io.evitadb.core.query.filter.translator.hierarchy.HierarchyWithinRootTranslator;
import io.evitadb.core.query.filter.translator.hierarchy.HierarchyWithinTranslator;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.index.CatalogIndex;
import io.evitadb.index.CatalogIndexKey;
import io.evitadb.index.EntityIndex;
@@ -152,7 +152,7 @@ hierarchyWithin, getFilterByVisitor()
);
} else {
//sanity check only
- throw new EvitaInternalError("Should never happen");
+ throw new GenericEvitaInternalError("Should never happen");
}
if (requestedHierarchyNodesFormula instanceof EmptyFormula) {
// if target entity has no global index present, it means that the query cannot be fulfilled
diff --git a/evita_engine/src/main/java/io/evitadb/core/query/sort/OrderByVisitor.java b/evita_engine/src/main/java/io/evitadb/core/query/sort/OrderByVisitor.java
index 2194fc427..c839015dd 100644
--- a/evita_engine/src/main/java/io/evitadb/core/query/sort/OrderByVisitor.java
+++ b/evita_engine/src/main/java/io/evitadb/core/query/sort/OrderByVisitor.java
@@ -56,7 +56,7 @@
import io.evitadb.core.query.sort.random.translator.RandomTranslator;
import io.evitadb.core.query.sort.translator.OrderByTranslator;
import io.evitadb.core.query.sort.translator.OrderingConstraintTranslator;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.index.EntityIndex;
import io.evitadb.index.attribute.SortIndex;
import io.evitadb.utils.CollectionUtils;
@@ -262,7 +262,7 @@ public final T executeInContext(
@Nonnull
public ProcessingScope getProcessingScope() {
if (scope.isEmpty()) {
- throw new EvitaInternalError("Scope should never be empty");
+ throw new GenericEvitaInternalError("Scope should never be empty");
} else {
return scope.peek();
}
@@ -314,7 +314,7 @@ public void visit(@Nonnull Constraint> constraint) {
currentSorters = translator.createSorter(orderConstraint, this);
} else {
// sanity check only
- throw new EvitaInternalError("Should never happen");
+ throw new GenericEvitaInternalError("Should never happen");
}
// compose sorters one after another
currentSorters.forEach(this.sorters::add);
diff --git a/evita_engine/src/main/java/io/evitadb/core/query/sort/ReferenceOrderByVisitor.java b/evita_engine/src/main/java/io/evitadb/core/query/sort/ReferenceOrderByVisitor.java
index 110c45dc1..1dd7d9d5c 100644
--- a/evita_engine/src/main/java/io/evitadb/core/query/sort/ReferenceOrderByVisitor.java
+++ b/evita_engine/src/main/java/io/evitadb/core/query/sort/ReferenceOrderByVisitor.java
@@ -42,7 +42,7 @@
import io.evitadb.core.query.sort.attribute.translator.EntityPropertyTranslator;
import io.evitadb.core.query.sort.translator.OrderByTranslator;
import io.evitadb.core.query.sort.translator.ReferenceOrderingConstraintTranslator;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.utils.CollectionUtils;
import lombok.AccessLevel;
import lombok.RequiredArgsConstructor;
@@ -167,7 +167,7 @@ public void visit(@Nonnull Constraint> constraint) {
translator.createComparator(orderConstraint, this);
} else {
// sanity check only
- throw new EvitaInternalError("Should never happen");
+ throw new GenericEvitaInternalError("Should never happen");
}
}
diff --git a/evita_engine/src/main/java/io/evitadb/core/query/sort/primaryKey/translator/EntityPrimaryKeyNaturalTranslator.java b/evita_engine/src/main/java/io/evitadb/core/query/sort/primaryKey/translator/EntityPrimaryKeyNaturalTranslator.java
index c42343bbb..f9369e73b 100644
--- a/evita_engine/src/main/java/io/evitadb/core/query/sort/primaryKey/translator/EntityPrimaryKeyNaturalTranslator.java
+++ b/evita_engine/src/main/java/io/evitadb/core/query/sort/primaryKey/translator/EntityPrimaryKeyNaturalTranslator.java
@@ -40,7 +40,7 @@
import io.evitadb.core.query.sort.primaryKey.ReversedSorter;
import io.evitadb.core.query.sort.translator.OrderingConstraintTranslator;
import io.evitadb.dataType.array.CompositeObjectArray;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.index.EntityIndex;
import io.evitadb.index.attribute.SortedRecordsSupplier;
import io.evitadb.index.bitmap.Bitmap;
@@ -128,7 +128,7 @@ private static TransactionalBitmap getAsTransactionalBitmap(@Nonnull Bitmap bitm
} else if (bitmap instanceof EmptyBitmap) {
return null;
} else {
- throw new EvitaInternalError(
+ throw new GenericEvitaInternalError(
"Unexpected bitmap type: " + bitmap.getClass().getName(),
"Unexpected bitmap type!"
);
diff --git a/evita_engine/src/main/java/io/evitadb/core/transaction/TransactionTrunkFinalizer.java b/evita_engine/src/main/java/io/evitadb/core/transaction/TransactionTrunkFinalizer.java
index ad0019971..cb8c277cd 100644
--- a/evita_engine/src/main/java/io/evitadb/core/transaction/TransactionTrunkFinalizer.java
+++ b/evita_engine/src/main/java/io/evitadb/core/transaction/TransactionTrunkFinalizer.java
@@ -27,7 +27,7 @@
import io.evitadb.api.requestResponse.transaction.TransactionMutation;
import io.evitadb.core.Catalog;
import io.evitadb.core.transaction.memory.TransactionalLayerMaintainer;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.utils.Assert;
import javax.annotation.Nonnull;
@@ -81,7 +81,7 @@ public void commit(@Nonnull TransactionalLayerMaintainer transactionalLayer) {
@Override
public void rollback(@Nonnull TransactionalLayerMaintainer transactionalLayer, @Nullable Throwable cause) {
- throw new EvitaInternalError("Rollback is not supported here!");
+ throw new GenericEvitaInternalError("Rollback is not supported here!");
}
/**
diff --git a/evita_engine/src/main/java/io/evitadb/core/transaction/stage/TrunkIncorporationTransactionStage.java b/evita_engine/src/main/java/io/evitadb/core/transaction/stage/TrunkIncorporationTransactionStage.java
index b70ce4031..7d686cdf2 100644
--- a/evita_engine/src/main/java/io/evitadb/core/transaction/stage/TrunkIncorporationTransactionStage.java
+++ b/evita_engine/src/main/java/io/evitadb/core/transaction/stage/TrunkIncorporationTransactionStage.java
@@ -35,7 +35,7 @@
import io.evitadb.core.transaction.stage.TrunkIncorporationTransactionStage.UpdatedCatalogTransactionTask;
import io.evitadb.core.transaction.stage.mutation.VerifiedEntityRemoveMutation;
import io.evitadb.core.transaction.stage.mutation.VerifiedEntityUpsertMutation;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.utils.Assert;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
@@ -165,7 +165,7 @@ public UUID processTransactions(long nextCatalogVersion, long timeoutMs, boolean
Assert.isPremiseValid(
transactionMutation.getCatalogVersion() == this.lastFinalizedCatalogVersion + 1 ||
(lastTransaction != null && transactionMutation.getCatalogVersion() == lastTransaction.getCatalogVersion() + 1),
- () -> new EvitaInternalError(
+ () -> new GenericEvitaInternalError(
"Unexpected catalog version! " +
"Transaction mutation catalog version: " + transactionMutation.getCatalogVersion() + ", " +
"last finalized catalog version: " + this.lastFinalizedCatalogVersion + "."
diff --git a/evita_engine/src/main/java/io/evitadb/index/attribute/AttributeIndex.java b/evita_engine/src/main/java/io/evitadb/index/attribute/AttributeIndex.java
index 28c71c931..5fb037a89 100644
--- a/evita_engine/src/main/java/io/evitadb/index/attribute/AttributeIndex.java
+++ b/evita_engine/src/main/java/io/evitadb/index/attribute/AttributeIndex.java
@@ -34,7 +34,7 @@
import io.evitadb.core.transaction.memory.TransactionalLayerProducer;
import io.evitadb.core.transaction.memory.TransactionalObjectVersion;
import io.evitadb.dataType.Predecessor;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.index.IndexDataStructure;
import io.evitadb.index.attribute.AttributeIndex.AttributeIndexChanges;
import io.evitadb.index.attribute.SortIndex.ComparatorSource;
@@ -632,7 +632,7 @@ public StoragePart createStoragePart(int entityIndexPrimaryKey, @Nonnull Attribu
notNull(theChainIndex, "Chain index for attribute `" + attribute + "` was not found!");
return theChainIndex.createStoragePart(entityIndexPrimaryKey);
} else {
- throw new EvitaInternalError("Cannot handle attribute storage part key of type `" + indexType + "`");
+ throw new GenericEvitaInternalError("Cannot handle attribute storage part key of type `" + indexType + "`");
}
}
diff --git a/evita_engine/src/main/java/io/evitadb/index/attribute/SortIndex.java b/evita_engine/src/main/java/io/evitadb/index/attribute/SortIndex.java
index 390d031fc..8999857e3 100644
--- a/evita_engine/src/main/java/io/evitadb/index/attribute/SortIndex.java
+++ b/evita_engine/src/main/java/io/evitadb/index/attribute/SortIndex.java
@@ -36,7 +36,7 @@
import io.evitadb.core.transaction.memory.TransactionalLayerMaintainer;
import io.evitadb.core.transaction.memory.TransactionalLayerProducer;
import io.evitadb.core.transaction.memory.TransactionalObjectVersion;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.index.IndexDataStructure;
import io.evitadb.index.array.TransactionalObjArray;
import io.evitadb.index.array.TransactionalUnorderedIntArray;
@@ -447,7 +447,7 @@ private > void removeRecordInternal(
// remove cardinality altogether - cardinality = 1 is not maintained to save memory
theValueCardinalities.remove(normalizedValue);
} else {
- throw new EvitaInternalError("Unexpected cardinality: " + cardinality);
+ throw new GenericEvitaInternalError("Unexpected cardinality: " + cardinality);
}
} else {
// remove the entire value - there is no more record ids for it
diff --git a/evita_engine/src/main/java/io/evitadb/index/cardinality/CardinalityIndex.java b/evita_engine/src/main/java/io/evitadb/index/cardinality/CardinalityIndex.java
index 62b630ec6..4d0ab6c57 100644
--- a/evita_engine/src/main/java/io/evitadb/index/cardinality/CardinalityIndex.java
+++ b/evita_engine/src/main/java/io/evitadb/index/cardinality/CardinalityIndex.java
@@ -26,7 +26,7 @@
import io.evitadb.api.requestResponse.data.AttributesContract.AttributeKey;
import io.evitadb.core.transaction.memory.TransactionalLayerMaintainer;
import io.evitadb.core.transaction.memory.VoidTransactionMemoryProducer;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.index.IndexDataStructure;
import io.evitadb.index.bool.TransactionalBoolean;
import io.evitadb.index.map.TransactionalMap;
@@ -124,7 +124,7 @@ public boolean removeRecord(@Nonnull Serializable key, int recordId) {
(k, v) -> v - 1
);
if (newValue == null) {
- throw new EvitaInternalError("Cardinality of key `" + key + "` for record `" + recordId + "` is null");
+ throw new GenericEvitaInternalError("Cardinality of key `" + key + "` for record `" + recordId + "` is null");
} else if (newValue == 0) {
cardinalities.remove(cardinalityKey);
return true;
diff --git a/evita_engine/src/main/java/io/evitadb/index/list/TransactionalList.java b/evita_engine/src/main/java/io/evitadb/index/list/TransactionalList.java
index ba910aa91..2d7192e6f 100644
--- a/evita_engine/src/main/java/io/evitadb/index/list/TransactionalList.java
+++ b/evita_engine/src/main/java/io/evitadb/index/list/TransactionalList.java
@@ -28,7 +28,7 @@
import io.evitadb.core.transaction.memory.TransactionalLayerMaintainer;
import io.evitadb.core.transaction.memory.TransactionalLayerProducer;
import io.evitadb.core.transaction.memory.TransactionalObjectVersion;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import lombok.Getter;
import javax.annotation.Nonnull;
@@ -508,7 +508,7 @@ public void remove() {
currentPosition = previousPosition;
layer.remove(previousPosition);
} else {
- throw new EvitaInternalError("Previous position unexpectedly: " + previousPosition);
+ throw new GenericEvitaInternalError("Previous position unexpectedly: " + previousPosition);
}
}
@@ -520,7 +520,7 @@ public void set(V v) {
final V result = layer.remove(index);
layer.add(index, v);
} else {
- throw new EvitaInternalError("Current position unexpectedly: " + previousPosition);
+ throw new GenericEvitaInternalError("Current position unexpectedly: " + previousPosition);
}
}
diff --git a/evita_engine/src/main/java/io/evitadb/index/map/TransactionalMap.java b/evita_engine/src/main/java/io/evitadb/index/map/TransactionalMap.java
index 3d5d390e3..971e088dc 100644
--- a/evita_engine/src/main/java/io/evitadb/index/map/TransactionalMap.java
+++ b/evita_engine/src/main/java/io/evitadb/index/map/TransactionalMap.java
@@ -28,7 +28,7 @@
import io.evitadb.core.transaction.memory.TransactionalLayerMaintainer;
import io.evitadb.core.transaction.memory.TransactionalLayerProducer;
import io.evitadb.core.transaction.memory.TransactionalObjectVersion;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.utils.Assert;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
@@ -419,7 +419,7 @@ public Entry next() {
@Override
public void remove() {
if (currentValue == null) {
- throw new EvitaInternalError("Value unexpectedly not found!");
+ throw new GenericEvitaInternalError("Value unexpectedly not found!");
}
final K key = currentValue.getKey();
diff --git a/evita_engine/src/main/java/io/evitadb/index/mutation/ContainerizedLocalMutationExecutor.java b/evita_engine/src/main/java/io/evitadb/index/mutation/ContainerizedLocalMutationExecutor.java
index 72721885b..0533832cc 100644
--- a/evita_engine/src/main/java/io/evitadb/index/mutation/ContainerizedLocalMutationExecutor.java
+++ b/evita_engine/src/main/java/io/evitadb/index/mutation/ContainerizedLocalMutationExecutor.java
@@ -58,8 +58,8 @@
import io.evitadb.api.requestResponse.schema.dto.ReferenceSchema;
import io.evitadb.core.buffer.DataStoreChanges;
import io.evitadb.core.buffer.DataStoreMemoryBuffer;
-import io.evitadb.exception.EvitaInternalError;
import io.evitadb.exception.EvitaInvalidUsageException;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.index.EntityIndex;
import io.evitadb.index.EntityIndexKey;
import io.evitadb.store.entity.model.entity.AssociatedDataStoragePart;
@@ -178,7 +178,7 @@ public void applyMutation(@Nonnull LocalMutation, ?> localMutation) {
updateAssociatedData(entitySchema, associatedDataMutation);
} else {
// SHOULD NOT EVER HAPPEN
- throw new EvitaInternalError("Unknown mutation: " + localMutation.getClass());
+ throw new GenericEvitaInternalError("Unknown mutation: " + localMutation.getClass());
}
}
@@ -414,7 +414,7 @@ void recomputeLanguageOnAttributeUpdate(@Nonnull AttributeMutation attributeMuta
// DO NOTHING
} else {
// SHOULD NOT EVER HAPPEN
- throw new EvitaInternalError("Unknown mutation: " + attributeMutation.getClass());
+ throw new GenericEvitaInternalError("Unknown mutation: " + attributeMutation.getClass());
}
}
diff --git a/evita_engine/src/main/java/io/evitadb/index/mutation/EntityIndexLocalMutationExecutor.java b/evita_engine/src/main/java/io/evitadb/index/mutation/EntityIndexLocalMutationExecutor.java
index dbac5a6f0..7a67696de 100644
--- a/evita_engine/src/main/java/io/evitadb/index/mutation/EntityIndexLocalMutationExecutor.java
+++ b/evita_engine/src/main/java/io/evitadb/index/mutation/EntityIndexLocalMutationExecutor.java
@@ -55,7 +55,7 @@
import io.evitadb.api.requestResponse.schema.dto.AttributeSchema;
import io.evitadb.api.requestResponse.schema.dto.EntitySchema;
import io.evitadb.api.requestResponse.schema.dto.SortableAttributeCompoundSchema;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.index.CatalogIndex;
import io.evitadb.index.CatalogIndexKey;
import io.evitadb.index.EntityIndex;
@@ -266,7 +266,7 @@ public void applyMutation(@Nonnull LocalMutation, ?> localMutation) {
// do nothing, associated data doesn't affect entity index directly
} else {
// SHOULD NOT EVER HAPPEN
- throw new EvitaInternalError("Unknown mutation: " + localMutation.getClass());
+ throw new GenericEvitaInternalError("Unknown mutation: " + localMutation.getClass());
}
}
@@ -406,7 +406,7 @@ void updateAttributes(
);
} else {
// SHOULD NOT EVER HAPPEN
- throw new EvitaInternalError("Unknown mutation: " + attributeMutation.getClass());
+ throw new GenericEvitaInternalError("Unknown mutation: " + attributeMutation.getClass());
}
}
@@ -511,7 +511,7 @@ private void updateReferences(@Nonnull ReferenceMutation> referenceMutation, @
);
} else {
// SHOULD NOT EVER HAPPEN
- throw new EvitaInternalError("Unknown mutation: " + referenceMutation.getClass());
+ throw new GenericEvitaInternalError("Unknown mutation: " + referenceMutation.getClass());
}
}
@@ -669,7 +669,7 @@ private void updateReferencesInReferenceIndex(@Nonnull ReferenceMutation> refe
} else if (targetIndexType == EntityIndexType.REFERENCED_ENTITY) {
theEntityPrimaryKey = getPrimaryKeyToIndex(IndexType.REFERENCE_INDEX);
} else {
- throw new EvitaInternalError("Unexpected type of index: " + targetIndexType);
+ throw new GenericEvitaInternalError("Unexpected type of index: " + targetIndexType);
}
if (referenceMutation instanceof SetReferenceGroupMutation upsertReferenceGroupMutation) {
ReferenceIndexMutator.setFacetGroupInIndex(
@@ -708,7 +708,7 @@ private void updateReferencesInReferenceIndex(@Nonnull ReferenceMutation> refe
);
} else {
// SHOULD NOT EVER HAPPEN
- throw new EvitaInternalError("Unknown mutation: " + referenceMutation.getClass());
+ throw new GenericEvitaInternalError("Unknown mutation: " + referenceMutation.getClass());
}
}
@@ -793,7 +793,7 @@ private void updatePriceIndex(@Nonnull PriceMutation priceMutation, @Nonnull Ent
);
} else {
// SHOULD NOT EVER HAPPEN
- throw new EvitaInternalError("Unknown mutation: " + priceMutation.getClass());
+ throw new GenericEvitaInternalError("Unknown mutation: " + priceMutation.getClass());
}
}
@@ -817,7 +817,7 @@ private void updateHierarchyPlacement(@Nonnull ParentMutation parentMutation, @N
);
} else {
// SHOULD NOT EVER HAPPEN
- throw new EvitaInternalError("Unknown mutation: " + parentMutation.getClass());
+ throw new GenericEvitaInternalError("Unknown mutation: " + parentMutation.getClass());
}
}
diff --git a/evita_engine/src/main/java/io/evitadb/index/price/PriceListAndCurrencyPriceIndex.java b/evita_engine/src/main/java/io/evitadb/index/price/PriceListAndCurrencyPriceIndex.java
index 0052ffc44..6348f0502 100644
--- a/evita_engine/src/main/java/io/evitadb/index/price/PriceListAndCurrencyPriceIndex.java
+++ b/evita_engine/src/main/java/io/evitadb/index/price/PriceListAndCurrencyPriceIndex.java
@@ -29,7 +29,7 @@
import io.evitadb.core.transaction.memory.TransactionalLayerProducer;
import io.evitadb.dataType.array.CompositeObjectArray;
import io.evitadb.dataType.iterator.BatchArrayIterator;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.index.IndexDataStructure;
import io.evitadb.index.bitmap.Bitmap;
import io.evitadb.index.bitmap.RoaringBitmapBackedBitmap;
@@ -83,7 +83,7 @@ default PriceRecordContract[] getPriceRecords(@Nonnull Bitmap priceIds) {
priceRecordContract -> {
},
notFoundPriceId -> {
- throw new EvitaInternalError("Price with id " + notFoundPriceId + " was not found in the same index!");
+ throw new GenericEvitaInternalError("Price with id " + notFoundPriceId + " was not found in the same index!");
}
);
}
diff --git a/evita_engine/src/main/java/io/evitadb/index/range/RangeIndex.java b/evita_engine/src/main/java/io/evitadb/index/range/RangeIndex.java
index 004924bc4..4db0e624e 100644
--- a/evita_engine/src/main/java/io/evitadb/index/range/RangeIndex.java
+++ b/evita_engine/src/main/java/io/evitadb/index/range/RangeIndex.java
@@ -33,7 +33,7 @@
import io.evitadb.core.query.algebra.utils.FormulaFactory;
import io.evitadb.core.transaction.memory.TransactionalLayerMaintainer;
import io.evitadb.core.transaction.memory.VoidTransactionMemoryProducer;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.index.array.TransactionalComplexObjArray;
import io.evitadb.index.bitmap.BaseBitmap;
import io.evitadb.index.bitmap.Bitmap;
@@ -349,7 +349,7 @@ private static Formula createDisentangleFormulaIfNecessary(long id, @Nonnull Bit
} else if (leftFormula instanceof JoinFormula joinFormula) {
return joinFormula.getAsOrFormula();
} else {
- throw new EvitaInternalError("Unexpected formula type: " + leftFormula.getClass().getSimpleName() + "!");
+ throw new GenericEvitaInternalError("Unexpected formula type: " + leftFormula.getClass().getSimpleName() + "!");
}
} else {
return new DisentangleFormula(leftFormula, rightFormula);
diff --git a/evita_engine/src/main/java/io/evitadb/index/set/TransactionalSet.java b/evita_engine/src/main/java/io/evitadb/index/set/TransactionalSet.java
index e014adb8f..844aac425 100644
--- a/evita_engine/src/main/java/io/evitadb/index/set/TransactionalSet.java
+++ b/evita_engine/src/main/java/io/evitadb/index/set/TransactionalSet.java
@@ -28,7 +28,7 @@
import io.evitadb.core.transaction.memory.TransactionalLayerMaintainer;
import io.evitadb.core.transaction.memory.TransactionalLayerProducer;
import io.evitadb.core.transaction.memory.TransactionalObjectVersion;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import lombok.Getter;
import javax.annotation.Nonnull;
@@ -387,7 +387,7 @@ public K next() {
@Override
public void remove() {
if (currentValue == null) {
- throw new EvitaInternalError("Value unexpectedly not found!");
+ throw new GenericEvitaInternalError("Value unexpectedly not found!");
}
final K key = currentValue;
diff --git a/evita_external_api/evita_external_api_core/src/main/java/io/evitadb/externalApi/certificate/ServerCertificateManager.java b/evita_external_api/evita_external_api_core/src/main/java/io/evitadb/externalApi/certificate/ServerCertificateManager.java
index 1b9dfb19a..196893ebe 100644
--- a/evita_external_api/evita_external_api_core/src/main/java/io/evitadb/externalApi/certificate/ServerCertificateManager.java
+++ b/evita_external_api/evita_external_api_core/src/main/java/io/evitadb/externalApi/certificate/ServerCertificateManager.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023
+ * Copyright (c) 2023-2024
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,7 +23,7 @@
package io.evitadb.externalApi.certificate;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.externalApi.configuration.AbstractApiConfiguration;
import io.evitadb.externalApi.configuration.CertificatePath;
import io.evitadb.externalApi.configuration.CertificateSettings;
@@ -114,7 +114,7 @@ public static CertificatePath getCertificatePath(@Nonnull CertificateSettings ce
} else {
final CertificatePath certificatePath = certificateSettings.custom();
if (certificatePath == null || certificatePath.certificate() == null || certificatePath.privateKey() == null) {
- throw new EvitaInternalError("Certificate path is not properly set in the configuration file.");
+ throw new GenericEvitaInternalError("Certificate path is not properly set in the configuration file.");
}
certPath = ofNullable(certificatePath.certificate()).map(Path::of).orElse(null);
certPrivateKeyPath = ofNullable(certificatePath.privateKey()).map(Path::of).orElse(null);
@@ -296,4 +296,4 @@ private void issueCertificate(
privateKeyWriter.writeObject(new PemObject("PRIVATE KEY", issuedCertKeyPair.getPrivate().getEncoded()));
}
}
-}
\ No newline at end of file
+}
diff --git a/evita_external_api/evita_external_api_core/src/main/java/io/evitadb/externalApi/configuration/ApiOptions.java b/evita_external_api/evita_external_api_core/src/main/java/io/evitadb/externalApi/configuration/ApiOptions.java
index 81b83ce40..1512bc3ea 100644
--- a/evita_external_api/evita_external_api_core/src/main/java/io/evitadb/externalApi/configuration/ApiOptions.java
+++ b/evita_external_api/evita_external_api_core/src/main/java/io/evitadb/externalApi/configuration/ApiOptions.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023
+ * Copyright (c) 2023-2024
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,7 +24,7 @@
package io.evitadb.externalApi.configuration;
import io.evitadb.api.exception.ApiNotFoundOnClasspath;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.externalApi.http.ExternalApiProviderRegistrar;
import io.evitadb.externalApi.http.ExternalApiServer;
import io.evitadb.utils.Assert;
@@ -145,7 +145,7 @@ public ApiOptions.Builder enable(@Nonnull String apiCode) {
try {
cfg = (AbstractApiConfiguration) configurationClass.getDeclaredConstructor().newInstance();
} catch (Exception ex) {
- throw new EvitaInternalError(
+ throw new GenericEvitaInternalError(
"Failed to instantiate default configuration of `" + apiCode + "` API: " + ex.getMessage(),
"Failed to instantiate default configuration of `" + apiCode + "` API!",
ex
diff --git a/evita_external_api/evita_external_api_core/src/main/java/io/evitadb/externalApi/http/ExternalApiServer.java b/evita_external_api/evita_external_api_core/src/main/java/io/evitadb/externalApi/http/ExternalApiServer.java
index 46688cfce..749dac35e 100644
--- a/evita_external_api/evita_external_api_core/src/main/java/io/evitadb/externalApi/http/ExternalApiServer.java
+++ b/evita_external_api/evita_external_api_core/src/main/java/io/evitadb/externalApi/http/ExternalApiServer.java
@@ -24,8 +24,8 @@
package io.evitadb.externalApi.http;
import io.evitadb.core.Evita;
-import io.evitadb.exception.EvitaInternalError;
import io.evitadb.exception.EvitaInvalidUsageException;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.externalApi.certificate.ServerCertificateManager;
import io.evitadb.externalApi.configuration.AbstractApiConfiguration;
import io.evitadb.externalApi.configuration.ApiOptions;
@@ -132,7 +132,7 @@ public static Collection gatherExternalApiProvider
public static CertificatePath initCertificate(final @Nonnull ApiOptions apiOptions, final @Nonnull ServerCertificateManager serverCertificateManager) {
final CertificatePath certificatePath = ServerCertificateManager.getCertificatePath(apiOptions.certificate());
if (certificatePath.certificate() == null || certificatePath.privateKey() == null) {
- throw new EvitaInternalError("Either certificate path or its private key path is not set");
+ throw new GenericEvitaInternalError("Either certificate path or its private key path is not set");
}
final File certificateFile = new File(certificatePath.certificate());
final File certificateKeyFile = new File(certificatePath.privateKey());
@@ -149,7 +149,7 @@ public static CertificatePath initCertificate(final @Nonnull ApiOptions apiOptio
try {
serverCertificateManager.generateSelfSignedCertificate();
} catch (Exception e) {
- throw new EvitaInternalError(
+ throw new GenericEvitaInternalError(
"Failed to generate self-signed certificate: " + e.getMessage(),
"Failed to generate self-signed certificate",
e
@@ -162,7 +162,7 @@ public static CertificatePath initCertificate(final @Nonnull ApiOptions apiOptio
}
} else {
if (!certificateFile.exists() || !certificateKeyFile.exists()) {
- throw new EvitaInternalError("Certificate or its private key file does not exist");
+ throw new GenericEvitaInternalError("Certificate or its private key file does not exist");
}
}
return certificatePath;
@@ -194,7 +194,7 @@ private static SSLContext configureSSLContext(
} catch (NoSuchAlgorithmException | UnrecoverableKeyException | CertificateException | KeyStoreException |
IOException | KeyManagementException e) {
- throw new EvitaInternalError(
+ throw new GenericEvitaInternalError(
"Error while creating SSL context: " + e.getMessage(),
"Error while creating SSL context",
e
@@ -308,7 +308,7 @@ private static Map> registerApiProviders(
it -> it.getCode().toLowerCase(),
Function.identity(),
(externalApiProvider, externalApiProvider2) -> {
- throw new EvitaInternalError(
+ throw new GenericEvitaInternalError(
"Multiple implementations of `" + externalApiProvider.getCode() + "` found on classpath!"
);
},
diff --git a/evita_external_api/evita_external_api_graphql/src/main/java/io/evitadb/externalApi/graphql/api/catalog/builder/CatalogGraphQLSchemaBuildingContext.java b/evita_external_api/evita_external_api_graphql/src/main/java/io/evitadb/externalApi/graphql/api/catalog/builder/CatalogGraphQLSchemaBuildingContext.java
index 0911dd972..6adb91c70 100644
--- a/evita_external_api/evita_external_api_graphql/src/main/java/io/evitadb/externalApi/graphql/api/catalog/builder/CatalogGraphQLSchemaBuildingContext.java
+++ b/evita_external_api/evita_external_api_graphql/src/main/java/io/evitadb/externalApi/graphql/api/catalog/builder/CatalogGraphQLSchemaBuildingContext.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023
+ * Copyright (c) 2023-2024
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -29,7 +29,7 @@
import io.evitadb.api.requestResponse.schema.EntitySchemaContract;
import io.evitadb.api.requestResponse.schema.SealedEntitySchema;
import io.evitadb.core.Evita;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.externalApi.graphql.api.builder.GraphQLSchemaBuildingContext;
import io.evitadb.externalApi.graphql.configuration.GraphQLConfig;
import lombok.Getter;
@@ -69,7 +69,7 @@ public CatalogGraphQLSchemaBuildingContext(@Nonnull GraphQLConfig config,
final Set schemas = createHashSet(collections.size());
collections.forEach(c -> {
final SealedEntitySchema entitySchema = session.getEntitySchema(c)
- .orElseThrow(() -> new EvitaInternalError("Entity `" + c + "` schema unexpectedly not found!"));
+ .orElseThrow(() -> new GenericEvitaInternalError("Entity `" + c + "` schema unexpectedly not found!"));
supportedLocales.addAll(entitySchema.getLocales());
supportedCurrencies.addAll(entitySchema.getCurrencies());
schemas.add(entitySchema);
diff --git a/evita_external_api/evita_external_api_grpc/client/src/main/java/io/evitadb/driver/EvitaClient.java b/evita_external_api/evita_external_api_grpc/client/src/main/java/io/evitadb/driver/EvitaClient.java
index 59021d0ff..7213e20ec 100644
--- a/evita_external_api/evita_external_api_grpc/client/src/main/java/io/evitadb/driver/EvitaClient.java
+++ b/evita_external_api/evita_external_api_grpc/client/src/main/java/io/evitadb/driver/EvitaClient.java
@@ -47,6 +47,7 @@
import io.evitadb.driver.trace.DefaultClientTracingContext;
import io.evitadb.exception.EvitaInternalError;
import io.evitadb.exception.EvitaInvalidUsageException;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.exception.InvalidEvitaVersionException;
import io.evitadb.externalApi.grpc.dataType.EvitaDataTypesConverter;
import io.evitadb.externalApi.grpc.generated.*;
@@ -717,18 +718,18 @@ private T executeWithEvitaService(@Nonnull AsyncCallFunction T executeWithEvitaSessionService(
throw evitaError;
} catch (Throwable e) {
log.error("Unexpected internal Evita error occurred: {}", e.getMessage(), e);
- throw new EvitaInternalError(
+ throw new GenericEvitaInternalError(
"Unexpected internal Evita error occurred: " + e.getMessage(),
"Unexpected internal Evita error occurred.",
e
@@ -1618,11 +1619,11 @@ private RuntimeException transformStatusRuntimeException(@Nonnull StatusRuntimeE
} else {
final Matcher expectedFormat = ERROR_MESSAGE_PATTERN.matcher(description);
if (expectedFormat.matches()) {
- return EvitaInternalError.createExceptionWithErrorCode(
+ return GenericEvitaInternalError.createExceptionWithErrorCode(
expectedFormat.group(2), expectedFormat.group(1)
);
} else {
- return new EvitaInternalError(description);
+ return new GenericEvitaInternalError(description);
}
}
}
diff --git a/evita_external_api/evita_external_api_grpc/client/src/main/java/io/evitadb/driver/certificate/ClientCertificateManager.java b/evita_external_api/evita_external_api_grpc/client/src/main/java/io/evitadb/driver/certificate/ClientCertificateManager.java
index 126466b40..1bce7497a 100644
--- a/evita_external_api/evita_external_api_grpc/client/src/main/java/io/evitadb/driver/certificate/ClientCertificateManager.java
+++ b/evita_external_api/evita_external_api_grpc/client/src/main/java/io/evitadb/driver/certificate/ClientCertificateManager.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023
+ * Copyright (c) 2023-2024
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,8 +23,8 @@
package io.evitadb.driver.certificate;
-import io.evitadb.exception.EvitaInternalError;
import io.evitadb.exception.EvitaInvalidUsageException;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.utils.Assert;
import io.evitadb.utils.CertificateUtils;
import io.netty.handler.ssl.ApplicationProtocolConfig;
@@ -312,7 +312,7 @@ private TrustManager getTrustManager(@Nonnull Path usedCertificatePath) {
log.info("Client's certificate fingerprint: {}", CertificateUtils.getCertificateFingerprint(clientCert));
}
} catch (CertificateException | IOException | NoSuchAlgorithmException e) {
- throw new EvitaInternalError(e.getMessage(), e);
+ throw new GenericEvitaInternalError(e.getMessage(), e);
}
return trustManagerTrustingProvidedRootCertificate;
}
diff --git a/evita_external_api/evita_external_api_grpc/client/src/main/java/io/evitadb/driver/trace/ClientTracingContextProvider.java b/evita_external_api/evita_external_api_grpc/client/src/main/java/io/evitadb/driver/trace/ClientTracingContextProvider.java
index a61c46d01..a15ed49b8 100644
--- a/evita_external_api/evita_external_api_grpc/client/src/main/java/io/evitadb/driver/trace/ClientTracingContextProvider.java
+++ b/evita_external_api/evita_external_api_grpc/client/src/main/java/io/evitadb/driver/trace/ClientTracingContextProvider.java
@@ -23,7 +23,7 @@
package io.evitadb.driver.trace;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import java.util.List;
import java.util.ServiceLoader;
@@ -45,7 +45,7 @@ public static ClientTracingContext getContext() {
.map(Provider::get)
.toList();
if (collectedContexts.size() > 1) {
- throw new EvitaInternalError("There are multiple registered implementations of ExternalApiTracingContext.");
+ throw new GenericEvitaInternalError("There are multiple registered implementations of ExternalApiTracingContext.");
}
if (collectedContexts.size() == 1) {
return collectedContexts.stream().findFirst().get();
diff --git a/evita_external_api/evita_external_api_grpc/server/src/main/java/io/evitadb/externalApi/grpc/services/EvitaSessionService.java b/evita_external_api/evita_external_api_grpc/server/src/main/java/io/evitadb/externalApi/grpc/services/EvitaSessionService.java
index 1330f5cfe..710d5e8e1 100644
--- a/evita_external_api/evita_external_api_grpc/server/src/main/java/io/evitadb/externalApi/grpc/services/EvitaSessionService.java
+++ b/evita_external_api/evita_external_api_grpc/server/src/main/java/io/evitadb/externalApi/grpc/services/EvitaSessionService.java
@@ -26,7 +26,6 @@
import com.google.protobuf.Empty;
import io.evitadb.api.CatalogState;
import io.evitadb.api.EvitaSessionContract;
-import io.evitadb.api.exception.UnexpectedTransactionStateException;
import io.evitadb.api.query.Query;
import io.evitadb.api.query.require.EntityContentRequire;
import io.evitadb.api.query.require.EntityFetch;
@@ -50,7 +49,7 @@
import io.evitadb.dataType.DataChunk;
import io.evitadb.dataType.PaginatedList;
import io.evitadb.dataType.StripList;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.externalApi.grpc.builders.query.extraResults.GrpcExtraResultsBuilder;
import io.evitadb.externalApi.grpc.constants.GrpcHeaders;
import io.evitadb.externalApi.grpc.generated.*;
@@ -682,7 +681,7 @@ public void queryOne(GrpcQueryRequest request, StreamObserver logic) {
- executeWithClientContext(session -> {
- try {
- session.execute(logic);
- } catch (UnexpectedTransactionStateException ex) {
- logic.accept(session);
- }
- });
- }
-
/**
* Executes entire lambda function within the scope of a tracing context.
*/
diff --git a/evita_external_api/evita_external_api_grpc/server/src/main/java/io/evitadb/externalApi/grpc/utils/GrpcServer.java b/evita_external_api/evita_external_api_grpc/server/src/main/java/io/evitadb/externalApi/grpc/utils/GrpcServer.java
index 4d68bfde2..5aa3b8c0f 100644
--- a/evita_external_api/evita_external_api_grpc/server/src/main/java/io/evitadb/externalApi/grpc/utils/GrpcServer.java
+++ b/evita_external_api/evita_external_api_grpc/server/src/main/java/io/evitadb/externalApi/grpc/utils/GrpcServer.java
@@ -24,7 +24,7 @@
package io.evitadb.externalApi.grpc.utils;
import io.evitadb.core.Evita;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.externalApi.certificate.ServerCertificateManager;
import io.evitadb.externalApi.configuration.ApiOptions;
import io.evitadb.externalApi.configuration.CertificatePath;
@@ -86,7 +86,7 @@ private void setUpServer(@Nonnull Evita evita, @Nonnull ApiOptions apiOptions, @
final HostDefinition[] hosts = config.getHost();
final CertificatePath certificatePath = ServerCertificateManager.getCertificatePath(apiOptions.certificate());
if (certificatePath.certificate() == null || certificatePath.privateKey() == null) {
- throw new EvitaInternalError("Certificate path is not set.");
+ throw new GenericEvitaInternalError("Certificate path is not set.");
}
final ServerCredentials tlsServerCredentials;
try {
@@ -114,7 +114,7 @@ private void setUpServer(@Nonnull Evita evita, @Nonnull ApiOptions apiOptions, @
}
tlsServerCredentials = tlsServerCredentialsBuilder.build();
} catch (Exception e) {
- throw new EvitaInternalError(
+ throw new GenericEvitaInternalError(
"Failed to create gRPC server credentials with provided certificate and private key: " + e.getMessage(),
"Failed to create gRPC server credentials with provided certificate and private key.",
e
diff --git a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/dataType/EvitaDataTypesConverter.java b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/dataType/EvitaDataTypesConverter.java
index 6103c5ebb..97e32c9aa 100644
--- a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/dataType/EvitaDataTypesConverter.java
+++ b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/dataType/EvitaDataTypesConverter.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023
+ * Copyright (c) 2023-2024
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -28,8 +28,8 @@
import com.google.protobuf.Timestamp;
import io.evitadb.api.requestResponse.data.AssociatedDataContract.AssociatedDataValue;
import io.evitadb.dataType.*;
-import io.evitadb.exception.EvitaInternalError;
import io.evitadb.exception.EvitaInvalidUsageException;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.externalApi.grpc.generated.*;
import io.evitadb.externalApi.grpc.generated.GrpcEvitaAssociatedDataValue.ValueCase;
import io.evitadb.utils.NumberUtils;
@@ -145,7 +145,7 @@ public static T toEvitaValue(@Nonnull GrpcEvitaValue va
case UUID_ARRAY -> (T) toUuidArray(value.getUuidArrayValue());
default ->
- throw new EvitaInternalError("Unsupported Evita data type in gRPC API `" + value.getValueCase() + "`.");
+ throw new GenericEvitaInternalError("Unsupported Evita data type in gRPC API `" + value.getValueCase() + "`.");
};
}
@@ -163,7 +163,7 @@ public static Serializable toEvitaValue(@Nonnull GrpcEvitaAssociatedDataValue va
} else if (value.getValueCase() == ValueCase.JSONVALUE) {
return ComplexDataObjectConverter.convertJsonToComplexDataObject(value.getJsonValue());
} else {
- throw new EvitaInternalError("Unknown value type.");
+ throw new GenericEvitaInternalError("Unknown value type.");
}
}
@@ -396,7 +396,7 @@ public static Class extends Serializable> toEvitaDataType(@Nonnull GrpcEvitaDa
case CURRENCY_ARRAY -> Currency[].class;
case UUID_ARRAY -> UUID[].class;
default ->
- throw new EvitaInternalError("Unsupported Evita data type in gRPC API `" + dataType.getValueDescriptor() + "`.");
+ throw new GenericEvitaInternalError("Unsupported Evita data type in gRPC API `" + dataType.getValueDescriptor() + "`.");
};
}
@@ -1371,5 +1371,5 @@ public static GrpcPredecessor toGrpcPredecessor(@Nonnull Predecessor predecessor
.build();
}
}
-
+
}
diff --git a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcHealthProblem.java b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcHealthProblem.java
index 7a6161a34..a7b48329e 100644
--- a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcHealthProblem.java
+++ b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/generated/GrpcHealthProblem.java
@@ -6,375 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023
- *
- * Licensed under the Business Source License, Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://github.com/FgForrest/evitaDB/blob/main/LICENSE
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- *
- * _ _ ____ ____
- * _____ _(_) |_ __ _| _ \| __ )
- * / _ \ \ / / | __/ _` | | | | _ \
- * | __/\ V /| | || (_| | |_| | |_) |
- * \___| \_/ |_|\__\__,_|____/|____/
- *
- * Copyright (c) 2023
- *
- * Licensed under the Business Source License, Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://github.com/FgForrest/evitaDB/blob/main/LICENSE
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- *
- * _ _ ____ ____
- * _____ _(_) |_ __ _| _ \| __ )
- * / _ \ \ / / | __/ _` | | | | _ \
- * | __/\ V /| | || (_| | |_| | |_) |
- * \___| \_/ |_|\__\__,_|____/|____/
- *
- * Copyright (c) 2023
- *
- * Licensed under the Business Source License, Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://github.com/FgForrest/evitaDB/blob/main/LICENSE
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- *
- * _ _ ____ ____
- * _____ _(_) |_ __ _| _ \| __ )
- * / _ \ \ / / | __/ _` | | | | _ \
- * | __/\ V /| | || (_| | |_| | |_) |
- * \___| \_/ |_|\__\__,_|____/|____/
- *
- * Copyright (c) 2023
- *
- * Licensed under the Business Source License, Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://github.com/FgForrest/evitaDB/blob/main/LICENSE
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- *
- * _ _ ____ ____
- * _____ _(_) |_ __ _| _ \| __ )
- * / _ \ \ / / | __/ _` | | | | _ \
- * | __/\ V /| | || (_| | |_| | |_) |
- * \___| \_/ |_|\__\__,_|____/|____/
- *
- * Copyright (c) 2023
- *
- * Licensed under the Business Source License, Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://github.com/FgForrest/evitaDB/blob/main/LICENSE
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- *
- * _ _ ____ ____
- * _____ _(_) |_ __ _| _ \| __ )
- * / _ \ \ / / | __/ _` | | | | _ \
- * | __/\ V /| | || (_| | |_| | |_) |
- * \___| \_/ |_|\__\__,_|____/|____/
- *
- * Copyright (c) 2023
- *
- * Licensed under the Business Source License, Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://github.com/FgForrest/evitaDB/blob/main/LICENSE
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- *
- * _ _ ____ ____
- * _____ _(_) |_ __ _| _ \| __ )
- * / _ \ \ / / | __/ _` | | | | _ \
- * | __/\ V /| | || (_| | |_| | |_) |
- * \___| \_/ |_|\__\__,_|____/|____/
- *
- * Copyright (c) 2023
- *
- * Licensed under the Business Source License, Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://github.com/FgForrest/evitaDB/blob/main/LICENSE
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- *
- * _ _ ____ ____
- * _____ _(_) |_ __ _| _ \| __ )
- * / _ \ \ / / | __/ _` | | | | _ \
- * | __/\ V /| | || (_| | |_| | |_) |
- * \___| \_/ |_|\__\__,_|____/|____/
- *
- * Copyright (c) 2023
- *
- * Licensed under the Business Source License, Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://github.com/FgForrest/evitaDB/blob/main/LICENSE
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- *
- * _ _ ____ ____
- * _____ _(_) |_ __ _| _ \| __ )
- * / _ \ \ / / | __/ _` | | | | _ \
- * | __/\ V /| | || (_| | |_| | |_) |
- * \___| \_/ |_|\__\__,_|____/|____/
- *
- * Copyright (c) 2023
- *
- * Licensed under the Business Source License, Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://github.com/FgForrest/evitaDB/blob/main/LICENSE
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- *
- * _ _ ____ ____
- * _____ _(_) |_ __ _| _ \| __ )
- * / _ \ \ / / | __/ _` | | | | _ \
- * | __/\ V /| | || (_| | |_| | |_) |
- * \___| \_/ |_|\__\__,_|____/|____/
- *
- * Copyright (c) 2023
- *
- * Licensed under the Business Source License, Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://github.com/FgForrest/evitaDB/blob/main/LICENSE
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- *
- * _ _ ____ ____
- * _____ _(_) |_ __ _| _ \| __ )
- * / _ \ \ / / | __/ _` | | | | _ \
- * | __/\ V /| | || (_| | |_| | |_) |
- * \___| \_/ |_|\__\__,_|____/|____/
- *
- * Copyright (c) 2023
- *
- * Licensed under the Business Source License, Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://github.com/FgForrest/evitaDB/blob/main/LICENSE
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- *
- * _ _ ____ ____
- * _____ _(_) |_ __ _| _ \| __ )
- * / _ \ \ / / | __/ _` | | | | _ \
- * | __/\ V /| | || (_| | |_| | |_) |
- * \___| \_/ |_|\__\__,_|____/|____/
- *
- * Copyright (c) 2023
- *
- * Licensed under the Business Source License, Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://github.com/FgForrest/evitaDB/blob/main/LICENSE
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- *
- * _ _ ____ ____
- * _____ _(_) |_ __ _| _ \| __ )
- * / _ \ \ / / | __/ _` | | | | _ \
- * | __/\ V /| | || (_| | |_| | |_) |
- * \___| \_/ |_|\__\__,_|____/|____/
- *
- * Copyright (c) 2023
- *
- * Licensed under the Business Source License, Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://github.com/FgForrest/evitaDB/blob/main/LICENSE
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- *
- * _ _ ____ ____
- * _____ _(_) |_ __ _| _ \| __ )
- * / _ \ \ / / | __/ _` | | | | _ \
- * | __/\ V /| | || (_| | |_| | |_) |
- * \___| \_/ |_|\__\__,_|____/|____/
- *
- * Copyright (c) 2023
- *
- * Licensed under the Business Source License, Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://github.com/FgForrest/evitaDB/blob/main/LICENSE
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- *
- * _ _ ____ ____
- * _____ _(_) |_ __ _| _ \| __ )
- * / _ \ \ / / | __/ _` | | | | _ \
- * | __/\ V /| | || (_| | |_| | |_) |
- * \___| \_/ |_|\__\__,_|____/|____/
- *
- * Copyright (c) 2023
- *
- * Licensed under the Business Source License, Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://github.com/FgForrest/evitaDB/blob/main/LICENSE
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- *
- * _ _ ____ ____
- * _____ _(_) |_ __ _| _ \| __ )
- * / _ \ \ / / | __/ _` | | | | _ \
- * | __/\ V /| | || (_| | |_| | |_) |
- * \___| \_/ |_|\__\__,_|____/|____/
- *
- * Copyright (c) 2023
- *
- * Licensed under the Business Source License, Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://github.com/FgForrest/evitaDB/blob/main/LICENSE
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- *
- * _ _ ____ ____
- * _____ _(_) |_ __ _| _ \| __ )
- * / _ \ \ / / | __/ _` | | | | _ \
- * | __/\ V /| | || (_| | |_| | |_) |
- * \___| \_/ |_|\__\__,_|____/|____/
- *
- * Copyright (c) 2023
+ * Copyright (c) 2024
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/requestResponse/EvitaEnumConverter.java b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/requestResponse/EvitaEnumConverter.java
index a54c0c9b2..82453a154 100644
--- a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/requestResponse/EvitaEnumConverter.java
+++ b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/requestResponse/EvitaEnumConverter.java
@@ -47,6 +47,7 @@
import io.evitadb.api.requestResponse.schema.dto.AttributeUniquenessType;
import io.evitadb.api.requestResponse.schema.dto.GlobalAttributeUniquenessType;
import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.externalApi.grpc.generated.*;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
@@ -70,7 +71,7 @@ public static CatalogState toCatalogState(@Nonnull GrpcCatalogState grpcCatalogS
return switch (grpcCatalogState.getNumber()) {
case 0 -> CatalogState.WARMING_UP;
case 1 -> CatalogState.ALIVE;
- default -> throw new EvitaInternalError("Unrecognized remote catalog state: " + grpcCatalogState);
+ default -> throw new GenericEvitaInternalError("Unrecognized remote catalog state: " + grpcCatalogState);
};
}
@@ -97,7 +98,7 @@ public static QueryPriceMode toQueryPriceMode(@Nonnull GrpcQueryPriceMode grpcQu
return switch (grpcQueryPriceMode.getNumber()) {
case 0 -> QueryPriceMode.WITH_TAX;
case 1 -> QueryPriceMode.WITHOUT_TAX;
- default -> throw new EvitaInternalError("Unrecognized remote query price mode: " + grpcQueryPriceMode);
+ default -> throw new GenericEvitaInternalError("Unrecognized remote query price mode: " + grpcQueryPriceMode);
};
}
@@ -128,7 +129,7 @@ public static PriceContentMode toPriceContentMode(@Nonnull GrpcPriceContentMode
case 0 -> PriceContentMode.NONE;
case 1 -> PriceContentMode.RESPECTING_FILTER;
case 2 -> PriceContentMode.ALL;
- default -> throw new EvitaInternalError("Unrecognized remote price content mode: " + grpcPriceContentMode);
+ default -> throw new GenericEvitaInternalError("Unrecognized remote price content mode: " + grpcPriceContentMode);
};
}
@@ -159,7 +160,7 @@ public static OrderDirection toOrderDirection(@Nonnull GrpcOrderDirection grpcOr
return switch (grpcOrderDirection.getNumber()) {
case 0 -> OrderDirection.ASC;
case 1 -> OrderDirection.DESC;
- default -> throw new EvitaInternalError("Unrecognized remote order direction: " + grpcOrderDirection);
+ default -> throw new GenericEvitaInternalError("Unrecognized remote order direction: " + grpcOrderDirection);
};
}
@@ -189,7 +190,7 @@ public static OrderBehaviour toOrderBehaviour(@Nonnull GrpcOrderBehaviour grpcOr
return switch (grpcOrderBehaviour.getNumber()) {
case 0 -> OrderBehaviour.NULLS_FIRST;
case 1 -> OrderBehaviour.NULLS_LAST;
- default -> throw new EvitaInternalError("Unrecognized remote order behaviour: " + grpcOrderBehaviour);
+ default -> throw new GenericEvitaInternalError("Unrecognized remote order behaviour: " + grpcOrderBehaviour);
};
}
@@ -221,7 +222,7 @@ public static EmptyHierarchicalEntityBehaviour toEmptyHierarchicalEntityBehaviou
case 0 -> EmptyHierarchicalEntityBehaviour.LEAVE_EMPTY;
case 1 -> EmptyHierarchicalEntityBehaviour.REMOVE_EMPTY;
default ->
- throw new EvitaInternalError("Unrecognized remote empty hierarchical entity behaviour: " + grpcEmptyHierarchicalEntityBehaviour);
+ throw new GenericEvitaInternalError("Unrecognized remote empty hierarchical entity behaviour: " + grpcEmptyHierarchicalEntityBehaviour);
};
}
@@ -251,7 +252,7 @@ public static StatisticsBase toStatisticsBase(@Nonnull GrpcStatisticsBase grpcSt
return switch (grpcStatisticsBase.getNumber()) {
case 0 -> StatisticsBase.COMPLETE_FILTER;
case 1 -> StatisticsBase.WITHOUT_USER_FILTER;
- default -> throw new EvitaInternalError("Unrecognized remote statistics base: " + grpcStatisticsBase);
+ default -> throw new GenericEvitaInternalError("Unrecognized remote statistics base: " + grpcStatisticsBase);
};
}
@@ -281,7 +282,7 @@ public static StatisticsType toStatisticsType(@Nonnull GrpcStatisticsType grpcSt
return switch (grpcStatisticsType.getNumber()) {
case 0 -> StatisticsType.CHILDREN_COUNT;
case 1 -> StatisticsType.QUERIED_ENTITY_COUNT;
- default -> throw new EvitaInternalError("Unrecognized remote statistics type: " + grpcStatisticsType);
+ default -> throw new GenericEvitaInternalError("Unrecognized remote statistics type: " + grpcStatisticsType);
};
}
@@ -297,7 +298,7 @@ public static HistogramBehavior toHistogramBehavior(@Nonnull GrpcHistogramBehavi
return switch (grpcHistogramBehavior.getNumber()) {
case 0 -> HistogramBehavior.STANDARD;
case 1 -> HistogramBehavior.OPTIMIZED;
- default -> throw new EvitaInternalError("Unrecognized remote histogram behavior: " + grpcHistogramBehavior);
+ default -> throw new GenericEvitaInternalError("Unrecognized remote histogram behavior: " + grpcHistogramBehavior);
};
}
@@ -342,7 +343,7 @@ public static AttributeSpecialValue toAttributeSpecialValue(@Nonnull GrpcAttribu
case 0 -> AttributeSpecialValue.NULL;
case 1 -> AttributeSpecialValue.NOT_NULL;
default ->
- throw new EvitaInternalError("Unrecognized remote attribute special value: " + grpcAttributeSpecialValue);
+ throw new GenericEvitaInternalError("Unrecognized remote attribute special value: " + grpcAttributeSpecialValue);
};
}
@@ -372,7 +373,7 @@ public static FacetStatisticsDepth toFacetStatisticsDepth(@Nonnull GrpcFacetStat
case 0 -> FacetStatisticsDepth.COUNTS;
case 1 -> FacetStatisticsDepth.IMPACT;
default ->
- throw new EvitaInternalError("Unrecognized remote facet statistics depth: " + grpcFacetStatisticsDepth);
+ throw new GenericEvitaInternalError("Unrecognized remote facet statistics depth: " + grpcFacetStatisticsDepth);
};
}
@@ -405,7 +406,7 @@ public static PriceInnerRecordHandling toPriceInnerRecordHandling(@Nonnull GrpcP
case 2 -> PriceInnerRecordHandling.SUM;
case 3 -> PriceInnerRecordHandling.UNKNOWN;
default ->
- throw new EvitaInternalError("Unrecognized remote price inner record handling: " + grpcPriceInnerRecordHandling);
+ throw new GenericEvitaInternalError("Unrecognized remote price inner record handling: " + grpcPriceInnerRecordHandling);
};
}
@@ -440,7 +441,7 @@ public static Cardinality toCardinality(@Nonnull GrpcCardinality grpcCardinality
case 2 -> Cardinality.EXACTLY_ONE;
case 3 -> Cardinality.ZERO_OR_MORE;
case 4 -> Cardinality.ONE_OR_MORE;
- default -> throw new EvitaInternalError("Unrecognized remote cardinality: " + grpcCardinality);
+ default -> throw new GenericEvitaInternalError("Unrecognized remote cardinality: " + grpcCardinality);
};
}
@@ -474,7 +475,7 @@ public static GrpcCardinality toGrpcCardinality(@Nullable Cardinality cardinalit
public static CatalogEvolutionMode toCatalogEvolutionMode(@Nonnull GrpcCatalogEvolutionMode grpcEvolutionMode) {
return switch (grpcEvolutionMode.getNumber()) {
case 0 -> CatalogEvolutionMode.ADDING_ENTITY_TYPES;
- default -> throw new EvitaInternalError("Unrecognized remote evolution mode: " + grpcEvolutionMode);
+ default -> throw new GenericEvitaInternalError("Unrecognized remote evolution mode: " + grpcEvolutionMode);
};
}
@@ -509,7 +510,7 @@ public static EvolutionMode toEvolutionMode(@Nonnull GrpcEvolutionMode grpcEvolu
case 5 -> EvolutionMode.ADDING_LOCALES;
case 6 -> EvolutionMode.ADDING_CURRENCIES;
case 7 -> EvolutionMode.ADDING_HIERARCHY;
- default -> throw new EvitaInternalError("Unrecognized remote evolution mode: " + grpcEvolutionMode);
+ default -> throw new GenericEvitaInternalError("Unrecognized remote evolution mode: " + grpcEvolutionMode);
};
}
@@ -564,7 +565,7 @@ public static QueryPhase toQueryPhase(@Nonnull GrpcQueryPhase grpcQueryPhase) {
case 18 -> QueryPhase.FETCHING;
case 19 -> QueryPhase.FETCHING_REFERENCES;
case 20 -> QueryPhase.FETCHING_PARENTS;
- default -> throw new EvitaInternalError("Unrecognized remote query phase: " + grpcQueryPhase);
+ default -> throw new GenericEvitaInternalError("Unrecognized remote query phase: " + grpcQueryPhase);
};
}
@@ -615,7 +616,7 @@ public static EntityExistence toEntityExistence(@Nonnull GrpcEntityExistence grp
case 0 -> EntityExistence.MAY_EXIST;
case 1 -> EntityExistence.MUST_NOT_EXIST;
case 2 -> EntityExistence.MUST_EXIST;
- default -> throw new EvitaInternalError("Unrecognized remote entity existence: " + grpcEntityExistence);
+ default -> throw new GenericEvitaInternalError("Unrecognized remote entity existence: " + grpcEntityExistence);
};
}
@@ -650,7 +651,7 @@ public static GrpcAttributeSchemaType toGrpcAttributeSchemaType(@Nonnull Class
} else if (AttributeSchemaContract.class.isAssignableFrom(attributeSchemaClass)) {
return GrpcAttributeSchemaType.REFERENCE;
} else {
- throw new EvitaInternalError("Unrecognized attribute schema type: " + attributeSchemaClass);
+ throw new GenericEvitaInternalError("Unrecognized attribute schema type: " + attributeSchemaClass);
}
}
@@ -666,7 +667,7 @@ public static AttributeUniquenessType toAttributeUniquenessType(@Nonnull GrpcAtt
case 0 -> AttributeUniquenessType.NOT_UNIQUE;
case 1 -> AttributeUniquenessType.UNIQUE_WITHIN_COLLECTION;
case 2 -> AttributeUniquenessType.UNIQUE_WITHIN_COLLECTION_LOCALE;
- default -> throw new EvitaInternalError("Unrecognized remote attribute uniqueness type: " + type);
+ default -> throw new GenericEvitaInternalError("Unrecognized remote attribute uniqueness type: " + type);
};
}
@@ -697,7 +698,7 @@ public static GlobalAttributeUniquenessType toGlobalAttributeUniquenessType(@Non
case 0 -> GlobalAttributeUniquenessType.NOT_UNIQUE;
case 1 -> GlobalAttributeUniquenessType.UNIQUE_WITHIN_CATALOG;
case 2 -> GlobalAttributeUniquenessType.UNIQUE_WITHIN_CATALOG_LOCALE;
- default -> throw new EvitaInternalError("Unrecognized remote global attribute uniqueness type: " + type);
+ default -> throw new GenericEvitaInternalError("Unrecognized remote global attribute uniqueness type: " + type);
};
}
@@ -744,7 +745,7 @@ public static CommitBehavior toCommitBehavior(@Nonnull GrpcCommitBehavior commit
case WAIT_FOR_CONFLICT_RESOLUTION -> CommitBehavior.WAIT_FOR_CONFLICT_RESOLUTION;
case WAIT_FOR_LOG_PERSISTENCE -> CommitBehavior.WAIT_FOR_WAL_PERSISTENCE;
case WAIT_FOR_INDEX_PROPAGATION -> CommitBehavior.WAIT_FOR_INDEX_PROPAGATION;
- default -> throw new EvitaInternalError("Unrecognized remote commit behavior: " + commitBehaviour);
+ default -> throw new GenericEvitaInternalError("Unrecognized remote commit behavior: " + commitBehaviour);
};
}
diff --git a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/requestResponse/ResponseConverter.java b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/requestResponse/ResponseConverter.java
index a69f2e450..c9a4acadf 100644
--- a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/requestResponse/ResponseConverter.java
+++ b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/requestResponse/ResponseConverter.java
@@ -51,7 +51,7 @@
import io.evitadb.dataType.DataChunk;
import io.evitadb.dataType.PaginatedList;
import io.evitadb.dataType.StripList;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.externalApi.grpc.generated.*;
import io.evitadb.externalApi.grpc.generated.GrpcHistogram.GrpcBucket;
import io.evitadb.externalApi.grpc.requestResponse.data.EntityConverter;
@@ -108,7 +108,7 @@ public static DataChunk convertToDataChunk(
converter.apply(grpcRecordPage)
);
} else {
- throw new EvitaInternalError(
+ throw new GenericEvitaInternalError(
"Only PaginatedList or StripList expected, but got none!"
);
}
@@ -277,7 +277,7 @@ private static FacetGroupStatistics toFacetGroupStatistics(
it -> it.getFacetEntity().getPrimaryKey(),
Function.identity(),
(o, o2) -> {
- throw new EvitaInternalError("Duplicate facet statistics for entity " + o.getFacetEntity().getPrimaryKey());
+ throw new GenericEvitaInternalError("Duplicate facet statistics for entity " + o.getFacetEntity().getPrimaryKey());
},
LinkedHashMap::new
)
diff --git a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/requestResponse/data/EntityConverter.java b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/requestResponse/data/EntityConverter.java
index 2fecd3433..4ba84f890 100644
--- a/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/requestResponse/data/EntityConverter.java
+++ b/evita_external_api/evita_external_api_grpc/shared/src/main/java/io/evitadb/externalApi/grpc/requestResponse/data/EntityConverter.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023
+ * Copyright (c) 2023-2024
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -54,7 +54,7 @@
import io.evitadb.api.requestResponse.data.structure.predicate.ReferenceContractSerializablePredicate;
import io.evitadb.api.requestResponse.schema.ReferenceSchemaContract;
import io.evitadb.api.requestResponse.schema.SealedEntitySchema;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.externalApi.grpc.dataType.ComplexDataObjectConverter;
import io.evitadb.externalApi.grpc.dataType.EvitaDataTypesConverter;
import io.evitadb.externalApi.grpc.generated.*;
@@ -141,7 +141,7 @@ public static T toEntity(
}
if (EntityReference.class.isAssignableFrom(expectedType)) {
- throw new EvitaInternalError("EntityReference is not expected in this method!");
+ throw new GenericEvitaInternalError("EntityReference is not expected in this method!");
} else {
final List references = grpcEntity.getReferencesList()
.stream()
diff --git a/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/ObservabilityManager.java b/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/ObservabilityManager.java
index ef653450b..dfe59aa52 100644
--- a/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/ObservabilityManager.java
+++ b/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/ObservabilityManager.java
@@ -26,12 +26,14 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import io.evitadb.core.Evita;
import io.evitadb.core.metric.event.CustomMetricsExecutionEvent;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.exception.UnexpectedIOException;
import io.evitadb.externalApi.api.system.model.HealthProblem;
import io.evitadb.externalApi.configuration.ApiOptions;
import io.evitadb.externalApi.http.CorsFilter;
+import io.evitadb.externalApi.http.ExternalApiProviderRegistrar;
import io.evitadb.externalApi.http.PathNormalizingHandler;
+import io.evitadb.externalApi.observability.agent.ErrorMonitor;
import io.evitadb.externalApi.observability.configuration.ObservabilityConfig;
import io.evitadb.externalApi.observability.exception.JfRException;
import io.evitadb.externalApi.observability.io.ObservabilityExceptionHandler;
@@ -58,10 +60,13 @@
import jdk.jfr.Recording;
import jdk.jfr.RecordingState;
import lombok.Getter;
+import lombok.extern.slf4j.Slf4j;
import javax.annotation.Nonnull;
import java.io.File;
import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.nio.file.Path;
import java.util.Arrays;
@@ -69,6 +74,7 @@
import java.util.Optional;
import java.util.Set;
import java.util.concurrent.atomic.AtomicLong;
+import java.util.function.Consumer;
/**
* This class is used as an orchestrator for all observability-related tasks. It is responsible for starting and stopping
@@ -80,6 +86,7 @@
*
* @author Tomáš Pozler, FG Forrest a.s. (c) 2024
*/
+@Slf4j
public class ObservabilityManager {
public static final String METRICS_SUFFIX = "metrics";
public static final String METRICS_PATH = "/observability/" + METRICS_SUFFIX;
@@ -132,6 +139,28 @@ public class ObservabilityManager {
*/
@Nonnull @Getter private final ObjectMapper objectMapper = new ObjectMapper();
+ static {
+ ClassLoader classLoader = null;
+ do {
+ if (classLoader == null) {
+ classLoader = MetricHandler.class.getClassLoader();
+ } else {
+ classLoader = classLoader.getParent();
+ }
+ try {
+ final Class> errorMonitorClass = classLoader.loadClass(ErrorMonitor.class.getName());
+ final Method setJavaErrorConsumer = errorMonitorClass.getDeclaredMethod("setJavaErrorConsumer", Consumer.class);
+ setJavaErrorConsumer.invoke(null, (Consumer) ObservabilityManager::javaErrorEvent);
+ final Method setEvitaErrorConsumer = errorMonitorClass.getDeclaredMethod("setEvitaErrorConsumer", Consumer.class);
+ setEvitaErrorConsumer.invoke(null, (Consumer) ObservabilityManager::evitaErrorEvent);
+ } catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException |
+ InvocationTargetException e) {
+ // do nothing, the errors won't be monitored
+ log.error("ErrorMonitor class not found, the Java & evitaDB errors won't be present in metrics.");
+ }
+ } while (classLoader.getParent() != null);
+ }
+
/**
* Method increments the counter of Java errors in the Prometheus metrics.
*/
@@ -209,6 +238,15 @@ public long getEvitaErrorCount() {
return EVITA_ERRORS.get();
}
+ /**
+ * Records readiness of the API to the Prometheus metrics.
+ * @param apiCode the code of the API taken from {@link ExternalApiProviderRegistrar#getExternalApiCode()}
+ * @param ready true if the API is ready, false otherwise
+ */
+ public void recordReadiness(@Nonnull String apiCode, boolean ready) {
+ MetricHandler.API_READINESS.labelValues(apiCode).set(ready ? 1 : 0);
+ }
+
/**
* Records health problem to the Prometheus metrics.
* @param healthProblem the health problem to be recorded
@@ -310,7 +348,7 @@ private void registerRecordingFileResourceHandler() {
});
observabilityRouter.addPrefixPath("/", resourceHandler);
} catch (IOException e) {
- throw new EvitaInternalError(e.getMessage(), e);
+ throw new GenericEvitaInternalError(e.getMessage(), e);
}
}
@@ -332,7 +370,7 @@ private void createAndRegisterPrometheusServlet() {
try {
observabilityRouter.addPrefixPath("/" + METRICS_SUFFIX, servletDeploymentManager.start());
} catch (ServletException e) {
- throw new EvitaInternalError("Unable to add routing to Prometheus scraping servlet.");
+ throw new GenericEvitaInternalError("Unable to add routing to Prometheus scraping servlet.");
}
}
diff --git a/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/agent/ErrorMonitor.java b/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/agent/ErrorMonitor.java
new file mode 100644
index 000000000..bc7e50a20
--- /dev/null
+++ b/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/agent/ErrorMonitor.java
@@ -0,0 +1,62 @@
+/*
+ *
+ * _ _ ____ ____
+ * _____ _(_) |_ __ _| _ \| __ )
+ * / _ \ \ / / | __/ _` | | | | _ \
+ * | __/\ V /| | || (_| | |_| | |_) |
+ * \___| \_/ |_|\__\__,_|____/|____/
+ *
+ * Copyright (c) 2024
+ *
+ * Licensed under the Business Source License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://github.com/FgForrest/evitaDB/blob/main/LICENSE
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package io.evitadb.externalApi.observability.agent;
+
+import io.evitadb.externalApi.observability.ObservabilityManager;
+import lombok.Setter;
+
+import javax.annotation.Nonnull;
+import java.util.function.Consumer;
+
+/**
+ * This simple class serves as a mediator between advices in the ErrorMonitoringAgent and the {@link ObservabilityManager},
+ * which registers lambda functions to be called when an error is detected.
+ *
+ * @author Jan Novotný (novotny@fg.cz), FG Forrest a.s. (c) 2024
+ */
+public class ErrorMonitor {
+ @Setter private static Consumer javaErrorConsumer;
+ @Setter private static Consumer evitaErrorConsumer;
+
+ /**
+ * Method is called by the ErrorMonitoringAgent advice when a Java error is detected.
+ * @param errorType the type of the error
+ */
+ public static void registerJavaError(@Nonnull String errorType) {
+ if (javaErrorConsumer != null) {
+ javaErrorConsumer.accept(errorType);
+ }
+ }
+
+ /**
+ * Method is called by the ErrorMonitoringAgent advice when an Evita error is detected.
+ * @param errorType the type of the error
+ */
+ public static void registerEvitaError(@Nonnull String errorType) {
+ if (evitaErrorConsumer != null) {
+ evitaErrorConsumer.accept(errorType);
+ }
+ }
+
+}
diff --git a/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/agent/ErrorMonitoringAgent.java b/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/agent/ErrorMonitoringAgent.java
index da2195c47..4d96614e0 100644
--- a/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/agent/ErrorMonitoringAgent.java
+++ b/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/agent/ErrorMonitoringAgent.java
@@ -24,18 +24,20 @@
package io.evitadb.externalApi.observability.agent;
import io.evitadb.exception.EvitaInternalError;
-import io.evitadb.externalApi.observability.ObservabilityManager;
import net.bytebuddy.agent.builder.AgentBuilder;
import net.bytebuddy.asm.Advice;
-import net.bytebuddy.asm.Advice.OnMethodEnter;
+import net.bytebuddy.asm.Advice.OnMethodExit;
+import net.bytebuddy.description.type.TypeDescription;
import net.bytebuddy.dynamic.loading.ClassInjector;
+import javax.annotation.Nonnull;
+import java.io.IOException;
+import java.io.InputStream;
import java.lang.instrument.Instrumentation;
+import java.util.HashMap;
+import java.util.Map;
-import static net.bytebuddy.matcher.ElementMatchers.isConstructor;
-import static net.bytebuddy.matcher.ElementMatchers.isSubTypeOf;
-import static net.bytebuddy.matcher.ElementMatchers.nameStartsWith;
-import static net.bytebuddy.matcher.ElementMatchers.none;
+import static net.bytebuddy.matcher.ElementMatchers.*;
/**
* Agent that intercepts all Error constructors and sends a metric to the MetricHandler.
@@ -54,14 +56,14 @@ public static void premain(String agentArgs, Instrumentation inst) {
.with(AgentBuilder.RedefinitionStrategy.RETRANSFORMATION)
.ignore(none())
.ignore(nameStartsWith("net.bytebuddy."))
- .type(isSubTypeOf(Error.class))
+ .type(isSubTypeOf(VirtualMachineError.class).and(not(isAbstract())))
.transform((builder, typeDescription, classLoader, module, protectionDomain) -> builder
.visit(
Advice
.to(JavaErrorConstructorInterceptAdvice.class)
.on(isConstructor())
))
- .type(isSubTypeOf(EvitaInternalError.class))
+ .type(isSubTypeOf(EvitaInternalError.class).and(not(isAbstract())))
.transform((builder, typeDescription, classLoader, module, protectionDomain) -> builder
.visit(
Advice
@@ -69,6 +71,38 @@ public static void premain(String agentArgs, Instrumentation inst) {
.on(isConstructor())
))
.installOn(inst);
+
+ // Inject ErrorMonitoring class into the bootstrap classloader
+ Map types = new HashMap<>(8);
+ types.put(
+ new TypeDescription.ForLoadedType(ErrorMonitor.class),
+ getClassBytes(ErrorMonitor.class)
+ );
+ ClassInjector.UsingUnsafe.ofBootLoader().inject(types);
+ }
+
+ /**
+ * Get the bytes of a particular class from classpath.
+ * @param clazz Class to get bytes of.
+ * @return Byte array of the class.
+ */
+ @Nonnull
+ public static byte[] getClassBytes(@Nonnull Class> clazz) {
+ try {
+ final String classAsResource = clazz.getName().replace('.', '/') + ".class";
+ try (InputStream classStream = ErrorMonitoringAgent.class.getClassLoader().getResourceAsStream(classAsResource)) {
+ if (classStream == null) {
+ System.err.println("Class `" + clazz.getName() + "` not found in classpath and is required by ErrorMonitoringAgent.");
+ System.exit(1);
+ throw new IllegalStateException("Class `" + clazz.getName() + "` not found in classpath and is required by ErrorMonitoringAgent.");
+ }
+ return classStream.readAllBytes();
+ }
+ } catch (IOException e) {
+ System.err.println("Class `" + clazz.getName() + "` not found in classpath and is required by ErrorMonitoringAgent.");
+ System.exit(1);
+ throw new IllegalStateException("Class `" + clazz.getName() + "` not found in classpath and is required by ErrorMonitoringAgent.");
+ }
}
/**
@@ -76,9 +110,9 @@ public static void premain(String agentArgs, Instrumentation inst) {
*/
public static class JavaErrorConstructorInterceptAdvice {
- @OnMethodEnter
- public static boolean before(@Advice.This Object thiz) {
- ObservabilityManager.javaErrorEvent(thiz.getClass().getSimpleName());
+ @OnMethodExit
+ public static boolean after(@Advice.This Object thiz) {
+ ErrorMonitor.registerJavaError(thiz.getClass().getSimpleName());
return true;
}
@@ -89,9 +123,9 @@ public static boolean before(@Advice.This Object thiz) {
*/
public static class EvitaDbErrorConstructorInterceptAdvice {
- @OnMethodEnter
- public static boolean before(@Advice.This Object thiz) {
- ObservabilityManager.evitaErrorEvent(thiz.getClass().getSimpleName());
+ @OnMethodExit
+ public static boolean after(@Advice.This Object thiz) {
+ ErrorMonitor.registerEvitaError(thiz.getClass().getSimpleName());
return true;
}
diff --git a/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/metric/MetricHandler.java b/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/metric/MetricHandler.java
index 3a9d29f4e..d1c2df52e 100644
--- a/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/metric/MetricHandler.java
+++ b/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/metric/MetricHandler.java
@@ -76,15 +76,20 @@ public class MetricHandler {
.help("Total number of internal Java errors")
.register();
public static final Counter EVITA_ERRORS_TOTAL = Counter.builder()
- .name("evita_errors_total")
+ .name("io_evitadb_errors_total")
.labelNames("error_type")
.help("Total number of internal evitaDB errors")
.register();
public static final Gauge HEALTH_PROBLEMS = Gauge.builder()
- .name("evita_health_problem")
+ .name("io_evitadb_probe_health_problem")
.labelNames("problem_type")
.help("Health problems detected in the system")
.register();
+ public static final Gauge API_READINESS = Gauge.builder()
+ .name("io_evitadb_probe_api_readiness")
+ .labelNames("api_type")
+ .help("Status of the API readiness (internal HTTP call check)")
+ .register();
static {
DEFAULT_JVM_METRICS = Map.of(
diff --git a/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/metric/ObservabilityProbesDetector.java b/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/metric/ObservabilityProbesDetector.java
index 12e209009..ea9a7545d 100644
--- a/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/metric/ObservabilityProbesDetector.java
+++ b/evita_external_api/evita_external_api_observability/src/main/java/io/evitadb/externalApi/observability/metric/ObservabilityProbesDetector.java
@@ -143,12 +143,14 @@ public Set getHealthProblems(@Nonnull EvitaContract evitaContract
@Nonnull
@Override
public Readiness getReadiness(@Nonnull EvitaContract evitaContract, @Nonnull ExternalApiServer externalApiServer, @Nonnull String... apiCodes) {
+ final Optional theObservabilityManager = getObservabilityManager(externalApiServer);
// check the end-points availability
final Collection availableExternalApis = ExternalApiServer.gatherExternalApiProviders();
final Map readiness = CollectionUtils.createHashMap(availableExternalApis.size());
for (String apiCode : apiCodes) {
final ExternalApiProvider> apiProvider = externalApiServer.getExternalApiProviderByCode(apiCode);
readiness.put(apiProvider.getCode(), apiProvider.isReady());
+ theObservabilityManager.ifPresent(it -> it.recordReadiness(apiProvider.getCode(), apiProvider.isReady()));
}
final boolean ready = readiness.values().stream().allMatch(Boolean::booleanValue);
if (ready) {
diff --git a/evita_external_api/evita_external_api_rest/src/main/java/io/evitadb/externalApi/rest/api/catalog/builder/CatalogRestBuildingContext.java b/evita_external_api/evita_external_api_rest/src/main/java/io/evitadb/externalApi/rest/api/catalog/builder/CatalogRestBuildingContext.java
index ed7c71419..66e5397f9 100644
--- a/evita_external_api/evita_external_api_rest/src/main/java/io/evitadb/externalApi/rest/api/catalog/builder/CatalogRestBuildingContext.java
+++ b/evita_external_api/evita_external_api_rest/src/main/java/io/evitadb/externalApi/rest/api/catalog/builder/CatalogRestBuildingContext.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023
+ * Copyright (c) 2023-2024
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -28,7 +28,7 @@
import io.evitadb.api.requestResponse.schema.EntitySchemaContract;
import io.evitadb.api.requestResponse.schema.SealedEntitySchema;
import io.evitadb.core.Evita;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.externalApi.rest.api.builder.RestBuildingContext;
import io.evitadb.externalApi.rest.api.openApi.OpenApiObject;
import io.evitadb.externalApi.rest.api.openApi.OpenApiTypeReference;
@@ -80,7 +80,7 @@ public CatalogRestBuildingContext(@Nullable String exposedOn, @Nonnull RestConfi
final Set schemas = createHashSet(collections.size());
collections.forEach(c -> {
final SealedEntitySchema entitySchema = session.getEntitySchema(c)
- .orElseThrow(() -> new EvitaInternalError("Schema for `" + c + "` entity type unexpectedly not found!"));
+ .orElseThrow(() -> new GenericEvitaInternalError("Schema for `" + c + "` entity type unexpectedly not found!"));
supportedLocales.addAll(entitySchema.getLocales());
supportedCurrencies.addAll(entitySchema.getCurrencies());
schemas.add(entitySchema);
diff --git a/evita_external_api/evita_external_api_system/src/main/java/io/evitadb/externalApi/system/SystemProviderRegistrar.java b/evita_external_api/evita_external_api_system/src/main/java/io/evitadb/externalApi/system/SystemProviderRegistrar.java
index 43a1ca8d0..786d421d3 100644
--- a/evita_external_api/evita_external_api_system/src/main/java/io/evitadb/externalApi/system/SystemProviderRegistrar.java
+++ b/evita_external_api/evita_external_api_system/src/main/java/io/evitadb/externalApi/system/SystemProviderRegistrar.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023
+ * Copyright (c) 2023-2024
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,7 +25,7 @@
import io.evitadb.api.requestResponse.system.SystemStatus;
import io.evitadb.core.Evita;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.externalApi.api.system.ProbesProvider;
import io.evitadb.externalApi.api.system.ProbesProvider.Readiness;
import io.evitadb.externalApi.api.system.ProbesProvider.ReadinessState;
@@ -75,8 +75,8 @@ public class SystemProviderRegistrar implements ExternalApiProviderRegistrar "\t\t\"" + entry.apiCode() + "\": \"" + (entry.isReady() ? "ready" : "not ready") + "\"")
- .collect(Collectors.joining(",\n")) + "\n" +
+ Arrays.stream(readiness.apiStates())
+ .map(entry -> "\t\t\"" + entry.apiCode() + "\": \"" + (entry.isReady() ? "ready" : "not ready") + "\"")
+ .collect(Collectors.joining(",\n")) + "\n" +
"\t}\n" +
"}"
);
@@ -140,6 +140,23 @@ private static String renderStatus(
);
}
+ /**
+ * Returns the enabled API endpoints.
+ *
+ * @param apiOptions the common settings shared among all the API endpoints
+ * @return array of codes of the enabled API endpoints
+ */
+ @Nonnull
+ private static String[] getEnabledApiEndpoints(@Nonnull ApiOptions apiOptions) {
+ return apiOptions.endpoints()
+ .entrySet()
+ .stream()
+ .filter(entry -> entry.getValue() != null)
+ .filter(entry -> entry.getValue().isEnabled())
+ .map(Entry::getKey)
+ .toArray(String[]::new);
+ }
+
@Nonnull
@Override
public String getExternalApiCode() {
@@ -171,7 +188,7 @@ public ExternalApiProvider register(
} else {
final CertificatePath certificatePath = certificateSettings.custom();
if (certificatePath == null || certificatePath.certificate() == null || certificatePath.privateKey() == null) {
- throw new EvitaInternalError("Certificate path is not properly set in the configuration file.");
+ throw new GenericEvitaInternalError("Certificate path is not properly set in the configuration file.");
}
final String certificate = certificatePath.certificate();
final int lastSeparatorIndex = certificatePath.certificate().lastIndexOf(File.separator);
@@ -230,14 +247,7 @@ public ExternalApiProvider register(
}
);
- final String[] enabledEndPoints = apiOptions.endpoints()
- .entrySet()
- .stream()
- .filter(entry -> entry.getValue() != null)
- .filter(entry -> entry.getValue().isEnabled())
- .map(Entry::getKey)
- .toArray(String[]::new);
-
+ final String[] enabledEndPoints = getEnabledApiEndpoints(apiOptions);
router.addExactPath(
"/" + ENDPOINT_SYSTEM_READINESS,
exchange -> {
@@ -315,7 +325,7 @@ public ExternalApiProvider register(
new String[0]
);
} catch (IOException e) {
- throw new EvitaInternalError(e.getMessage(), e);
+ throw new GenericEvitaInternalError(e.getMessage(), e);
}
}
diff --git a/evita_functional_tests/src/test/java/io/evitadb/api/exception/EvitaInternalErrorTest.java b/evita_functional_tests/src/test/java/io/evitadb/api/exception/EvitaInternalErrorTest.java
index e8a426266..d9160f5e3 100644
--- a/evita_functional_tests/src/test/java/io/evitadb/api/exception/EvitaInternalErrorTest.java
+++ b/evita_functional_tests/src/test/java/io/evitadb/api/exception/EvitaInternalErrorTest.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023
+ * Copyright (c) 2023-2024
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,6 +24,7 @@
package io.evitadb.api.exception;
import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -37,7 +38,7 @@ class EvitaInternalErrorTest {
@Test
void shouldProduceCorrectErrorCode() {
- final EvitaInternalError someError = new EvitaInternalError("Whatever");
- assertEquals("84346f4d5323dd1aab59c301c22be909:c44f193800fc6962d8987aa7cd6ed71d:40", someError.getErrorCode());
+ final EvitaInternalError someError = new GenericEvitaInternalError("Whatever");
+ assertEquals("62663481f4e06623dca9964d207b9599:af7e03290249dcf135c6dd7ad7cd6bc9:84", someError.getErrorCode());
}
-}
\ No newline at end of file
+}
diff --git a/evita_functional_tests/src/test/java/io/evitadb/api/query/parser/ValueTest.java b/evita_functional_tests/src/test/java/io/evitadb/api/query/parser/ValueTest.java
index 6f19f23e3..310e3f7ec 100644
--- a/evita_functional_tests/src/test/java/io/evitadb/api/query/parser/ValueTest.java
+++ b/evita_functional_tests/src/test/java/io/evitadb/api/query/parser/ValueTest.java
@@ -25,6 +25,7 @@
import io.evitadb.dataType.exception.InconvertibleDataTypeException;
import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.EvitaInvalidUsageException;
import org.junit.jupiter.api.Test;
import java.util.List;
@@ -67,7 +68,7 @@ void shouldReturnLocale() {
@Test
void shouldNotReturnLocale() {
- assertThrows(EvitaInternalError.class, () -> new Value(1).asLocale());
+ assertThrows(EvitaInvalidUsageException.class, () -> new Value(1).asLocale());
assertThrows(InconvertibleDataTypeException.class, () -> new Value("").asLocale());
assertThrows(InconvertibleDataTypeException.class, () -> new Value("zz").asLocale());
}
@@ -91,4 +92,4 @@ void shouldReturnLocaleArray() {
void shouldNotReturnIntegerArray() {
assertThrows(EvitaInternalError.class, () -> new Value(List.of(1, "b")).asIntegerArray());
}
-}
\ No newline at end of file
+}
diff --git a/evita_functional_tests/src/test/java/io/evitadb/documentation/JavaDocCopy.java b/evita_functional_tests/src/test/java/io/evitadb/documentation/JavaDocCopy.java
index 989a58b51..389a28c06 100644
--- a/evita_functional_tests/src/test/java/io/evitadb/documentation/JavaDocCopy.java
+++ b/evita_functional_tests/src/test/java/io/evitadb/documentation/JavaDocCopy.java
@@ -6,7 +6,7 @@
* | __/\ V /| | || (_| | |_| | |_) |
* \___| \_/ |_|\__\__,_|____/|____/
*
- * Copyright (c) 2023
+ * Copyright (c) 2023-2024
*
* Licensed under the Business Source License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
@@ -34,7 +34,7 @@
import io.evitadb.api.query.Constraint;
import io.evitadb.api.query.QueryConstraints;
import io.evitadb.api.query.descriptor.annotation.ConstraintDefinition;
-import io.evitadb.exception.EvitaInternalError;
+import io.evitadb.exception.GenericEvitaInternalError;
import io.evitadb.test.EvitaTestSupport;
import io.evitadb.utils.StringUtils;
import org.junit.jupiter.api.Test;
@@ -254,20 +254,19 @@ void copyConstraintUserDocsLinksToJavaDocs() throws URISyntaxException, IOExcept
}
}
if (commentStartLine == -1) {
- throw new EvitaInternalError("Could not find author line in `" + constraintClass.getName() + "`");
+ throw new GenericEvitaInternalError("Could not find author line in `" + constraintClass.getName() + "`");
}
final String comment = constraintClass.getComment();
final int commentEndLine = comment.split("\n").length + commentStartLine;
- final int originalUserDocsLinkLineNumber = commentEndLine;
- final String originalUserDocsLinkLine = constraintSource.get(originalUserDocsLinkLineNumber);
+ final String originalUserDocsLinkLine = constraintSource.get(commentEndLine);
if (originalUserDocsLinkLine.contains("Visit detailed user documentation