();
+
+ var things = client.collections.use(COLLECTION);
+ for (int i = 0; i < n; i++) {
+ var vector = randomVector(10, -.01f, .001f);
+ var object = things.data.insert(
+ Map.of(),
+ metadata -> metadata
+ .id(randomUUID())
+ .vectors(Vectors.of(VECTOR_INDEX, vector)));
+
+ created.put(object.metadata().id(), vector);
+ }
+
+ return created;
+ }
+
+ /**
+ * Create {@link COLLECTION} with {@link VECTOR_INDEX} vector index.
+ *
+ * @throws IOException
+ */
+ private static void createTestCollection() throws IOException {
+ client.collections.create(COLLECTION, cfg -> cfg
+ .vector(VECTOR_INDEX, new VectorIndex<>(IndexingStrategy.hnsw(), Vectorizer.none())));
+ }
+}
diff --git a/src/it/java/io/weaviate/containers/Container.java b/src/it/java/io/weaviate/containers/Container.java
new file mode 100644
index 000000000..9ef69cfe8
--- /dev/null
+++ b/src/it/java/io/weaviate/containers/Container.java
@@ -0,0 +1,105 @@
+package io.weaviate.containers;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.junit.rules.TestRule;
+import org.junit.runner.Description;
+import org.junit.runners.model.Statement;
+import org.testcontainers.containers.GenericContainer;
+import org.testcontainers.containers.Network;
+import org.testcontainers.lifecycle.Startable;
+
+import io.weaviate.client6.WeaviateClient;
+import lombok.RequiredArgsConstructor;
+
+public class Container {
+ public static final Weaviate WEAVIATE = Weaviate.createDefault();
+ public static final Contextionary CONTEXTIONARY = Contextionary.createDefault();
+
+ static {
+ startAll();
+ }
+
+ /** Start all shared Testcontainers. */
+ // TODO: start lazily!
+ static void startAll() {
+ // WEAVIATE.start();
+ }
+
+ /**
+ * Stop all shared Testcontainers created in {@link #startAll}.
+ *
+ * Testcontainer's Ryuk will reap any dangling containers after the tests
+ * finish. However, since {@link Weaviate} instances also hold a
+ * {@link WeaviateClient}, we want to stop them proactively to
+ * close client connections.
+ */
+ static void stopAll() {
+ WEAVIATE.stop();
+ }
+
+ public static Group compose(Weaviate weaviate, GenericContainer>... containers) {
+ return new Group(weaviate, containers);
+ }
+
+ public static TestRule asTestRule(Startable container) {
+ return new PerTestSuite(container);
+ };
+
+ public static class Group implements Startable {
+ private final Weaviate weaviate;
+ private final List> containers;
+
+ private Group(Weaviate weaviate, GenericContainer>... containers) {
+ this.weaviate = weaviate;
+ this.containers = Arrays.asList(containers);
+ setSharedNetwork();
+ }
+
+ public WeaviateClient getClient() {
+ return weaviate.getClient();
+ }
+
+ @Override
+ public void start() {
+ containers.forEach(GenericContainer::start);
+ weaviate.start();
+ }
+
+ @Override
+ public void stop() {
+ weaviate.stop();
+ containers.forEach(GenericContainer::stop);
+ }
+
+ private void setSharedNetwork() {
+ weaviate.setNetwork(Network.SHARED);
+ containers.forEach(c -> c.setNetwork(Network.SHARED));
+ }
+
+ public TestRule asTestRule() {
+ return new PerTestSuite(this);
+ };
+ }
+
+ @RequiredArgsConstructor
+ public static class PerTestSuite implements TestRule {
+ private final Startable container;
+
+ @Override
+ public Statement apply(Statement base, Description description) {
+ return new Statement() {
+ @Override
+ public void evaluate() throws Throwable {
+ try {
+ container.start();
+ base.evaluate();
+ } finally {
+ container.stop();
+ }
+ }
+ };
+ }
+ }
+}
diff --git a/src/it/java/io/weaviate/containers/Contextionary.java b/src/it/java/io/weaviate/containers/Contextionary.java
new file mode 100644
index 000000000..76ec5aefd
--- /dev/null
+++ b/src/it/java/io/weaviate/containers/Contextionary.java
@@ -0,0 +1,46 @@
+package io.weaviate.containers;
+
+import org.testcontainers.containers.GenericContainer;
+
+public class Contextionary extends GenericContainer {
+ public static final String VERSION = "en0.16.0-v1.2.1";
+ public static final String DOCKER_IMAGE = "semitechnologies/contextionary";
+ public static final String MODULE = "text2vec-contextionary";
+
+ public static final String HOST_NAME = "contextionary";
+ public static final String URL = HOST_NAME + ":9999";
+
+ static Contextionary createDefault() {
+ return new Builder().build();
+ }
+
+ static Contextionary.Builder custom() {
+ return new Builder();
+ }
+
+ public static class Builder {
+ private String versionTag;
+
+ public Builder() {
+ this.versionTag = VERSION;
+ }
+
+ public Contextionary build() {
+ var container = new Contextionary(DOCKER_IMAGE + ":" + versionTag);
+ container
+ .withEnv("OCCURRENCE_WEIGHT_LINEAR_FACTOR", "true")
+ .withEnv("PERSISTENCE_DATA_PATH", "/var/lib/weaviate")
+ .withEnv("OCCURRENCE_WEIGHT_LINEAR_FACTOR", "0.75")
+ .withEnv("EXTENSIONS_STORAGE_MODE", "weaviate")
+ .withEnv("EXTENSIONS_STORAGE_ORIGIN", "http://weaviate:8080")
+ .withEnv("NEIGHBOR_OCCURRENCE_IGNORE_PERCENTILE", "5")
+ .withEnv("ENABLE_COMPOUND_SPLITTING", "'false'");
+ container.withCreateContainerCmdModifier(cmd -> cmd.withHostName("contextionary"));
+ return container;
+ }
+ }
+
+ public Contextionary(String image) {
+ super(image);
+ }
+}
diff --git a/src/it/java/io/weaviate/containers/TestListener.java b/src/it/java/io/weaviate/containers/TestListener.java
new file mode 100644
index 000000000..72889125b
--- /dev/null
+++ b/src/it/java/io/weaviate/containers/TestListener.java
@@ -0,0 +1,14 @@
+package io.weaviate.containers;
+
+import org.junit.runner.Result;
+import org.junit.runner.notification.RunListener;
+
+public class TestListener extends RunListener {
+
+ @Override
+ public void testRunFinished(Result result) throws Exception {
+ Container.stopAll();
+ super.testRunFinished(result);
+ }
+
+}
diff --git a/src/it/java/io/weaviate/containers/Weaviate.java b/src/it/java/io/weaviate/containers/Weaviate.java
new file mode 100644
index 000000000..6126d5150
--- /dev/null
+++ b/src/it/java/io/weaviate/containers/Weaviate.java
@@ -0,0 +1,123 @@
+package io.weaviate.containers;
+
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.testcontainers.weaviate.WeaviateContainer;
+
+import io.weaviate.client6.Config;
+import io.weaviate.client6.WeaviateClient;
+
+public class Weaviate extends WeaviateContainer {
+ private static WeaviateClient clientInstance;
+
+ public static final String VERSION = "1.29.0";
+ public static final String DOCKER_IMAGE = "semitechnologies/weaviate";
+
+ /**
+ * Get a client for the current Weaviate container.
+ * As we aren't running tests in parallel at the moment,
+ * this is not made thread-safe.
+ */
+ public WeaviateClient getClient() {
+ // FIXME: control from containers?
+ if (!isRunning()) {
+ start();
+ }
+ if (clientInstance == null) {
+ var config = new Config("http", getHttpHostAddress(), getGrpcHostAddress());
+ clientInstance = new WeaviateClient(config);
+ }
+ return clientInstance;
+ }
+
+ public static Weaviate createDefault() {
+ return new Builder().build();
+ }
+
+ public static Weaviate.Builder custom() {
+ return new Builder();
+ }
+
+ public static class Builder {
+ private String versionTag;
+ private Set enableModules;
+ private String defaultVectorizerModule;
+ private String contextionaryUrl;
+ private boolean telemetry;
+
+ public Builder() {
+ this.versionTag = VERSION;
+ this.enableModules = new HashSet<>();
+ this.telemetry = false;
+ }
+
+ public Builder withVersion(String version) {
+ this.versionTag = version;
+ return this;
+ }
+
+ public Builder addModule(String module) {
+ enableModules.add(module);
+ return this;
+ }
+
+ public Builder withDefaultVectorizer(String module) {
+ addModule(module);
+ defaultVectorizerModule = module;
+ return this;
+ }
+
+ public Builder withContextionaryUrl(String url) {
+ contextionaryUrl = url;
+ return this;
+ }
+
+ public Builder enableTelemetry() {
+ telemetry = true;
+ return this;
+ }
+
+ public Weaviate build() {
+ var c = new Weaviate(DOCKER_IMAGE + ":" + versionTag);
+
+ if (!enableModules.isEmpty()) {
+ c.withEnv("ENABLE_MODULES", String.join(",", enableModules));
+ }
+ if (defaultVectorizerModule != null) {
+ c.withEnv("DEFAULT_VECTORIZER_MODULE", defaultVectorizerModule);
+ }
+ if (contextionaryUrl != null) {
+ c.withEnv("CONTEXTIONARY_URL", contextionaryUrl);
+ }
+ if (!telemetry) {
+ c.withEnv("DISABLE_TELEMETRY", "true");
+ }
+
+ c.withCreateContainerCmdModifier(cmd -> cmd.withHostName("weaviate"));
+ return c;
+ }
+ }
+
+ private Weaviate(String dockerImageName) {
+ super(dockerImageName);
+ }
+
+ @Override
+ public void stop() {
+ // Note: at the moment containers which are not created as a @TestRule
+ // will not be "stopped", so client's resources are also not being freed.
+ // This is fine in tests, but may produce warnings about the gRPC channel
+ // not shut down properly.
+ super.stop();
+ if (clientInstance == null) {
+ return;
+ }
+ try {
+ clientInstance.close();
+ } catch (IOException e) {
+ // TODO: log error
+ }
+ }
+}
diff --git a/src/main/java/io/weaviate/client6/Config.java b/src/main/java/io/weaviate/client6/Config.java
new file mode 100644
index 000000000..8926c3aa8
--- /dev/null
+++ b/src/main/java/io/weaviate/client6/Config.java
@@ -0,0 +1,26 @@
+package io.weaviate.client6;
+
+public class Config {
+ private final String version = "v1";
+ private final String scheme;
+ private final String httpHost;
+ private final String grpcHost;
+
+ public Config(String scheme, String httpHost, String grpcHost) {
+ this.scheme = scheme;
+ this.httpHost = httpHost;
+ this.grpcHost = grpcHost;
+ }
+
+ public String baseUrl() {
+ return scheme + "://" + httpHost + "/" + version;
+ }
+
+ public String grpcAddress() {
+ if (grpcHost.contains(":")) {
+ return grpcHost;
+ }
+ // FIXME: use secure port (433) if scheme == https
+ return String.format("%s:80", grpcHost);
+ }
+}
diff --git a/src/main/java/io/weaviate/client6/WeaviateClient.java b/src/main/java/io/weaviate/client6/WeaviateClient.java
new file mode 100644
index 000000000..8dba725a5
--- /dev/null
+++ b/src/main/java/io/weaviate/client6/WeaviateClient.java
@@ -0,0 +1,27 @@
+package io.weaviate.client6;
+
+import java.io.Closeable;
+import java.io.IOException;
+
+import io.weaviate.client6.internal.GrpcClient;
+import io.weaviate.client6.internal.HttpClient;
+import io.weaviate.client6.v1.collections.Collections;
+
+public class WeaviateClient implements Closeable {
+ private final HttpClient http;
+ private final GrpcClient grpc;
+
+ public final Collections collections;
+
+ public WeaviateClient(Config config) {
+ this.http = new HttpClient();
+ this.grpc = new GrpcClient(config);
+ this.collections = new Collections(config, http, grpc);
+ }
+
+ @Override
+ public void close() throws IOException {
+ this.http.close();
+ this.grpc.close();
+ }
+}
diff --git a/src/main/java/io/weaviate/client6/grpc/protocol/v0/WeaviateGrpc.java b/src/main/java/io/weaviate/client6/grpc/protocol/v0/WeaviateGrpc.java
deleted file mode 100644
index ed743de27..000000000
--- a/src/main/java/io/weaviate/client6/grpc/protocol/v0/WeaviateGrpc.java
+++ /dev/null
@@ -1,367 +0,0 @@
-package io.weaviate.client6.grpc.protocol.v0;
-
-import static io.grpc.MethodDescriptor.generateFullMethodName;
-
-/**
- */
-@javax.annotation.Generated(
- value = "by gRPC proto compiler (version 1.58.0)",
- comments = "Source: v0/weaviate.proto")
-@io.grpc.stub.annotations.GrpcGenerated
-public final class WeaviateGrpc {
-
- private WeaviateGrpc() {}
-
- public static final java.lang.String SERVICE_NAME = "weaviategrpc.Weaviate";
-
- // Static method descriptors that strictly reflect the proto.
- private static volatile io.grpc.MethodDescriptor getSearchMethod;
-
- @io.grpc.stub.annotations.RpcMethod(
- fullMethodName = SERVICE_NAME + '/' + "Search",
- requestType = io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchRequest.class,
- responseType = io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchReply.class,
- methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
- public static io.grpc.MethodDescriptor getSearchMethod() {
- io.grpc.MethodDescriptor getSearchMethod;
- if ((getSearchMethod = WeaviateGrpc.getSearchMethod) == null) {
- synchronized (WeaviateGrpc.class) {
- if ((getSearchMethod = WeaviateGrpc.getSearchMethod) == null) {
- WeaviateGrpc.getSearchMethod = getSearchMethod =
- io.grpc.MethodDescriptor.newBuilder()
- .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
- .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Search"))
- .setSampledToLocalTracing(true)
- .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
- io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchRequest.getDefaultInstance()))
- .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
- io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchReply.getDefaultInstance()))
- .setSchemaDescriptor(new WeaviateMethodDescriptorSupplier("Search"))
- .build();
- }
- }
- }
- return getSearchMethod;
- }
-
- private static volatile io.grpc.MethodDescriptor getBatchObjectsMethod;
-
- @io.grpc.stub.annotations.RpcMethod(
- fullMethodName = SERVICE_NAME + '/' + "BatchObjects",
- requestType = io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsRequest.class,
- responseType = io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsReply.class,
- methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
- public static io.grpc.MethodDescriptor getBatchObjectsMethod() {
- io.grpc.MethodDescriptor getBatchObjectsMethod;
- if ((getBatchObjectsMethod = WeaviateGrpc.getBatchObjectsMethod) == null) {
- synchronized (WeaviateGrpc.class) {
- if ((getBatchObjectsMethod = WeaviateGrpc.getBatchObjectsMethod) == null) {
- WeaviateGrpc.getBatchObjectsMethod = getBatchObjectsMethod =
- io.grpc.MethodDescriptor.newBuilder()
- .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
- .setFullMethodName(generateFullMethodName(SERVICE_NAME, "BatchObjects"))
- .setSampledToLocalTracing(true)
- .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
- io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsRequest.getDefaultInstance()))
- .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
- io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsReply.getDefaultInstance()))
- .setSchemaDescriptor(new WeaviateMethodDescriptorSupplier("BatchObjects"))
- .build();
- }
- }
- }
- return getBatchObjectsMethod;
- }
-
- /**
- * Creates a new async stub that supports all call types for the service
- */
- public static WeaviateStub newStub(io.grpc.Channel channel) {
- io.grpc.stub.AbstractStub.StubFactory factory =
- new io.grpc.stub.AbstractStub.StubFactory() {
- @java.lang.Override
- public WeaviateStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
- return new WeaviateStub(channel, callOptions);
- }
- };
- return WeaviateStub.newStub(factory, channel);
- }
-
- /**
- * Creates a new blocking-style stub that supports unary and streaming output calls on the service
- */
- public static WeaviateBlockingStub newBlockingStub(
- io.grpc.Channel channel) {
- io.grpc.stub.AbstractStub.StubFactory factory =
- new io.grpc.stub.AbstractStub.StubFactory() {
- @java.lang.Override
- public WeaviateBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
- return new WeaviateBlockingStub(channel, callOptions);
- }
- };
- return WeaviateBlockingStub.newStub(factory, channel);
- }
-
- /**
- * Creates a new ListenableFuture-style stub that supports unary calls on the service
- */
- public static WeaviateFutureStub newFutureStub(
- io.grpc.Channel channel) {
- io.grpc.stub.AbstractStub.StubFactory factory =
- new io.grpc.stub.AbstractStub.StubFactory() {
- @java.lang.Override
- public WeaviateFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
- return new WeaviateFutureStub(channel, callOptions);
- }
- };
- return WeaviateFutureStub.newStub(factory, channel);
- }
-
- /**
- */
- public interface AsyncService {
-
- /**
- */
- default void search(io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchRequest request,
- io.grpc.stub.StreamObserver responseObserver) {
- io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSearchMethod(), responseObserver);
- }
-
- /**
- */
- default void batchObjects(io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsRequest request,
- io.grpc.stub.StreamObserver responseObserver) {
- io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getBatchObjectsMethod(), responseObserver);
- }
- }
-
- /**
- * Base class for the server implementation of the service Weaviate.
- */
- public static abstract class WeaviateImplBase
- implements io.grpc.BindableService, AsyncService {
-
- @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
- return WeaviateGrpc.bindService(this);
- }
- }
-
- /**
- * A stub to allow clients to do asynchronous rpc calls to service Weaviate.
- */
- public static final class WeaviateStub
- extends io.grpc.stub.AbstractAsyncStub {
- private WeaviateStub(
- io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
- super(channel, callOptions);
- }
-
- @java.lang.Override
- protected WeaviateStub build(
- io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
- return new WeaviateStub(channel, callOptions);
- }
-
- /**
- */
- public void search(io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchRequest request,
- io.grpc.stub.StreamObserver responseObserver) {
- io.grpc.stub.ClientCalls.asyncUnaryCall(
- getChannel().newCall(getSearchMethod(), getCallOptions()), request, responseObserver);
- }
-
- /**
- */
- public void batchObjects(io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsRequest request,
- io.grpc.stub.StreamObserver responseObserver) {
- io.grpc.stub.ClientCalls.asyncUnaryCall(
- getChannel().newCall(getBatchObjectsMethod(), getCallOptions()), request, responseObserver);
- }
- }
-
- /**
- * A stub to allow clients to do synchronous rpc calls to service Weaviate.
- */
- public static final class WeaviateBlockingStub
- extends io.grpc.stub.AbstractBlockingStub {
- private WeaviateBlockingStub(
- io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
- super(channel, callOptions);
- }
-
- @java.lang.Override
- protected WeaviateBlockingStub build(
- io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
- return new WeaviateBlockingStub(channel, callOptions);
- }
-
- /**
- */
- public io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchReply search(io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchRequest request) {
- return io.grpc.stub.ClientCalls.blockingUnaryCall(
- getChannel(), getSearchMethod(), getCallOptions(), request);
- }
-
- /**
- */
- public io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsReply batchObjects(io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsRequest request) {
- return io.grpc.stub.ClientCalls.blockingUnaryCall(
- getChannel(), getBatchObjectsMethod(), getCallOptions(), request);
- }
- }
-
- /**
- * A stub to allow clients to do ListenableFuture-style rpc calls to service Weaviate.
- */
- public static final class WeaviateFutureStub
- extends io.grpc.stub.AbstractFutureStub {
- private WeaviateFutureStub(
- io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
- super(channel, callOptions);
- }
-
- @java.lang.Override
- protected WeaviateFutureStub build(
- io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
- return new WeaviateFutureStub(channel, callOptions);
- }
-
- /**
- */
- public com.google.common.util.concurrent.ListenableFuture search(
- io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchRequest request) {
- return io.grpc.stub.ClientCalls.futureUnaryCall(
- getChannel().newCall(getSearchMethod(), getCallOptions()), request);
- }
-
- /**
- */
- public com.google.common.util.concurrent.ListenableFuture batchObjects(
- io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsRequest request) {
- return io.grpc.stub.ClientCalls.futureUnaryCall(
- getChannel().newCall(getBatchObjectsMethod(), getCallOptions()), request);
- }
- }
-
- private static final int METHODID_SEARCH = 0;
- private static final int METHODID_BATCH_OBJECTS = 1;
-
- private static final class MethodHandlers implements
- io.grpc.stub.ServerCalls.UnaryMethod,
- io.grpc.stub.ServerCalls.ServerStreamingMethod,
- io.grpc.stub.ServerCalls.ClientStreamingMethod,
- io.grpc.stub.ServerCalls.BidiStreamingMethod {
- private final AsyncService serviceImpl;
- private final int methodId;
-
- MethodHandlers(AsyncService serviceImpl, int methodId) {
- this.serviceImpl = serviceImpl;
- this.methodId = methodId;
- }
-
- @java.lang.Override
- @java.lang.SuppressWarnings("unchecked")
- public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) {
- switch (methodId) {
- case METHODID_SEARCH:
- serviceImpl.search((io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchRequest) request,
- (io.grpc.stub.StreamObserver) responseObserver);
- break;
- case METHODID_BATCH_OBJECTS:
- serviceImpl.batchObjects((io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsRequest) request,
- (io.grpc.stub.StreamObserver) responseObserver);
- break;
- default:
- throw new AssertionError();
- }
- }
-
- @java.lang.Override
- @java.lang.SuppressWarnings("unchecked")
- public io.grpc.stub.StreamObserver invoke(
- io.grpc.stub.StreamObserver responseObserver) {
- switch (methodId) {
- default:
- throw new AssertionError();
- }
- }
- }
-
- public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) {
- return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
- .addMethod(
- getSearchMethod(),
- io.grpc.stub.ServerCalls.asyncUnaryCall(
- new MethodHandlers<
- io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchRequest,
- io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchReply>(
- service, METHODID_SEARCH)))
- .addMethod(
- getBatchObjectsMethod(),
- io.grpc.stub.ServerCalls.asyncUnaryCall(
- new MethodHandlers<
- io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsRequest,
- io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsReply>(
- service, METHODID_BATCH_OBJECTS)))
- .build();
- }
-
- private static abstract class WeaviateBaseDescriptorSupplier
- implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
- WeaviateBaseDescriptorSupplier() {}
-
- @java.lang.Override
- public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
- return io.weaviate.client6.grpc.protocol.v0.WeaviateProto.getDescriptor();
- }
-
- @java.lang.Override
- public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
- return getFileDescriptor().findServiceByName("Weaviate");
- }
- }
-
- private static final class WeaviateFileDescriptorSupplier
- extends WeaviateBaseDescriptorSupplier {
- WeaviateFileDescriptorSupplier() {}
- }
-
- private static final class WeaviateMethodDescriptorSupplier
- extends WeaviateBaseDescriptorSupplier
- implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
- private final java.lang.String methodName;
-
- WeaviateMethodDescriptorSupplier(java.lang.String methodName) {
- this.methodName = methodName;
- }
-
- @java.lang.Override
- public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
- return getServiceDescriptor().findMethodByName(methodName);
- }
- }
-
- private static volatile io.grpc.ServiceDescriptor serviceDescriptor;
-
- public static io.grpc.ServiceDescriptor getServiceDescriptor() {
- io.grpc.ServiceDescriptor result = serviceDescriptor;
- if (result == null) {
- synchronized (WeaviateGrpc.class) {
- result = serviceDescriptor;
- if (result == null) {
- serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
- .setSchemaDescriptor(new WeaviateFileDescriptorSupplier())
- .addMethod(getSearchMethod())
- .addMethod(getBatchObjectsMethod())
- .build();
- }
- }
- }
- return result;
- }
-}
diff --git a/src/main/java/io/weaviate/client6/grpc/protocol/v0/WeaviateProto.java b/src/main/java/io/weaviate/client6/grpc/protocol/v0/WeaviateProto.java
deleted file mode 100644
index 84447a78d..000000000
--- a/src/main/java/io/weaviate/client6/grpc/protocol/v0/WeaviateProto.java
+++ /dev/null
@@ -1,47 +0,0 @@
-// Generated by the protocol buffer compiler. DO NOT EDIT!
-// source: v0/weaviate.proto
-
-package io.weaviate.client6.grpc.protocol.v0;
-
-public final class WeaviateProto {
- private WeaviateProto() {}
- public static void registerAllExtensions(
- com.google.protobuf.ExtensionRegistryLite registry) {
- }
-
- public static void registerAllExtensions(
- com.google.protobuf.ExtensionRegistry registry) {
- registerAllExtensions(
- (com.google.protobuf.ExtensionRegistryLite) registry);
- }
-
- public static com.google.protobuf.Descriptors.FileDescriptor
- getDescriptor() {
- return descriptor;
- }
- private static com.google.protobuf.Descriptors.FileDescriptor
- descriptor;
- static {
- java.lang.String[] descriptorData = {
- "\n\021v0/weaviate.proto\022\014weaviategrpc\032\016v0/ba" +
- "tch.proto\032\023v0/search_get.proto2\244\001\n\010Weavi" +
- "ate\022B\n\006Search\022\033.weaviategrpc.SearchReque" +
- "st\032\031.weaviategrpc.SearchReply\"\000\022T\n\014Batch" +
- "Objects\022!.weaviategrpc.BatchObjectsReque" +
- "st\032\037.weaviategrpc.BatchObjectsReply\"\000Bk\n" +
- "$io.weaviate.client6.grpc.protocol.v0B\rW" +
- "eaviateProtoZ4github.com/weaviate/weavia" +
- "te/grpc/generated;protocolb\006proto3"
- };
- descriptor = com.google.protobuf.Descriptors.FileDescriptor
- .internalBuildGeneratedFileFrom(descriptorData,
- new com.google.protobuf.Descriptors.FileDescriptor[] {
- io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.getDescriptor(),
- io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.getDescriptor(),
- });
- io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.getDescriptor();
- io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.getDescriptor();
- }
-
- // @@protoc_insertion_point(outer_class_scope)
-}
diff --git a/src/main/java/io/weaviate/client6/grpc/protocol/v0/WeaviateProtoBatch.java b/src/main/java/io/weaviate/client6/grpc/protocol/v0/WeaviateProtoBatch.java
deleted file mode 100644
index dd4254e7f..000000000
--- a/src/main/java/io/weaviate/client6/grpc/protocol/v0/WeaviateProtoBatch.java
+++ /dev/null
@@ -1,855 +0,0 @@
-// Generated by the protocol buffer compiler. DO NOT EDIT!
-// source: v0/batch.proto
-
-package io.weaviate.client6.grpc.protocol.v0;
-
-public final class WeaviateProtoBatch {
- private WeaviateProtoBatch() {}
- public static void registerAllExtensions(
- com.google.protobuf.ExtensionRegistryLite registry) {
- }
-
- public static void registerAllExtensions(
- com.google.protobuf.ExtensionRegistry registry) {
- registerAllExtensions(
- (com.google.protobuf.ExtensionRegistryLite) registry);
- }
- public interface BatchObjectsRequestOrBuilder extends
- // @@protoc_insertion_point(interface_extends:weaviategrpc.BatchObjectsRequest)
- com.google.protobuf.MessageOrBuilder {
- }
- /**
- * Protobuf type {@code weaviategrpc.BatchObjectsRequest}
- */
- public static final class BatchObjectsRequest extends
- com.google.protobuf.GeneratedMessageV3 implements
- // @@protoc_insertion_point(message_implements:weaviategrpc.BatchObjectsRequest)
- BatchObjectsRequestOrBuilder {
- private static final long serialVersionUID = 0L;
- // Use BatchObjectsRequest.newBuilder() to construct.
- private BatchObjectsRequest(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
- super(builder);
- }
- private BatchObjectsRequest() {
- }
-
- @java.lang.Override
- @SuppressWarnings({"unused"})
- protected java.lang.Object newInstance(
- UnusedPrivateParameter unused) {
- return new BatchObjectsRequest();
- }
-
- public static final com.google.protobuf.Descriptors.Descriptor
- getDescriptor() {
- return io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.internal_static_weaviategrpc_BatchObjectsRequest_descriptor;
- }
-
- @java.lang.Override
- protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
- internalGetFieldAccessorTable() {
- return io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.internal_static_weaviategrpc_BatchObjectsRequest_fieldAccessorTable
- .ensureFieldAccessorsInitialized(
- io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsRequest.class, io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsRequest.Builder.class);
- }
-
- private byte memoizedIsInitialized = -1;
- @java.lang.Override
- public final boolean isInitialized() {
- byte isInitialized = memoizedIsInitialized;
- if (isInitialized == 1) return true;
- if (isInitialized == 0) return false;
-
- memoizedIsInitialized = 1;
- return true;
- }
-
- @java.lang.Override
- public void writeTo(com.google.protobuf.CodedOutputStream output)
- throws java.io.IOException {
- getUnknownFields().writeTo(output);
- }
-
- @java.lang.Override
- public int getSerializedSize() {
- int size = memoizedSize;
- if (size != -1) return size;
-
- size = 0;
- size += getUnknownFields().getSerializedSize();
- memoizedSize = size;
- return size;
- }
-
- @java.lang.Override
- public boolean equals(final java.lang.Object obj) {
- if (obj == this) {
- return true;
- }
- if (!(obj instanceof io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsRequest)) {
- return super.equals(obj);
- }
- io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsRequest other = (io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsRequest) obj;
-
- if (!getUnknownFields().equals(other.getUnknownFields())) return false;
- return true;
- }
-
- @java.lang.Override
- public int hashCode() {
- if (memoizedHashCode != 0) {
- return memoizedHashCode;
- }
- int hash = 41;
- hash = (19 * hash) + getDescriptor().hashCode();
- hash = (29 * hash) + getUnknownFields().hashCode();
- memoizedHashCode = hash;
- return hash;
- }
-
- public static io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsRequest parseFrom(
- java.nio.ByteBuffer data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
- public static io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsRequest parseFrom(
- java.nio.ByteBuffer data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
- public static io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsRequest parseFrom(
- com.google.protobuf.ByteString data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
- public static io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsRequest parseFrom(
- com.google.protobuf.ByteString data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
- public static io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsRequest parseFrom(byte[] data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
- public static io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsRequest parseFrom(
- byte[] data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
- public static io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsRequest parseFrom(java.io.InputStream input)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input);
- }
- public static io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsRequest parseFrom(
- java.io.InputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input, extensionRegistry);
- }
-
- public static io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsRequest parseDelimitedFrom(java.io.InputStream input)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseDelimitedWithIOException(PARSER, input);
- }
-
- public static io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsRequest parseDelimitedFrom(
- java.io.InputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
- }
- public static io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsRequest parseFrom(
- com.google.protobuf.CodedInputStream input)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input);
- }
- public static io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsRequest parseFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input, extensionRegistry);
- }
-
- @java.lang.Override
- public Builder newBuilderForType() { return newBuilder(); }
- public static Builder newBuilder() {
- return DEFAULT_INSTANCE.toBuilder();
- }
- public static Builder newBuilder(io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsRequest prototype) {
- return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
- }
- @java.lang.Override
- public Builder toBuilder() {
- return this == DEFAULT_INSTANCE
- ? new Builder() : new Builder().mergeFrom(this);
- }
-
- @java.lang.Override
- protected Builder newBuilderForType(
- com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
- Builder builder = new Builder(parent);
- return builder;
- }
- /**
- * Protobuf type {@code weaviategrpc.BatchObjectsRequest}
- */
- public static final class Builder extends
- com.google.protobuf.GeneratedMessageV3.Builder implements
- // @@protoc_insertion_point(builder_implements:weaviategrpc.BatchObjectsRequest)
- io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsRequestOrBuilder {
- public static final com.google.protobuf.Descriptors.Descriptor
- getDescriptor() {
- return io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.internal_static_weaviategrpc_BatchObjectsRequest_descriptor;
- }
-
- @java.lang.Override
- protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
- internalGetFieldAccessorTable() {
- return io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.internal_static_weaviategrpc_BatchObjectsRequest_fieldAccessorTable
- .ensureFieldAccessorsInitialized(
- io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsRequest.class, io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsRequest.Builder.class);
- }
-
- // Construct using io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsRequest.newBuilder()
- private Builder() {
-
- }
-
- private Builder(
- com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
- super(parent);
-
- }
- @java.lang.Override
- public Builder clear() {
- super.clear();
- return this;
- }
-
- @java.lang.Override
- public com.google.protobuf.Descriptors.Descriptor
- getDescriptorForType() {
- return io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.internal_static_weaviategrpc_BatchObjectsRequest_descriptor;
- }
-
- @java.lang.Override
- public io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsRequest getDefaultInstanceForType() {
- return io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsRequest.getDefaultInstance();
- }
-
- @java.lang.Override
- public io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsRequest build() {
- io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsRequest result = buildPartial();
- if (!result.isInitialized()) {
- throw newUninitializedMessageException(result);
- }
- return result;
- }
-
- @java.lang.Override
- public io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsRequest buildPartial() {
- io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsRequest result = new io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsRequest(this);
- onBuilt();
- return result;
- }
-
- @java.lang.Override
- public Builder clone() {
- return super.clone();
- }
- @java.lang.Override
- public Builder setField(
- com.google.protobuf.Descriptors.FieldDescriptor field,
- java.lang.Object value) {
- return super.setField(field, value);
- }
- @java.lang.Override
- public Builder clearField(
- com.google.protobuf.Descriptors.FieldDescriptor field) {
- return super.clearField(field);
- }
- @java.lang.Override
- public Builder clearOneof(
- com.google.protobuf.Descriptors.OneofDescriptor oneof) {
- return super.clearOneof(oneof);
- }
- @java.lang.Override
- public Builder setRepeatedField(
- com.google.protobuf.Descriptors.FieldDescriptor field,
- int index, java.lang.Object value) {
- return super.setRepeatedField(field, index, value);
- }
- @java.lang.Override
- public Builder addRepeatedField(
- com.google.protobuf.Descriptors.FieldDescriptor field,
- java.lang.Object value) {
- return super.addRepeatedField(field, value);
- }
- @java.lang.Override
- public Builder mergeFrom(com.google.protobuf.Message other) {
- if (other instanceof io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsRequest) {
- return mergeFrom((io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsRequest)other);
- } else {
- super.mergeFrom(other);
- return this;
- }
- }
-
- public Builder mergeFrom(io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsRequest other) {
- if (other == io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsRequest.getDefaultInstance()) return this;
- this.mergeUnknownFields(other.getUnknownFields());
- onChanged();
- return this;
- }
-
- @java.lang.Override
- public final boolean isInitialized() {
- return true;
- }
-
- @java.lang.Override
- public Builder mergeFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- if (extensionRegistry == null) {
- throw new java.lang.NullPointerException();
- }
- try {
- boolean done = false;
- while (!done) {
- int tag = input.readTag();
- switch (tag) {
- case 0:
- done = true;
- break;
- default: {
- if (!super.parseUnknownField(input, extensionRegistry, tag)) {
- done = true; // was an endgroup tag
- }
- break;
- } // default:
- } // switch (tag)
- } // while (!done)
- } catch (com.google.protobuf.InvalidProtocolBufferException e) {
- throw e.unwrapIOException();
- } finally {
- onChanged();
- } // finally
- return this;
- }
- @java.lang.Override
- public final Builder setUnknownFields(
- final com.google.protobuf.UnknownFieldSet unknownFields) {
- return super.setUnknownFields(unknownFields);
- }
-
- @java.lang.Override
- public final Builder mergeUnknownFields(
- final com.google.protobuf.UnknownFieldSet unknownFields) {
- return super.mergeUnknownFields(unknownFields);
- }
-
-
- // @@protoc_insertion_point(builder_scope:weaviategrpc.BatchObjectsRequest)
- }
-
- // @@protoc_insertion_point(class_scope:weaviategrpc.BatchObjectsRequest)
- private static final io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsRequest DEFAULT_INSTANCE;
- static {
- DEFAULT_INSTANCE = new io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsRequest();
- }
-
- public static io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsRequest getDefaultInstance() {
- return DEFAULT_INSTANCE;
- }
-
- private static final com.google.protobuf.Parser
- PARSER = new com.google.protobuf.AbstractParser() {
- @java.lang.Override
- public BatchObjectsRequest parsePartialFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- Builder builder = newBuilder();
- try {
- builder.mergeFrom(input, extensionRegistry);
- } catch (com.google.protobuf.InvalidProtocolBufferException e) {
- throw e.setUnfinishedMessage(builder.buildPartial());
- } catch (com.google.protobuf.UninitializedMessageException e) {
- throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
- } catch (java.io.IOException e) {
- throw new com.google.protobuf.InvalidProtocolBufferException(e)
- .setUnfinishedMessage(builder.buildPartial());
- }
- return builder.buildPartial();
- }
- };
-
- public static com.google.protobuf.Parser parser() {
- return PARSER;
- }
-
- @java.lang.Override
- public com.google.protobuf.Parser getParserForType() {
- return PARSER;
- }
-
- @java.lang.Override
- public io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsRequest getDefaultInstanceForType() {
- return DEFAULT_INSTANCE;
- }
-
- }
-
- public interface BatchObjectsReplyOrBuilder extends
- // @@protoc_insertion_point(interface_extends:weaviategrpc.BatchObjectsReply)
- com.google.protobuf.MessageOrBuilder {
- }
- /**
- * Protobuf type {@code weaviategrpc.BatchObjectsReply}
- */
- public static final class BatchObjectsReply extends
- com.google.protobuf.GeneratedMessageV3 implements
- // @@protoc_insertion_point(message_implements:weaviategrpc.BatchObjectsReply)
- BatchObjectsReplyOrBuilder {
- private static final long serialVersionUID = 0L;
- // Use BatchObjectsReply.newBuilder() to construct.
- private BatchObjectsReply(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
- super(builder);
- }
- private BatchObjectsReply() {
- }
-
- @java.lang.Override
- @SuppressWarnings({"unused"})
- protected java.lang.Object newInstance(
- UnusedPrivateParameter unused) {
- return new BatchObjectsReply();
- }
-
- public static final com.google.protobuf.Descriptors.Descriptor
- getDescriptor() {
- return io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.internal_static_weaviategrpc_BatchObjectsReply_descriptor;
- }
-
- @java.lang.Override
- protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
- internalGetFieldAccessorTable() {
- return io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.internal_static_weaviategrpc_BatchObjectsReply_fieldAccessorTable
- .ensureFieldAccessorsInitialized(
- io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsReply.class, io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsReply.Builder.class);
- }
-
- private byte memoizedIsInitialized = -1;
- @java.lang.Override
- public final boolean isInitialized() {
- byte isInitialized = memoizedIsInitialized;
- if (isInitialized == 1) return true;
- if (isInitialized == 0) return false;
-
- memoizedIsInitialized = 1;
- return true;
- }
-
- @java.lang.Override
- public void writeTo(com.google.protobuf.CodedOutputStream output)
- throws java.io.IOException {
- getUnknownFields().writeTo(output);
- }
-
- @java.lang.Override
- public int getSerializedSize() {
- int size = memoizedSize;
- if (size != -1) return size;
-
- size = 0;
- size += getUnknownFields().getSerializedSize();
- memoizedSize = size;
- return size;
- }
-
- @java.lang.Override
- public boolean equals(final java.lang.Object obj) {
- if (obj == this) {
- return true;
- }
- if (!(obj instanceof io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsReply)) {
- return super.equals(obj);
- }
- io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsReply other = (io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsReply) obj;
-
- if (!getUnknownFields().equals(other.getUnknownFields())) return false;
- return true;
- }
-
- @java.lang.Override
- public int hashCode() {
- if (memoizedHashCode != 0) {
- return memoizedHashCode;
- }
- int hash = 41;
- hash = (19 * hash) + getDescriptor().hashCode();
- hash = (29 * hash) + getUnknownFields().hashCode();
- memoizedHashCode = hash;
- return hash;
- }
-
- public static io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsReply parseFrom(
- java.nio.ByteBuffer data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
- public static io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsReply parseFrom(
- java.nio.ByteBuffer data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
- public static io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsReply parseFrom(
- com.google.protobuf.ByteString data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
- public static io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsReply parseFrom(
- com.google.protobuf.ByteString data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
- public static io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsReply parseFrom(byte[] data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
- public static io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsReply parseFrom(
- byte[] data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
- public static io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsReply parseFrom(java.io.InputStream input)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input);
- }
- public static io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsReply parseFrom(
- java.io.InputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input, extensionRegistry);
- }
-
- public static io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsReply parseDelimitedFrom(java.io.InputStream input)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseDelimitedWithIOException(PARSER, input);
- }
-
- public static io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsReply parseDelimitedFrom(
- java.io.InputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
- }
- public static io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsReply parseFrom(
- com.google.protobuf.CodedInputStream input)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input);
- }
- public static io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsReply parseFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input, extensionRegistry);
- }
-
- @java.lang.Override
- public Builder newBuilderForType() { return newBuilder(); }
- public static Builder newBuilder() {
- return DEFAULT_INSTANCE.toBuilder();
- }
- public static Builder newBuilder(io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsReply prototype) {
- return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
- }
- @java.lang.Override
- public Builder toBuilder() {
- return this == DEFAULT_INSTANCE
- ? new Builder() : new Builder().mergeFrom(this);
- }
-
- @java.lang.Override
- protected Builder newBuilderForType(
- com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
- Builder builder = new Builder(parent);
- return builder;
- }
- /**
- * Protobuf type {@code weaviategrpc.BatchObjectsReply}
- */
- public static final class Builder extends
- com.google.protobuf.GeneratedMessageV3.Builder implements
- // @@protoc_insertion_point(builder_implements:weaviategrpc.BatchObjectsReply)
- io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsReplyOrBuilder {
- public static final com.google.protobuf.Descriptors.Descriptor
- getDescriptor() {
- return io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.internal_static_weaviategrpc_BatchObjectsReply_descriptor;
- }
-
- @java.lang.Override
- protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
- internalGetFieldAccessorTable() {
- return io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.internal_static_weaviategrpc_BatchObjectsReply_fieldAccessorTable
- .ensureFieldAccessorsInitialized(
- io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsReply.class, io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsReply.Builder.class);
- }
-
- // Construct using io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsReply.newBuilder()
- private Builder() {
-
- }
-
- private Builder(
- com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
- super(parent);
-
- }
- @java.lang.Override
- public Builder clear() {
- super.clear();
- return this;
- }
-
- @java.lang.Override
- public com.google.protobuf.Descriptors.Descriptor
- getDescriptorForType() {
- return io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.internal_static_weaviategrpc_BatchObjectsReply_descriptor;
- }
-
- @java.lang.Override
- public io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsReply getDefaultInstanceForType() {
- return io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsReply.getDefaultInstance();
- }
-
- @java.lang.Override
- public io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsReply build() {
- io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsReply result = buildPartial();
- if (!result.isInitialized()) {
- throw newUninitializedMessageException(result);
- }
- return result;
- }
-
- @java.lang.Override
- public io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsReply buildPartial() {
- io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsReply result = new io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsReply(this);
- onBuilt();
- return result;
- }
-
- @java.lang.Override
- public Builder clone() {
- return super.clone();
- }
- @java.lang.Override
- public Builder setField(
- com.google.protobuf.Descriptors.FieldDescriptor field,
- java.lang.Object value) {
- return super.setField(field, value);
- }
- @java.lang.Override
- public Builder clearField(
- com.google.protobuf.Descriptors.FieldDescriptor field) {
- return super.clearField(field);
- }
- @java.lang.Override
- public Builder clearOneof(
- com.google.protobuf.Descriptors.OneofDescriptor oneof) {
- return super.clearOneof(oneof);
- }
- @java.lang.Override
- public Builder setRepeatedField(
- com.google.protobuf.Descriptors.FieldDescriptor field,
- int index, java.lang.Object value) {
- return super.setRepeatedField(field, index, value);
- }
- @java.lang.Override
- public Builder addRepeatedField(
- com.google.protobuf.Descriptors.FieldDescriptor field,
- java.lang.Object value) {
- return super.addRepeatedField(field, value);
- }
- @java.lang.Override
- public Builder mergeFrom(com.google.protobuf.Message other) {
- if (other instanceof io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsReply) {
- return mergeFrom((io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsReply)other);
- } else {
- super.mergeFrom(other);
- return this;
- }
- }
-
- public Builder mergeFrom(io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsReply other) {
- if (other == io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsReply.getDefaultInstance()) return this;
- this.mergeUnknownFields(other.getUnknownFields());
- onChanged();
- return this;
- }
-
- @java.lang.Override
- public final boolean isInitialized() {
- return true;
- }
-
- @java.lang.Override
- public Builder mergeFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- if (extensionRegistry == null) {
- throw new java.lang.NullPointerException();
- }
- try {
- boolean done = false;
- while (!done) {
- int tag = input.readTag();
- switch (tag) {
- case 0:
- done = true;
- break;
- default: {
- if (!super.parseUnknownField(input, extensionRegistry, tag)) {
- done = true; // was an endgroup tag
- }
- break;
- } // default:
- } // switch (tag)
- } // while (!done)
- } catch (com.google.protobuf.InvalidProtocolBufferException e) {
- throw e.unwrapIOException();
- } finally {
- onChanged();
- } // finally
- return this;
- }
- @java.lang.Override
- public final Builder setUnknownFields(
- final com.google.protobuf.UnknownFieldSet unknownFields) {
- return super.setUnknownFields(unknownFields);
- }
-
- @java.lang.Override
- public final Builder mergeUnknownFields(
- final com.google.protobuf.UnknownFieldSet unknownFields) {
- return super.mergeUnknownFields(unknownFields);
- }
-
-
- // @@protoc_insertion_point(builder_scope:weaviategrpc.BatchObjectsReply)
- }
-
- // @@protoc_insertion_point(class_scope:weaviategrpc.BatchObjectsReply)
- private static final io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsReply DEFAULT_INSTANCE;
- static {
- DEFAULT_INSTANCE = new io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsReply();
- }
-
- public static io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsReply getDefaultInstance() {
- return DEFAULT_INSTANCE;
- }
-
- private static final com.google.protobuf.Parser
- PARSER = new com.google.protobuf.AbstractParser() {
- @java.lang.Override
- public BatchObjectsReply parsePartialFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- Builder builder = newBuilder();
- try {
- builder.mergeFrom(input, extensionRegistry);
- } catch (com.google.protobuf.InvalidProtocolBufferException e) {
- throw e.setUnfinishedMessage(builder.buildPartial());
- } catch (com.google.protobuf.UninitializedMessageException e) {
- throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
- } catch (java.io.IOException e) {
- throw new com.google.protobuf.InvalidProtocolBufferException(e)
- .setUnfinishedMessage(builder.buildPartial());
- }
- return builder.buildPartial();
- }
- };
-
- public static com.google.protobuf.Parser parser() {
- return PARSER;
- }
-
- @java.lang.Override
- public com.google.protobuf.Parser getParserForType() {
- return PARSER;
- }
-
- @java.lang.Override
- public io.weaviate.client6.grpc.protocol.v0.WeaviateProtoBatch.BatchObjectsReply getDefaultInstanceForType() {
- return DEFAULT_INSTANCE;
- }
-
- }
-
- private static final com.google.protobuf.Descriptors.Descriptor
- internal_static_weaviategrpc_BatchObjectsRequest_descriptor;
- private static final
- com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
- internal_static_weaviategrpc_BatchObjectsRequest_fieldAccessorTable;
- private static final com.google.protobuf.Descriptors.Descriptor
- internal_static_weaviategrpc_BatchObjectsReply_descriptor;
- private static final
- com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
- internal_static_weaviategrpc_BatchObjectsReply_fieldAccessorTable;
-
- public static com.google.protobuf.Descriptors.FileDescriptor
- getDescriptor() {
- return descriptor;
- }
- private static com.google.protobuf.Descriptors.FileDescriptor
- descriptor;
- static {
- java.lang.String[] descriptorData = {
- "\n\016v0/batch.proto\022\014weaviategrpc\"\025\n\023BatchO" +
- "bjectsRequest\"\023\n\021BatchObjectsReplyBp\n$io" +
- ".weaviate.client6.grpc.protocol.v0B\022Weav" +
- "iateProtoBatchZ4github.com/weaviate/weav" +
- "iate/grpc/generated;protocolb\006proto3"
- };
- descriptor = com.google.protobuf.Descriptors.FileDescriptor
- .internalBuildGeneratedFileFrom(descriptorData,
- new com.google.protobuf.Descriptors.FileDescriptor[] {
- });
- internal_static_weaviategrpc_BatchObjectsRequest_descriptor =
- getDescriptor().getMessageTypes().get(0);
- internal_static_weaviategrpc_BatchObjectsRequest_fieldAccessorTable = new
- com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
- internal_static_weaviategrpc_BatchObjectsRequest_descriptor,
- new java.lang.String[] { });
- internal_static_weaviategrpc_BatchObjectsReply_descriptor =
- getDescriptor().getMessageTypes().get(1);
- internal_static_weaviategrpc_BatchObjectsReply_fieldAccessorTable = new
- com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
- internal_static_weaviategrpc_BatchObjectsReply_descriptor,
- new java.lang.String[] { });
- }
-
- // @@protoc_insertion_point(outer_class_scope)
-}
diff --git a/src/main/java/io/weaviate/client6/grpc/protocol/v0/WeaviateProtoSearchGet.java b/src/main/java/io/weaviate/client6/grpc/protocol/v0/WeaviateProtoSearchGet.java
deleted file mode 100644
index 5a67dccfc..000000000
--- a/src/main/java/io/weaviate/client6/grpc/protocol/v0/WeaviateProtoSearchGet.java
+++ /dev/null
@@ -1,855 +0,0 @@
-// Generated by the protocol buffer compiler. DO NOT EDIT!
-// source: v0/search_get.proto
-
-package io.weaviate.client6.grpc.protocol.v0;
-
-public final class WeaviateProtoSearchGet {
- private WeaviateProtoSearchGet() {}
- public static void registerAllExtensions(
- com.google.protobuf.ExtensionRegistryLite registry) {
- }
-
- public static void registerAllExtensions(
- com.google.protobuf.ExtensionRegistry registry) {
- registerAllExtensions(
- (com.google.protobuf.ExtensionRegistryLite) registry);
- }
- public interface SearchRequestOrBuilder extends
- // @@protoc_insertion_point(interface_extends:weaviategrpc.SearchRequest)
- com.google.protobuf.MessageOrBuilder {
- }
- /**
- * Protobuf type {@code weaviategrpc.SearchRequest}
- */
- public static final class SearchRequest extends
- com.google.protobuf.GeneratedMessageV3 implements
- // @@protoc_insertion_point(message_implements:weaviategrpc.SearchRequest)
- SearchRequestOrBuilder {
- private static final long serialVersionUID = 0L;
- // Use SearchRequest.newBuilder() to construct.
- private SearchRequest(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
- super(builder);
- }
- private SearchRequest() {
- }
-
- @java.lang.Override
- @SuppressWarnings({"unused"})
- protected java.lang.Object newInstance(
- UnusedPrivateParameter unused) {
- return new SearchRequest();
- }
-
- public static final com.google.protobuf.Descriptors.Descriptor
- getDescriptor() {
- return io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.internal_static_weaviategrpc_SearchRequest_descriptor;
- }
-
- @java.lang.Override
- protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
- internalGetFieldAccessorTable() {
- return io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.internal_static_weaviategrpc_SearchRequest_fieldAccessorTable
- .ensureFieldAccessorsInitialized(
- io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchRequest.class, io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchRequest.Builder.class);
- }
-
- private byte memoizedIsInitialized = -1;
- @java.lang.Override
- public final boolean isInitialized() {
- byte isInitialized = memoizedIsInitialized;
- if (isInitialized == 1) return true;
- if (isInitialized == 0) return false;
-
- memoizedIsInitialized = 1;
- return true;
- }
-
- @java.lang.Override
- public void writeTo(com.google.protobuf.CodedOutputStream output)
- throws java.io.IOException {
- getUnknownFields().writeTo(output);
- }
-
- @java.lang.Override
- public int getSerializedSize() {
- int size = memoizedSize;
- if (size != -1) return size;
-
- size = 0;
- size += getUnknownFields().getSerializedSize();
- memoizedSize = size;
- return size;
- }
-
- @java.lang.Override
- public boolean equals(final java.lang.Object obj) {
- if (obj == this) {
- return true;
- }
- if (!(obj instanceof io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchRequest)) {
- return super.equals(obj);
- }
- io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchRequest other = (io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchRequest) obj;
-
- if (!getUnknownFields().equals(other.getUnknownFields())) return false;
- return true;
- }
-
- @java.lang.Override
- public int hashCode() {
- if (memoizedHashCode != 0) {
- return memoizedHashCode;
- }
- int hash = 41;
- hash = (19 * hash) + getDescriptor().hashCode();
- hash = (29 * hash) + getUnknownFields().hashCode();
- memoizedHashCode = hash;
- return hash;
- }
-
- public static io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchRequest parseFrom(
- java.nio.ByteBuffer data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
- public static io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchRequest parseFrom(
- java.nio.ByteBuffer data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
- public static io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchRequest parseFrom(
- com.google.protobuf.ByteString data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
- public static io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchRequest parseFrom(
- com.google.protobuf.ByteString data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
- public static io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchRequest parseFrom(byte[] data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
- public static io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchRequest parseFrom(
- byte[] data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
- public static io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchRequest parseFrom(java.io.InputStream input)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input);
- }
- public static io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchRequest parseFrom(
- java.io.InputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input, extensionRegistry);
- }
-
- public static io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchRequest parseDelimitedFrom(java.io.InputStream input)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseDelimitedWithIOException(PARSER, input);
- }
-
- public static io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchRequest parseDelimitedFrom(
- java.io.InputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
- }
- public static io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchRequest parseFrom(
- com.google.protobuf.CodedInputStream input)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input);
- }
- public static io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchRequest parseFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input, extensionRegistry);
- }
-
- @java.lang.Override
- public Builder newBuilderForType() { return newBuilder(); }
- public static Builder newBuilder() {
- return DEFAULT_INSTANCE.toBuilder();
- }
- public static Builder newBuilder(io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchRequest prototype) {
- return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
- }
- @java.lang.Override
- public Builder toBuilder() {
- return this == DEFAULT_INSTANCE
- ? new Builder() : new Builder().mergeFrom(this);
- }
-
- @java.lang.Override
- protected Builder newBuilderForType(
- com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
- Builder builder = new Builder(parent);
- return builder;
- }
- /**
- * Protobuf type {@code weaviategrpc.SearchRequest}
- */
- public static final class Builder extends
- com.google.protobuf.GeneratedMessageV3.Builder implements
- // @@protoc_insertion_point(builder_implements:weaviategrpc.SearchRequest)
- io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchRequestOrBuilder {
- public static final com.google.protobuf.Descriptors.Descriptor
- getDescriptor() {
- return io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.internal_static_weaviategrpc_SearchRequest_descriptor;
- }
-
- @java.lang.Override
- protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
- internalGetFieldAccessorTable() {
- return io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.internal_static_weaviategrpc_SearchRequest_fieldAccessorTable
- .ensureFieldAccessorsInitialized(
- io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchRequest.class, io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchRequest.Builder.class);
- }
-
- // Construct using io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchRequest.newBuilder()
- private Builder() {
-
- }
-
- private Builder(
- com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
- super(parent);
-
- }
- @java.lang.Override
- public Builder clear() {
- super.clear();
- return this;
- }
-
- @java.lang.Override
- public com.google.protobuf.Descriptors.Descriptor
- getDescriptorForType() {
- return io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.internal_static_weaviategrpc_SearchRequest_descriptor;
- }
-
- @java.lang.Override
- public io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchRequest getDefaultInstanceForType() {
- return io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchRequest.getDefaultInstance();
- }
-
- @java.lang.Override
- public io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchRequest build() {
- io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchRequest result = buildPartial();
- if (!result.isInitialized()) {
- throw newUninitializedMessageException(result);
- }
- return result;
- }
-
- @java.lang.Override
- public io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchRequest buildPartial() {
- io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchRequest result = new io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchRequest(this);
- onBuilt();
- return result;
- }
-
- @java.lang.Override
- public Builder clone() {
- return super.clone();
- }
- @java.lang.Override
- public Builder setField(
- com.google.protobuf.Descriptors.FieldDescriptor field,
- java.lang.Object value) {
- return super.setField(field, value);
- }
- @java.lang.Override
- public Builder clearField(
- com.google.protobuf.Descriptors.FieldDescriptor field) {
- return super.clearField(field);
- }
- @java.lang.Override
- public Builder clearOneof(
- com.google.protobuf.Descriptors.OneofDescriptor oneof) {
- return super.clearOneof(oneof);
- }
- @java.lang.Override
- public Builder setRepeatedField(
- com.google.protobuf.Descriptors.FieldDescriptor field,
- int index, java.lang.Object value) {
- return super.setRepeatedField(field, index, value);
- }
- @java.lang.Override
- public Builder addRepeatedField(
- com.google.protobuf.Descriptors.FieldDescriptor field,
- java.lang.Object value) {
- return super.addRepeatedField(field, value);
- }
- @java.lang.Override
- public Builder mergeFrom(com.google.protobuf.Message other) {
- if (other instanceof io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchRequest) {
- return mergeFrom((io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchRequest)other);
- } else {
- super.mergeFrom(other);
- return this;
- }
- }
-
- public Builder mergeFrom(io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchRequest other) {
- if (other == io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchRequest.getDefaultInstance()) return this;
- this.mergeUnknownFields(other.getUnknownFields());
- onChanged();
- return this;
- }
-
- @java.lang.Override
- public final boolean isInitialized() {
- return true;
- }
-
- @java.lang.Override
- public Builder mergeFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- if (extensionRegistry == null) {
- throw new java.lang.NullPointerException();
- }
- try {
- boolean done = false;
- while (!done) {
- int tag = input.readTag();
- switch (tag) {
- case 0:
- done = true;
- break;
- default: {
- if (!super.parseUnknownField(input, extensionRegistry, tag)) {
- done = true; // was an endgroup tag
- }
- break;
- } // default:
- } // switch (tag)
- } // while (!done)
- } catch (com.google.protobuf.InvalidProtocolBufferException e) {
- throw e.unwrapIOException();
- } finally {
- onChanged();
- } // finally
- return this;
- }
- @java.lang.Override
- public final Builder setUnknownFields(
- final com.google.protobuf.UnknownFieldSet unknownFields) {
- return super.setUnknownFields(unknownFields);
- }
-
- @java.lang.Override
- public final Builder mergeUnknownFields(
- final com.google.protobuf.UnknownFieldSet unknownFields) {
- return super.mergeUnknownFields(unknownFields);
- }
-
-
- // @@protoc_insertion_point(builder_scope:weaviategrpc.SearchRequest)
- }
-
- // @@protoc_insertion_point(class_scope:weaviategrpc.SearchRequest)
- private static final io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchRequest DEFAULT_INSTANCE;
- static {
- DEFAULT_INSTANCE = new io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchRequest();
- }
-
- public static io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchRequest getDefaultInstance() {
- return DEFAULT_INSTANCE;
- }
-
- private static final com.google.protobuf.Parser
- PARSER = new com.google.protobuf.AbstractParser() {
- @java.lang.Override
- public SearchRequest parsePartialFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- Builder builder = newBuilder();
- try {
- builder.mergeFrom(input, extensionRegistry);
- } catch (com.google.protobuf.InvalidProtocolBufferException e) {
- throw e.setUnfinishedMessage(builder.buildPartial());
- } catch (com.google.protobuf.UninitializedMessageException e) {
- throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
- } catch (java.io.IOException e) {
- throw new com.google.protobuf.InvalidProtocolBufferException(e)
- .setUnfinishedMessage(builder.buildPartial());
- }
- return builder.buildPartial();
- }
- };
-
- public static com.google.protobuf.Parser parser() {
- return PARSER;
- }
-
- @java.lang.Override
- public com.google.protobuf.Parser getParserForType() {
- return PARSER;
- }
-
- @java.lang.Override
- public io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchRequest getDefaultInstanceForType() {
- return DEFAULT_INSTANCE;
- }
-
- }
-
- public interface SearchReplyOrBuilder extends
- // @@protoc_insertion_point(interface_extends:weaviategrpc.SearchReply)
- com.google.protobuf.MessageOrBuilder {
- }
- /**
- * Protobuf type {@code weaviategrpc.SearchReply}
- */
- public static final class SearchReply extends
- com.google.protobuf.GeneratedMessageV3 implements
- // @@protoc_insertion_point(message_implements:weaviategrpc.SearchReply)
- SearchReplyOrBuilder {
- private static final long serialVersionUID = 0L;
- // Use SearchReply.newBuilder() to construct.
- private SearchReply(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
- super(builder);
- }
- private SearchReply() {
- }
-
- @java.lang.Override
- @SuppressWarnings({"unused"})
- protected java.lang.Object newInstance(
- UnusedPrivateParameter unused) {
- return new SearchReply();
- }
-
- public static final com.google.protobuf.Descriptors.Descriptor
- getDescriptor() {
- return io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.internal_static_weaviategrpc_SearchReply_descriptor;
- }
-
- @java.lang.Override
- protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
- internalGetFieldAccessorTable() {
- return io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.internal_static_weaviategrpc_SearchReply_fieldAccessorTable
- .ensureFieldAccessorsInitialized(
- io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchReply.class, io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchReply.Builder.class);
- }
-
- private byte memoizedIsInitialized = -1;
- @java.lang.Override
- public final boolean isInitialized() {
- byte isInitialized = memoizedIsInitialized;
- if (isInitialized == 1) return true;
- if (isInitialized == 0) return false;
-
- memoizedIsInitialized = 1;
- return true;
- }
-
- @java.lang.Override
- public void writeTo(com.google.protobuf.CodedOutputStream output)
- throws java.io.IOException {
- getUnknownFields().writeTo(output);
- }
-
- @java.lang.Override
- public int getSerializedSize() {
- int size = memoizedSize;
- if (size != -1) return size;
-
- size = 0;
- size += getUnknownFields().getSerializedSize();
- memoizedSize = size;
- return size;
- }
-
- @java.lang.Override
- public boolean equals(final java.lang.Object obj) {
- if (obj == this) {
- return true;
- }
- if (!(obj instanceof io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchReply)) {
- return super.equals(obj);
- }
- io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchReply other = (io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchReply) obj;
-
- if (!getUnknownFields().equals(other.getUnknownFields())) return false;
- return true;
- }
-
- @java.lang.Override
- public int hashCode() {
- if (memoizedHashCode != 0) {
- return memoizedHashCode;
- }
- int hash = 41;
- hash = (19 * hash) + getDescriptor().hashCode();
- hash = (29 * hash) + getUnknownFields().hashCode();
- memoizedHashCode = hash;
- return hash;
- }
-
- public static io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchReply parseFrom(
- java.nio.ByteBuffer data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
- public static io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchReply parseFrom(
- java.nio.ByteBuffer data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
- public static io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchReply parseFrom(
- com.google.protobuf.ByteString data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
- public static io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchReply parseFrom(
- com.google.protobuf.ByteString data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
- public static io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchReply parseFrom(byte[] data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
- public static io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchReply parseFrom(
- byte[] data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
- public static io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchReply parseFrom(java.io.InputStream input)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input);
- }
- public static io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchReply parseFrom(
- java.io.InputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input, extensionRegistry);
- }
-
- public static io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchReply parseDelimitedFrom(java.io.InputStream input)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseDelimitedWithIOException(PARSER, input);
- }
-
- public static io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchReply parseDelimitedFrom(
- java.io.InputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
- }
- public static io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchReply parseFrom(
- com.google.protobuf.CodedInputStream input)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input);
- }
- public static io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchReply parseFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input, extensionRegistry);
- }
-
- @java.lang.Override
- public Builder newBuilderForType() { return newBuilder(); }
- public static Builder newBuilder() {
- return DEFAULT_INSTANCE.toBuilder();
- }
- public static Builder newBuilder(io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchReply prototype) {
- return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
- }
- @java.lang.Override
- public Builder toBuilder() {
- return this == DEFAULT_INSTANCE
- ? new Builder() : new Builder().mergeFrom(this);
- }
-
- @java.lang.Override
- protected Builder newBuilderForType(
- com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
- Builder builder = new Builder(parent);
- return builder;
- }
- /**
- * Protobuf type {@code weaviategrpc.SearchReply}
- */
- public static final class Builder extends
- com.google.protobuf.GeneratedMessageV3.Builder implements
- // @@protoc_insertion_point(builder_implements:weaviategrpc.SearchReply)
- io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchReplyOrBuilder {
- public static final com.google.protobuf.Descriptors.Descriptor
- getDescriptor() {
- return io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.internal_static_weaviategrpc_SearchReply_descriptor;
- }
-
- @java.lang.Override
- protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
- internalGetFieldAccessorTable() {
- return io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.internal_static_weaviategrpc_SearchReply_fieldAccessorTable
- .ensureFieldAccessorsInitialized(
- io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchReply.class, io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchReply.Builder.class);
- }
-
- // Construct using io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchReply.newBuilder()
- private Builder() {
-
- }
-
- private Builder(
- com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
- super(parent);
-
- }
- @java.lang.Override
- public Builder clear() {
- super.clear();
- return this;
- }
-
- @java.lang.Override
- public com.google.protobuf.Descriptors.Descriptor
- getDescriptorForType() {
- return io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.internal_static_weaviategrpc_SearchReply_descriptor;
- }
-
- @java.lang.Override
- public io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchReply getDefaultInstanceForType() {
- return io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchReply.getDefaultInstance();
- }
-
- @java.lang.Override
- public io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchReply build() {
- io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchReply result = buildPartial();
- if (!result.isInitialized()) {
- throw newUninitializedMessageException(result);
- }
- return result;
- }
-
- @java.lang.Override
- public io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchReply buildPartial() {
- io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchReply result = new io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchReply(this);
- onBuilt();
- return result;
- }
-
- @java.lang.Override
- public Builder clone() {
- return super.clone();
- }
- @java.lang.Override
- public Builder setField(
- com.google.protobuf.Descriptors.FieldDescriptor field,
- java.lang.Object value) {
- return super.setField(field, value);
- }
- @java.lang.Override
- public Builder clearField(
- com.google.protobuf.Descriptors.FieldDescriptor field) {
- return super.clearField(field);
- }
- @java.lang.Override
- public Builder clearOneof(
- com.google.protobuf.Descriptors.OneofDescriptor oneof) {
- return super.clearOneof(oneof);
- }
- @java.lang.Override
- public Builder setRepeatedField(
- com.google.protobuf.Descriptors.FieldDescriptor field,
- int index, java.lang.Object value) {
- return super.setRepeatedField(field, index, value);
- }
- @java.lang.Override
- public Builder addRepeatedField(
- com.google.protobuf.Descriptors.FieldDescriptor field,
- java.lang.Object value) {
- return super.addRepeatedField(field, value);
- }
- @java.lang.Override
- public Builder mergeFrom(com.google.protobuf.Message other) {
- if (other instanceof io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchReply) {
- return mergeFrom((io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchReply)other);
- } else {
- super.mergeFrom(other);
- return this;
- }
- }
-
- public Builder mergeFrom(io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchReply other) {
- if (other == io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchReply.getDefaultInstance()) return this;
- this.mergeUnknownFields(other.getUnknownFields());
- onChanged();
- return this;
- }
-
- @java.lang.Override
- public final boolean isInitialized() {
- return true;
- }
-
- @java.lang.Override
- public Builder mergeFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- if (extensionRegistry == null) {
- throw new java.lang.NullPointerException();
- }
- try {
- boolean done = false;
- while (!done) {
- int tag = input.readTag();
- switch (tag) {
- case 0:
- done = true;
- break;
- default: {
- if (!super.parseUnknownField(input, extensionRegistry, tag)) {
- done = true; // was an endgroup tag
- }
- break;
- } // default:
- } // switch (tag)
- } // while (!done)
- } catch (com.google.protobuf.InvalidProtocolBufferException e) {
- throw e.unwrapIOException();
- } finally {
- onChanged();
- } // finally
- return this;
- }
- @java.lang.Override
- public final Builder setUnknownFields(
- final com.google.protobuf.UnknownFieldSet unknownFields) {
- return super.setUnknownFields(unknownFields);
- }
-
- @java.lang.Override
- public final Builder mergeUnknownFields(
- final com.google.protobuf.UnknownFieldSet unknownFields) {
- return super.mergeUnknownFields(unknownFields);
- }
-
-
- // @@protoc_insertion_point(builder_scope:weaviategrpc.SearchReply)
- }
-
- // @@protoc_insertion_point(class_scope:weaviategrpc.SearchReply)
- private static final io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchReply DEFAULT_INSTANCE;
- static {
- DEFAULT_INSTANCE = new io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchReply();
- }
-
- public static io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchReply getDefaultInstance() {
- return DEFAULT_INSTANCE;
- }
-
- private static final com.google.protobuf.Parser
- PARSER = new com.google.protobuf.AbstractParser() {
- @java.lang.Override
- public SearchReply parsePartialFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- Builder builder = newBuilder();
- try {
- builder.mergeFrom(input, extensionRegistry);
- } catch (com.google.protobuf.InvalidProtocolBufferException e) {
- throw e.setUnfinishedMessage(builder.buildPartial());
- } catch (com.google.protobuf.UninitializedMessageException e) {
- throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
- } catch (java.io.IOException e) {
- throw new com.google.protobuf.InvalidProtocolBufferException(e)
- .setUnfinishedMessage(builder.buildPartial());
- }
- return builder.buildPartial();
- }
- };
-
- public static com.google.protobuf.Parser parser() {
- return PARSER;
- }
-
- @java.lang.Override
- public com.google.protobuf.Parser getParserForType() {
- return PARSER;
- }
-
- @java.lang.Override
- public io.weaviate.client6.grpc.protocol.v0.WeaviateProtoSearchGet.SearchReply getDefaultInstanceForType() {
- return DEFAULT_INSTANCE;
- }
-
- }
-
- private static final com.google.protobuf.Descriptors.Descriptor
- internal_static_weaviategrpc_SearchRequest_descriptor;
- private static final
- com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
- internal_static_weaviategrpc_SearchRequest_fieldAccessorTable;
- private static final com.google.protobuf.Descriptors.Descriptor
- internal_static_weaviategrpc_SearchReply_descriptor;
- private static final
- com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
- internal_static_weaviategrpc_SearchReply_fieldAccessorTable;
-
- public static com.google.protobuf.Descriptors.FileDescriptor
- getDescriptor() {
- return descriptor;
- }
- private static com.google.protobuf.Descriptors.FileDescriptor
- descriptor;
- static {
- java.lang.String[] descriptorData = {
- "\n\023v0/search_get.proto\022\014weaviategrpc\"\017\n\rS" +
- "earchRequest\"\r\n\013SearchReplyBt\n$io.weavia" +
- "te.client6.grpc.protocol.v0B\026WeaviatePro" +
- "toSearchGetZ4github.com/weaviate/weaviat" +
- "e/grpc/generated;protocolb\006proto3"
- };
- descriptor = com.google.protobuf.Descriptors.FileDescriptor
- .internalBuildGeneratedFileFrom(descriptorData,
- new com.google.protobuf.Descriptors.FileDescriptor[] {
- });
- internal_static_weaviategrpc_SearchRequest_descriptor =
- getDescriptor().getMessageTypes().get(0);
- internal_static_weaviategrpc_SearchRequest_fieldAccessorTable = new
- com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
- internal_static_weaviategrpc_SearchRequest_descriptor,
- new java.lang.String[] { });
- internal_static_weaviategrpc_SearchReply_descriptor =
- getDescriptor().getMessageTypes().get(1);
- internal_static_weaviategrpc_SearchReply_fieldAccessorTable = new
- com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
- internal_static_weaviategrpc_SearchReply_descriptor,
- new java.lang.String[] { });
- }
-
- // @@protoc_insertion_point(outer_class_scope)
-}
diff --git a/src/main/java/io/weaviate/client6/internal/DtoTypeAdapterFactory.java b/src/main/java/io/weaviate/client6/internal/DtoTypeAdapterFactory.java
new file mode 100644
index 000000000..812f6dddd
--- /dev/null
+++ b/src/main/java/io/weaviate/client6/internal/DtoTypeAdapterFactory.java
@@ -0,0 +1,108 @@
+package io.weaviate.client6.internal;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import com.google.gson.Gson;
+import com.google.gson.TypeAdapter;
+import com.google.gson.TypeAdapterFactory;
+import com.google.gson.reflect.TypeToken;
+import com.google.gson.stream.JsonReader;
+import com.google.gson.stream.JsonWriter;
+
+/**
+ * DtoTypeAdapterFactory de-/serializes objects using their registerred DTOs.
+ *
+ *
+ * DTO classes must implement {@link Dto}, which produces the original model.
+ * Meanwhile, models do not need to be modified, to avoid leaking
+ * de-/serialization details.
+ *
+ *
+ * Usage:
+ *
+ *
{@code
+ * public class HttpHanlder {
+ * static {
+ * DtoTypeAdapterFactory.register(
+ * MyDomainObject.class,
+ * MyDtoObject.class,
+ * domain -> new MyDtoObject(domain));
+ * }
+ * static final Gson gson = new GsonBuilder()
+ * .registerTypeAdapterFactory(new DtoTypeAdapterFactory())
+ * .create();
+ * }
+ * }
+ */
+public class DtoTypeAdapterFactory implements TypeAdapterFactory {
+ private static boolean locked = false;
+ private static final Map, Pair, ?>> registry = new HashMap<>();
+
+ /**
+ * Register a model-DTO pair.
+ *
+ *
+ * Only one DTO can be registerred per model.
+ * Subsequent registrations will be ignored.
+ */
+ public static > void register(Class model, Class dto,
+ ModelConverter> convert) {
+ registry.putIfAbsent(model, new Pair(dto, convert));
+ }
+
+ /**
+ * Get model-DTO pair for the provided model class. Returns null if no pair is
+ * registerred. In this case {@link #create} should also return null.
+ *
+ *
+ * Conversion to {@code Pair} is safe, as entries to {@link #registry}
+ * can only be added via {@link #register}, which is type-safe.
+ */
+ @SuppressWarnings("unchecked")
+ private static > Pair getPair(TypeToken super M> type) {
+ var cls = type.getRawType();
+ if (!registry.containsKey(cls)) {
+ return null;
+ }
+ return (Pair) registry.get(cls);
+ }
+
+ /** Dto produces a domain model. */
+ public interface Dto {
+ M toModel();
+ }
+
+ /** ModelConverter converts domain model to a DTO. */
+ @FunctionalInterface
+ public interface ModelConverter> {
+ D toDTO(M model);
+ }
+
+ record Pair>(Class dto, ModelConverter> convert) {
+ }
+
+ @Override
+ public TypeAdapter create(Gson gson, TypeToken type) {
+ var pair = getPair(type);
+ if (pair == null) {
+ return null;
+ }
+ var delegate = gson.getDelegateAdapter(this, TypeToken.get(pair.dto));
+ return new TypeAdapter() {
+
+ @Override
+ public T read(JsonReader in) throws IOException {
+ var dto = delegate.read(in);
+ return dto.toModel();
+ }
+
+ @Override
+ public void write(JsonWriter out, T value) throws IOException {
+ var dto = pair.convert.toDTO(value);
+ delegate.write(out, dto);
+ }
+ };
+ }
+}
diff --git a/src/main/java/io/weaviate/client6/internal/GRPC.java b/src/main/java/io/weaviate/client6/internal/GRPC.java
new file mode 100644
index 000000000..bd9bdd6c1
--- /dev/null
+++ b/src/main/java/io/weaviate/client6/internal/GRPC.java
@@ -0,0 +1,93 @@
+package io.weaviate.client6.internal;
+
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import java.nio.FloatBuffer;
+import java.util.Arrays;
+
+import org.apache.commons.lang3.ArrayUtils;
+
+import com.google.protobuf.ByteString;
+
+public class GRPC {
+ private static final ByteOrder BYTE_ORDER = ByteOrder.LITTLE_ENDIAN;
+
+ /** Encode Float[] to ByteString. */
+ public static ByteString toByteString(Float[] vector) {
+ if (vector == null || vector.length == 0) {
+ return ByteString.EMPTY;
+ }
+ ByteBuffer buffer = ByteBuffer.allocate(vector.length * Float.BYTES).order(BYTE_ORDER);
+ Arrays.stream(vector).forEach(buffer::putFloat);
+ return ByteString.copyFrom(buffer.array());
+ }
+
+ /** Encode float[] to ByteString. */
+ public static ByteString toByteString(float[] vector) {
+ ByteBuffer buffer = ByteBuffer.allocate(vector.length * Float.BYTES).order(BYTE_ORDER);
+ for (float f : vector) {
+ buffer.putFloat(f);
+ }
+ return ByteString.copyFrom(buffer.array());
+ }
+
+ /**
+ * Encode Float[][] to ByteString.
+ *
+ * The first 2 bytes of the resulting ByteString encode the number of dimensions
+ * (uint16 / short) followed by concatenated vectors (4 bytes per element).
+ */
+ public static ByteString toByteString(Float[][] vectors) {
+ if (vectors == null || vectors.length == 0 || vectors[0].length == 0) {
+ return ByteString.EMPTY;
+ }
+
+ int n = vectors.length;
+ short dimensions = (short) vectors[0].length;
+ int capacity = /* vector dimensions */ Short.BYTES +
+ /* concatenated elements */ (n * dimensions * Float.BYTES);
+ ByteBuffer buffer = ByteBuffer.allocate(capacity).order(BYTE_ORDER)
+ .putShort(dimensions);
+ Arrays.stream(vectors).forEach(v -> Arrays.stream(v).forEach(buffer::putFloat));
+ return ByteString.copyFrom(buffer.array());
+ }
+
+ /**
+ * Decode ByteString into a Float[]. ByteString size must be a multiple of
+ * {@link Float#BYTES}, throws {@link IllegalArgumentException} otherwise.
+ */
+ public static Float[] fromByteString(ByteString bs) {
+ if (bs.size() % Float.BYTES != 0) {
+ throw new IllegalArgumentException(
+ "byte string size not a multiple of " + String.valueOf(Float.BYTES) + " (Float.BYTES)");
+ }
+ float[] vector = new float[bs.size() / Float.BYTES];
+ bs.asReadOnlyByteBuffer().order(BYTE_ORDER).asFloatBuffer().get(vector);
+ return ArrayUtils.toObject(vector);
+ }
+
+ /** Decode ByteString into a Float[][]. */
+ public static Float[][] fromByteStringMulti(ByteString bs) {
+ if (bs == null || bs.size() == 0) {
+ return new Float[0][0];
+ }
+
+ ByteBuffer buf = bs.asReadOnlyByteBuffer().order(BYTE_ORDER);
+
+ // Dimensions are encoded in the first 2 bytes.
+ short dimensions = buf.getShort(); // advances current position
+
+ FloatBuffer fbuf = buf.asFloatBuffer();
+ int n = fbuf.remaining() / dimensions; // fbuf size is buf / Float.BYTES
+
+ // Reading from buffer advances current position,
+ // so we always read from offset=0.
+ Float[][] vectors = new Float[n][dimensions];
+ for (int i = 0; i < n; i++) {
+ float[] v = new float[dimensions];
+ fbuf.get(v, 0, dimensions);
+ vectors[i] = ArrayUtils.toObject(v);
+ }
+ return vectors;
+ }
+}
diff --git a/src/main/java/io/weaviate/client6/internal/GrpcClient.java b/src/main/java/io/weaviate/client6/internal/GrpcClient.java
new file mode 100644
index 000000000..3e4045cc6
--- /dev/null
+++ b/src/main/java/io/weaviate/client6/internal/GrpcClient.java
@@ -0,0 +1,37 @@
+package io.weaviate.client6.internal;
+
+import java.io.Closeable;
+import java.io.IOException;
+
+import io.grpc.ManagedChannel;
+import io.grpc.ManagedChannelBuilder;
+import io.grpc.stub.MetadataUtils;
+import io.weaviate.client6.Config;
+import io.weaviate.client6.grpc.protocol.v1.WeaviateGrpc;
+import io.weaviate.client6.grpc.protocol.v1.WeaviateGrpc.WeaviateBlockingStub;
+
+public class GrpcClient implements Closeable {
+ private final ManagedChannel channel;
+ public final WeaviateBlockingStub grpc;
+
+ public GrpcClient(Config config) {
+ this.channel = buildChannel(config);
+ this.grpc = buildStub(channel);
+ }
+
+ @Override
+ public void close() throws IOException {
+ channel.shutdown();
+ }
+
+ private static ManagedChannel buildChannel(Config config) {
+ ManagedChannelBuilder> channelBuilder = ManagedChannelBuilder.forTarget(config.grpcAddress());
+ channelBuilder.usePlaintext();
+ return channelBuilder.build();
+ }
+
+ private static WeaviateBlockingStub buildStub(ManagedChannel channel) {
+ return WeaviateGrpc.newBlockingStub(channel)
+ .withInterceptors(MetadataUtils.newAttachHeadersInterceptor(new io.grpc.Metadata()));
+ }
+}
diff --git a/src/main/java/io/weaviate/client6/internal/HttpClient.java b/src/main/java/io/weaviate/client6/internal/HttpClient.java
new file mode 100644
index 000000000..1d1122b37
--- /dev/null
+++ b/src/main/java/io/weaviate/client6/internal/HttpClient.java
@@ -0,0 +1,23 @@
+package io.weaviate.client6.internal;
+
+import java.io.Closeable;
+import java.io.IOException;
+
+import org.apache.hc.client5.http.impl.classic.CloseableHttpClient;
+import org.apache.hc.client5.http.impl.classic.HttpClients;
+
+public class HttpClient implements Closeable {
+ // TODO: move somewhere
+ // public static final Gson GSON =
+
+ public final CloseableHttpClient http;
+
+ public HttpClient() {
+ http = HttpClients.createDefault();
+ }
+
+ @Override
+ public void close() throws IOException {
+ http.close();
+ }
+}
diff --git a/src/main/java/io/weaviate/client6/v1/Collection.java b/src/main/java/io/weaviate/client6/v1/Collection.java
new file mode 100644
index 000000000..e12f56915
--- /dev/null
+++ b/src/main/java/io/weaviate/client6/v1/Collection.java
@@ -0,0 +1,17 @@
+package io.weaviate.client6.v1;
+
+import io.weaviate.client6.Config;
+import io.weaviate.client6.internal.GrpcClient;
+import io.weaviate.client6.internal.HttpClient;
+import io.weaviate.client6.v1.data.Data;
+import io.weaviate.client6.v1.query.Query;
+
+public class Collection {
+ public final Query query;
+ public final Data data;
+
+ public Collection(String collectionName, Config config, GrpcClient grpc, HttpClient http) {
+ this.query = new Query<>(collectionName, grpc);
+ this.data = new Data<>(collectionName, config, http);
+ }
+}
diff --git a/src/main/java/io/weaviate/client6/v1/ObjectMetadata.java b/src/main/java/io/weaviate/client6/v1/ObjectMetadata.java
new file mode 100644
index 000000000..d63b0225a
--- /dev/null
+++ b/src/main/java/io/weaviate/client6/v1/ObjectMetadata.java
@@ -0,0 +1,55 @@
+package io.weaviate.client6.v1;
+
+import java.util.function.Consumer;
+
+public record ObjectMetadata(String id, Vectors vectors) {
+
+ public static ObjectMetadata with(Consumer options) {
+ var opt = new Builder(options);
+ return new ObjectMetadata(opt.id, opt.vectors);
+ }
+
+ public static class Builder {
+ public String id;
+ public Vectors vectors;
+
+ public Builder id(String id) {
+ this.id = id;
+ return this;
+ }
+
+ public Builder vectors(Vectors vectors) {
+ this.vectors = vectors;
+ return this;
+ }
+
+ public Builder vectors(Float[] vector) {
+ this.vectors = Vectors.of(vector);
+ return this;
+ }
+
+ public Builder vectors(Float[][] vector) {
+ this.vectors = Vectors.of(vector);
+ return this;
+ }
+
+ public Builder vectors(String name, Float[] vector) {
+ this.vectors = Vectors.of(name, vector);
+ return this;
+ }
+
+ public Builder vectors(String name, Float[][] vector) {
+ this.vectors = Vectors.of(name, vector);
+ return this;
+ }
+
+ public Builder vectors(Consumer named) {
+ this.vectors = Vectors.with(named);
+ return this;
+ }
+
+ private Builder(Consumer options) {
+ options.accept(this);
+ }
+ }
+}
diff --git a/src/main/java/io/weaviate/client6/v1/Vectors.java b/src/main/java/io/weaviate/client6/v1/Vectors.java
new file mode 100644
index 000000000..9a69a5fa9
--- /dev/null
+++ b/src/main/java/io/weaviate/client6/v1/Vectors.java
@@ -0,0 +1,126 @@
+package io.weaviate.client6.v1;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Optional;
+import java.util.function.Consumer;
+
+/**
+ * Vectors is an abstraction over named vectors.
+ * It may contain both 1-dimensional and 2-dimensional vectors.
+ */
+public class Vectors {
+ private static final String DEFAULT = "default";
+
+ private Float[] unnamedVector;
+ private Map namedVectors;
+
+ public Float[] getSingle(String name) {
+ return (Float[]) namedVectors.get(name);
+ }
+
+ public Float[] getDefaultSingle() {
+ return getSingle(DEFAULT);
+ }
+
+ @SuppressWarnings("unchecked")
+ public Optional getSingle() {
+ return (Optional) getOnly();
+ }
+
+ public Float[][] getMulti(String name) {
+ return (Float[][]) namedVectors.get(name);
+ }
+
+ public Float[][] getDefaultMulti() {
+ return getMulti(DEFAULT);
+ }
+
+ @SuppressWarnings("unchecked")
+ public Optional getMulti() {
+ return (Optional) getOnly();
+ }
+
+ public Optional getUnnamed() {
+ return Optional.ofNullable(unnamedVector);
+ }
+
+ private Optional> getOnly() {
+ if (namedVectors == null || namedVectors.isEmpty() || namedVectors.size() > 1) {
+ return Optional.empty();
+ }
+ return Optional.ofNullable(namedVectors.values().iterator().next());
+ }
+
+ public Map asMap() {
+ return Map.copyOf(namedVectors);
+ }
+
+ /** Creates Vectors with a single unnamed vector. */
+ private Vectors(Float[] vector) {
+ this(Map.of());
+ this.unnamedVector = vector;
+ }
+
+ /** Creates Vectors with one named vector. */
+ private Vectors(String name, Object vector) {
+ this.namedVectors = Map.of(name, vector);
+ }
+
+ /** Creates immutable set of vectors. */
+ private Vectors(Map vectors) {
+ this.namedVectors = Collections.unmodifiableMap(vectors);
+ }
+
+ static Vectors with(Consumer named) {
+ var vectors = new NamedVectors(named);
+ return new Vectors(vectors.namedVectors);
+ }
+
+ /**
+ * Pass legacy unnamed vector.
+ * Multi-vectors can only be passed as named vectors.
+ */
+ public static Vectors unnamed(Float[] vector) {
+ return new Vectors(vector);
+ }
+
+ public static Vectors of(Float[] vector) {
+ return new Vectors(DEFAULT, vector);
+ }
+
+ public static Vectors of(Float[][] vector) {
+ return new Vectors(DEFAULT, vector);
+ }
+
+ public static Vectors of(String name, Float[] vector) {
+ return new Vectors(name, vector);
+ }
+
+ public static Vectors of(String name, Float[][] vector) {
+ return new Vectors(name, vector);
+ }
+
+ public static Vectors of(Map vectors) {
+ return new Vectors(vectors);
+ }
+
+ public static class NamedVectors {
+ private Map namedVectors = new HashMap<>();
+
+ public NamedVectors vector(String name, Float[] vector) {
+ this.namedVectors.put(name, vector);
+ return this;
+ }
+
+ public NamedVectors vector(String name, Float[][] vector) {
+ this.namedVectors.put(name, vector);
+ return this;
+ }
+
+ NamedVectors(Consumer options) {
+ options.accept(this);
+ }
+ }
+}
diff --git a/src/main/java/io/weaviate/client6/v1/collections/CollectionDefinition.java b/src/main/java/io/weaviate/client6/v1/collections/CollectionDefinition.java
new file mode 100644
index 000000000..b599f4ceb
--- /dev/null
+++ b/src/main/java/io/weaviate/client6/v1/collections/CollectionDefinition.java
@@ -0,0 +1,51 @@
+package io.weaviate.client6.v1.collections;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.function.Consumer;
+
+import io.weaviate.client6.v1.collections.Vectors.NamedVectors;
+
+public record CollectionDefinition(String name, List properties, Vectors vectors) {
+
+ public static CollectionDefinition with(String name, Consumer options) {
+ var config = new Configuration(options);
+ return new CollectionDefinition(name, config.properties, config.vectors);
+ }
+
+ // Tucked Builder for additional collection configuration.
+ public static class Configuration {
+ public List properties = new ArrayList<>();
+ public Vectors vectors;
+
+ public Configuration properties(Property... properties) {
+ this.properties = Arrays.asList(properties);
+ return this;
+ }
+
+ public Configuration vectors(Vectors vectors) {
+ this.vectors = vectors;
+ return this;
+ }
+
+ public Configuration vector(VectorIndex vector) {
+ this.vectors = Vectors.of(vector);
+ return this;
+ }
+
+ public Configuration vector(String name, VectorIndex vector) {
+ this.vectors = new Vectors(name, vector);
+ return this;
+ }
+
+ public Configuration vectors(Consumer named) {
+ this.vectors = Vectors.with(named);
+ return this;
+ }
+
+ Configuration(Consumer options) {
+ options.accept(this);
+ }
+ }
+}
diff --git a/src/main/java/io/weaviate/client6/v1/collections/CollectionDefinitionDTO.java b/src/main/java/io/weaviate/client6/v1/collections/CollectionDefinitionDTO.java
new file mode 100644
index 000000000..2c6cd5c85
--- /dev/null
+++ b/src/main/java/io/weaviate/client6/v1/collections/CollectionDefinitionDTO.java
@@ -0,0 +1,45 @@
+package io.weaviate.client6.v1.collections;
+
+import java.util.List;
+
+import com.google.gson.annotations.SerializedName;
+
+import io.weaviate.client6.internal.DtoTypeAdapterFactory;
+
+class CollectionDefinitionDTO implements DtoTypeAdapterFactory.Dto {
+ @SerializedName("class")
+ String collection;
+
+ @SerializedName("properties")
+ List properties;
+
+ @SerializedName("vectorConfig")
+ Vectors vectors;
+
+ @SerializedName("vectorIndexType")
+ private VectorIndex.IndexType vectorIndexType;
+
+ @SerializedName("vectorIndexConfig")
+ private VectorIndex.IndexingStrategy vectorIndexConfig;
+
+ @SerializedName("vectorizer")
+ private Vectorizer vectorizer;
+
+ public CollectionDefinitionDTO(CollectionDefinition colDef) {
+ this.collection = colDef.name();
+ this.properties = colDef.properties();
+ this.vectors = colDef.vectors();
+
+ var unnamed = this.vectors.getUnnamed();
+ if (unnamed.isPresent()) {
+ var index = unnamed.get();
+ this.vectorIndexType = index.type();
+ this.vectorIndexConfig = index.configuration();
+ this.vectorizer = index.vectorizer();
+ }
+ }
+
+ public CollectionDefinition toModel() {
+ return new CollectionDefinition(collection, properties, vectors);
+ }
+}
diff --git a/src/main/java/io/weaviate/client6/v1/collections/Collections.java b/src/main/java/io/weaviate/client6/v1/collections/Collections.java
new file mode 100644
index 000000000..0a2b8e97d
--- /dev/null
+++ b/src/main/java/io/weaviate/client6/v1/collections/Collections.java
@@ -0,0 +1,164 @@
+package io.weaviate.client6.v1.collections;
+
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.lang.reflect.Type;
+import java.util.Map;
+import java.util.Optional;
+import java.util.function.Consumer;
+
+import org.apache.hc.core5.http.ClassicHttpRequest;
+import org.apache.hc.core5.http.ContentType;
+import org.apache.hc.core5.http.HttpStatus;
+import org.apache.hc.core5.http.io.entity.EntityUtils;
+import org.apache.hc.core5.http.io.support.ClassicRequestBuilder;
+
+import com.google.common.reflect.TypeToken;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import com.google.gson.JsonDeserializationContext;
+import com.google.gson.JsonDeserializer;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonParseException;
+import com.google.gson.JsonSerializationContext;
+import com.google.gson.JsonSerializer;
+import com.google.gson.TypeAdapter;
+import com.google.gson.stream.JsonReader;
+import com.google.gson.stream.JsonWriter;
+
+import io.weaviate.client6.Config;
+import io.weaviate.client6.internal.DtoTypeAdapterFactory;
+import io.weaviate.client6.internal.GrpcClient;
+import io.weaviate.client6.internal.HttpClient;
+import io.weaviate.client6.v1.Collection;
+import io.weaviate.client6.v1.collections.VectorIndex.IndexingStrategy;
+import lombok.AllArgsConstructor;
+
+@AllArgsConstructor
+public class Collections {
+ // TODO: hide befind an internal HttpClient
+ private final Config config;
+
+ private final HttpClient httpClient;
+ private final GrpcClient grpcClient;
+
+ static {
+ DtoTypeAdapterFactory.register(
+ CollectionDefinition.class,
+ CollectionDefinitionDTO.class,
+ m -> {
+ return new CollectionDefinitionDTO(m);
+ });
+ }
+
+ // Gson cannot deserialize interfaces:
+ // https://stackoverflow.com/a/49871339/14726116
+ private static class IndexingStrategySerde
+ implements JsonDeserializer, JsonSerializer {
+
+ @Override
+ public IndexingStrategy deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)
+ throws JsonParseException {
+ return IndexingStrategy.hnsw();
+ }
+
+ @Override
+ public JsonElement serialize(IndexingStrategy src, Type typeOfSrc, JsonSerializationContext context) {
+ return context.serialize(src);
+ }
+ }
+
+ // Gson cannot deserialize interfaces:
+ // https://stackoverflow.com/a/49871339/14726116
+ private static class VectorizerSerde
+ implements JsonDeserializer, JsonSerializer {
+
+ @Override
+ public Vectorizer deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)
+ throws JsonParseException {
+ return Vectorizer.none();
+ }
+
+ @Override
+ public JsonElement serialize(Vectorizer src, Type typeOfSrc, JsonSerializationContext context) {
+ return context.serialize(src);
+ }
+ }
+
+ private static final Gson gson = new GsonBuilder()
+ .registerTypeAdapterFactory(new DtoTypeAdapterFactory())
+ .registerTypeAdapter(Vectors.class, new TypeAdapter() {
+ Gson gson = new GsonBuilder()
+ .registerTypeAdapter(Vectorizer.class, new VectorizerSerde())
+ .registerTypeAdapter(IndexingStrategy.class, new IndexingStrategySerde())
+ .create();
+
+ @Override
+ public void write(JsonWriter out, Vectors value) throws IOException {
+ gson.toJson(value.asMap(), Map.class, out);
+ }
+
+ @Override
+ public Vectors read(JsonReader in) throws IOException {
+ Map> vectors = gson.fromJson(in,
+ new TypeToken