Skip to content

Commit 22bcf43

Browse files
committed
Allow list of QdrantGrpcClient
Signed-off-by: Anush008 <anushshetty90@gmail.com>
1 parent 3ef1fda commit 22bcf43

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/main/java/io/qdrant/client/QdrantClient.java

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,19 @@ public QdrantClient(String host, int port, boolean useTransportLayerSecurity) {
208208
this(host, port, useTransportLayerSecurity, 3);
209209
}
210210

211+
/**
212+
* Creates a new instance of {@link QdrantClient} with a custom list of gRPC clients for pooling.
213+
*
214+
* @param grpcClients The list of gRPC clients to use for pooling. Must not be null or empty.
215+
*/
216+
public QdrantClient(List<QdrantGrpcClient> grpcClients) {
217+
if (grpcClients == null || grpcClients.isEmpty()) {
218+
throw new IllegalArgumentException("gRPC clients list cannot be null or empty");
219+
}
220+
221+
this.grpcClients = new ArrayList<>(grpcClients);
222+
}
223+
211224
/**
212225
* Gets the low-level gRPC client. This is exposed to
213226
*
@@ -217,8 +230,7 @@ public QdrantClient(String host, int port, boolean useTransportLayerSecurity) {
217230
* where functionality may not yet be exposed by the higher level client.
218231
* </ul>
219232
*
220-
* @return The low-level gRPC client. If connection pooling is enabled, returns the next client in
221-
* round-robin fashion.
233+
* @return The low-level gRPC client in a round-robin fashion.
222234
*/
223235
public QdrantGrpcClient grpcClient() {
224236
if (grpcClients.size() == 1) {

0 commit comments

Comments
 (0)