|
@@ -20,20 +20,20 @@
|
|
|
package io.milvus.v2.client;
|
|
|
|
|
|
import io.grpc.ManagedChannel;
|
|
|
+import io.grpc.Status;
|
|
|
+import io.grpc.StatusRuntimeException;
|
|
|
import io.milvus.grpc.MilvusServiceGrpc;
|
|
|
import io.milvus.orm.iterator.QueryIterator;
|
|
|
import io.milvus.orm.iterator.SearchIterator;
|
|
|
+
|
|
|
+import io.milvus.v2.exception.ErrorCode;
|
|
|
+import io.milvus.v2.exception.MilvusClientException;
|
|
|
import io.milvus.v2.service.collection.CollectionService;
|
|
|
import io.milvus.v2.service.collection.request.*;
|
|
|
-import io.milvus.v2.service.collection.response.DescribeCollectionResp;
|
|
|
-import io.milvus.v2.service.collection.response.GetCollectionStatsResp;
|
|
|
-import io.milvus.v2.service.collection.response.ListCollectionsResp;
|
|
|
+import io.milvus.v2.service.collection.response.*;
|
|
|
import io.milvus.v2.service.index.IndexService;
|
|
|
-import io.milvus.v2.service.index.request.CreateIndexReq;
|
|
|
-import io.milvus.v2.service.index.request.DescribeIndexReq;
|
|
|
-import io.milvus.v2.service.index.request.DropIndexReq;
|
|
|
-import io.milvus.v2.service.index.request.ListIndexesReq;
|
|
|
-import io.milvus.v2.service.index.response.DescribeIndexResp;
|
|
|
+import io.milvus.v2.service.index.request.*;
|
|
|
+import io.milvus.v2.service.index.response.*;
|
|
|
import io.milvus.v2.service.partition.PartitionService;
|
|
|
import io.milvus.v2.service.partition.request.*;
|
|
|
import io.milvus.v2.service.rbac.RoleService;
|
|
@@ -55,6 +55,7 @@ import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
|
import java.util.List;
|
|
|
+import java.util.concurrent.Callable;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
public class MilvusClientV2 {
|
|
@@ -71,6 +72,7 @@ public class MilvusClientV2 {
|
|
|
private final RoleService roleService = new RoleService();
|
|
|
private final UtilityService utilityService = new UtilityService();
|
|
|
private ConnectConfig connectConfig;
|
|
|
+ private RetryConfig retryConfig = RetryConfig.builder().build();
|
|
|
|
|
|
/**
|
|
|
* Creates a Milvus client instance.
|
|
@@ -111,6 +113,116 @@ public class MilvusClientV2 {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public void retryConfig(RetryConfig retryConfig) {
|
|
|
+ this.retryConfig = retryConfig;
|
|
|
+ }
|
|
|
+
|
|
|
+ private <T> T retry(Callable<T> callable) {
|
|
|
+ int maxRetryTimes = retryConfig.getMaxRetryTimes();
|
|
|
+ // no retry, direct call the method
|
|
|
+ if (maxRetryTimes <= 1) {
|
|
|
+ try {
|
|
|
+ return callable.call();
|
|
|
+ } catch (StatusRuntimeException e) {
|
|
|
+ throw new MilvusClientException(ErrorCode.RPC_ERROR, e.getMessage()); // rpc error
|
|
|
+ } catch (MilvusClientException e) {
|
|
|
+ throw e; // server error or client error
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new MilvusClientException(ErrorCode.CLIENT_ERROR, e.getMessage()); // others error treated as client error
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // method to check timeout
|
|
|
+ long begin = System.currentTimeMillis();
|
|
|
+ long maxRetryTimeoutMs = retryConfig.getMaxRetryTimeoutMs();
|
|
|
+ Callable<Boolean> timeoutChecker = ()->{
|
|
|
+ long current = System.currentTimeMillis();
|
|
|
+ long cost = (current - begin);
|
|
|
+ if (maxRetryTimeoutMs > 0 && cost >= maxRetryTimeoutMs) {
|
|
|
+ return Boolean.TRUE;
|
|
|
+ }
|
|
|
+ return Boolean.FALSE;
|
|
|
+ };
|
|
|
+
|
|
|
+ // retry within timeout
|
|
|
+ long retryIntervalMs = retryConfig.getInitialBackOffMs();
|
|
|
+ for (int k = 1; k <= maxRetryTimes; k++) {
|
|
|
+ try {
|
|
|
+ return callable.call();
|
|
|
+ } catch (StatusRuntimeException e) {
|
|
|
+ Status.Code code = e.getStatus().getCode();
|
|
|
+ if (code == Status.DEADLINE_EXCEEDED.getCode()
|
|
|
+ || code == Status.PERMISSION_DENIED.getCode()
|
|
|
+ || code == Status.UNAUTHENTICATED.getCode()
|
|
|
+ || code == Status.INVALID_ARGUMENT.getCode()
|
|
|
+ || code == Status.ALREADY_EXISTS.getCode()
|
|
|
+ || code == Status.RESOURCE_EXHAUSTED.getCode()
|
|
|
+ || code == Status.UNIMPLEMENTED.getCode()) {
|
|
|
+ String msg = String.format("Encounter rpc error that cannot be retried, reason: %s", e.getMessage());
|
|
|
+ logger.error(msg);
|
|
|
+ throw new MilvusClientException(ErrorCode.RPC_ERROR, msg); // throw rpc error
|
|
|
+ }
|
|
|
+
|
|
|
+ try {
|
|
|
+ if (timeoutChecker.call() == Boolean.TRUE) {
|
|
|
+ String msg = String.format("Retry timeout: %dms, maxRetry:%d, retries: %d, reason: %s",
|
|
|
+ maxRetryTimeoutMs, maxRetryTimes, k, e.getMessage());
|
|
|
+ logger.warn(msg);
|
|
|
+ throw new MilvusClientException(ErrorCode.TIMEOUT, msg); // exit retry for timeout
|
|
|
+ }
|
|
|
+ } catch (Exception ignored) {
|
|
|
+ }
|
|
|
+ } catch (MilvusClientException e) {
|
|
|
+ try {
|
|
|
+ if (timeoutChecker.call() == Boolean.TRUE) {
|
|
|
+ String msg = String.format("Retry timeout: %dms, maxRetry:%d, retries: %d, reason: %s",
|
|
|
+ maxRetryTimeoutMs, maxRetryTimes, k, e.getMessage());
|
|
|
+ logger.warn(msg);
|
|
|
+ throw new MilvusClientException(ErrorCode.TIMEOUT, msg); // exit retry for timeout
|
|
|
+ }
|
|
|
+ } catch (Exception ignored) {
|
|
|
+ }
|
|
|
+
|
|
|
+ // for server-side returned error, only retry for rate limit
|
|
|
+ // in new error codes of v2.3, rate limit error value is 8
|
|
|
+ if (retryConfig.isRetryOnRateLimit() &&
|
|
|
+ (e.getLegacyServerCode() == io.milvus.grpc.ErrorCode.RateLimit.getNumber() ||
|
|
|
+ e.getServerErrCode() == 8)) {
|
|
|
+ // cannot be retried
|
|
|
+ } else {
|
|
|
+ throw e; // exit retry, throw the error
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new MilvusClientException(ErrorCode.CLIENT_ERROR, e.getMessage()); // others error treated as client error
|
|
|
+ }
|
|
|
+
|
|
|
+ try {
|
|
|
+ if (k >= maxRetryTimes) {
|
|
|
+ // finish retry loop, return the response of the last retry
|
|
|
+ String msg = String.format("Finish %d retry times, stop retry", maxRetryTimes);
|
|
|
+ logger.warn(msg);
|
|
|
+ throw new MilvusClientException(ErrorCode.TIMEOUT, msg); // exceed max time, exit retry
|
|
|
+ } else {
|
|
|
+ // sleep for interval
|
|
|
+ // print log, follow the pymilvus logic
|
|
|
+ if (k > 3) {
|
|
|
+ logger.warn(String.format("Retry(%d) with interval %dms", k, retryIntervalMs));
|
|
|
+ }
|
|
|
+ TimeUnit.MILLISECONDS.sleep(retryIntervalMs);
|
|
|
+ }
|
|
|
+
|
|
|
+ // reset the next interval value
|
|
|
+ retryIntervalMs = retryIntervalMs*retryConfig.getBackOffMultiplier();
|
|
|
+ if (retryIntervalMs > retryConfig.getMaxBackOffMs()) {
|
|
|
+ retryIntervalMs = retryConfig.getMaxBackOffMs();
|
|
|
+ }
|
|
|
+ } catch (Exception ignored) {
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* use Database
|
|
|
* @param dbName databaseName
|
|
@@ -133,7 +245,7 @@ public class MilvusClientV2 {
|
|
|
* @param request create collection request
|
|
|
*/
|
|
|
public void createCollection(CreateCollectionReq request) {
|
|
|
- collectionService.createCollection(this.blockingStub, request);
|
|
|
+ retry(()-> collectionService.createCollection(this.blockingStub, request));
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -150,7 +262,7 @@ public class MilvusClientV2 {
|
|
|
* @return List of String collection names
|
|
|
*/
|
|
|
public ListCollectionsResp listCollections() {
|
|
|
- return collectionService.listCollections(this.blockingStub);
|
|
|
+ return retry(()-> collectionService.listCollections(this.blockingStub));
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -159,7 +271,7 @@ public class MilvusClientV2 {
|
|
|
* @param request drop collection request
|
|
|
*/
|
|
|
public void dropCollection(DropCollectionReq request) {
|
|
|
- collectionService.dropCollection(this.blockingStub, request);
|
|
|
+ retry(()-> collectionService.dropCollection(this.blockingStub, request));
|
|
|
}
|
|
|
/**
|
|
|
* Checks whether a collection exists in Milvus.
|
|
@@ -168,7 +280,7 @@ public class MilvusClientV2 {
|
|
|
* @return Boolean
|
|
|
*/
|
|
|
public Boolean hasCollection(HasCollectionReq request) {
|
|
|
- return collectionService.hasCollection(this.blockingStub, request);
|
|
|
+ return retry(()-> collectionService.hasCollection(this.blockingStub, request));
|
|
|
}
|
|
|
/**
|
|
|
* Gets the collection info in Milvus.
|
|
@@ -177,7 +289,7 @@ public class MilvusClientV2 {
|
|
|
* @return DescribeCollectionResp
|
|
|
*/
|
|
|
public DescribeCollectionResp describeCollection(DescribeCollectionReq request) {
|
|
|
- return collectionService.describeCollection(this.blockingStub, request);
|
|
|
+ return retry(()-> collectionService.describeCollection(this.blockingStub, request));
|
|
|
}
|
|
|
/**
|
|
|
* get collection stats for a collection in Milvus.
|
|
@@ -186,7 +298,7 @@ public class MilvusClientV2 {
|
|
|
* @return GetCollectionStatsResp
|
|
|
*/
|
|
|
public GetCollectionStatsResp getCollectionStats(GetCollectionStatsReq request) {
|
|
|
- return collectionService.getCollectionStats(this.blockingStub, request);
|
|
|
+ return retry(()-> collectionService.getCollectionStats(this.blockingStub, request));
|
|
|
}
|
|
|
/**
|
|
|
* rename collection in a collection in Milvus.
|
|
@@ -194,7 +306,7 @@ public class MilvusClientV2 {
|
|
|
* @param request rename collection request
|
|
|
*/
|
|
|
public void renameCollection(RenameCollectionReq request) {
|
|
|
- collectionService.renameCollection(this.blockingStub, request);
|
|
|
+ retry(()-> collectionService.renameCollection(this.blockingStub, request));
|
|
|
}
|
|
|
/**
|
|
|
* Loads a collection into memory in Milvus.
|
|
@@ -202,7 +314,7 @@ public class MilvusClientV2 {
|
|
|
* @param request load collection request
|
|
|
*/
|
|
|
public void loadCollection(LoadCollectionReq request) {
|
|
|
- collectionService.loadCollection(this.blockingStub, request);
|
|
|
+ retry(()-> collectionService.loadCollection(this.blockingStub, request));
|
|
|
}
|
|
|
/**
|
|
|
* Releases a collection from memory in Milvus.
|
|
@@ -210,7 +322,7 @@ public class MilvusClientV2 {
|
|
|
* @param request release collection request
|
|
|
*/
|
|
|
public void releaseCollection(ReleaseCollectionReq request) {
|
|
|
- collectionService.releaseCollection(this.blockingStub, request);
|
|
|
+ retry(()-> collectionService.releaseCollection(this.blockingStub, request));
|
|
|
}
|
|
|
/**
|
|
|
* Checks whether a collection is loaded in Milvus.
|
|
@@ -219,7 +331,7 @@ public class MilvusClientV2 {
|
|
|
* @return Boolean
|
|
|
*/
|
|
|
public Boolean getLoadState(GetLoadStateReq request) {
|
|
|
- return collectionService.getLoadState(this.blockingStub, request);
|
|
|
+ return retry(()->collectionService.getLoadState(this.blockingStub, request));
|
|
|
}
|
|
|
|
|
|
//Index Operations
|
|
@@ -229,7 +341,7 @@ public class MilvusClientV2 {
|
|
|
* @param request create index request
|
|
|
*/
|
|
|
public void createIndex(CreateIndexReq request) {
|
|
|
- indexService.createIndex(this.blockingStub, request);
|
|
|
+ retry(()->indexService.createIndex(this.blockingStub, request));
|
|
|
}
|
|
|
/**
|
|
|
* Drops an index for a specified field in a collection in Milvus.
|
|
@@ -237,7 +349,7 @@ public class MilvusClientV2 {
|
|
|
* @param request drop index request
|
|
|
*/
|
|
|
public void dropIndex(DropIndexReq request) {
|
|
|
- indexService.dropIndex(this.blockingStub, request);
|
|
|
+ retry(()->indexService.dropIndex(this.blockingStub, request));
|
|
|
}
|
|
|
/**
|
|
|
* Checks whether an index exists for a specified field in a collection in Milvus.
|
|
@@ -246,7 +358,7 @@ public class MilvusClientV2 {
|
|
|
* @return DescribeIndexResp
|
|
|
*/
|
|
|
public DescribeIndexResp describeIndex(DescribeIndexReq request) {
|
|
|
- return indexService.describeIndex(this.blockingStub, request);
|
|
|
+ return retry(()->indexService.describeIndex(this.blockingStub, request));
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -256,7 +368,7 @@ public class MilvusClientV2 {
|
|
|
* @return List of String indexes names
|
|
|
*/
|
|
|
public List<String> listIndexes(ListIndexesReq request) {
|
|
|
- return indexService.listIndexes(this.blockingStub, request);
|
|
|
+ return retry(()->indexService.listIndexes(this.blockingStub, request));
|
|
|
}
|
|
|
// Vector Operations
|
|
|
|
|
@@ -267,7 +379,7 @@ public class MilvusClientV2 {
|
|
|
* @return InsertResp
|
|
|
*/
|
|
|
public InsertResp insert(InsertReq request) {
|
|
|
- return vectorService.insert(this.blockingStub, request);
|
|
|
+ return retry(()->vectorService.insert(this.blockingStub, request));
|
|
|
}
|
|
|
/**
|
|
|
* Upsert vectors into a collection in Milvus.
|
|
@@ -276,7 +388,7 @@ public class MilvusClientV2 {
|
|
|
* @return UpsertResp
|
|
|
*/
|
|
|
public UpsertResp upsert(UpsertReq request) {
|
|
|
- return vectorService.upsert(this.blockingStub, request);
|
|
|
+ return retry(()->vectorService.upsert(this.blockingStub, request));
|
|
|
}
|
|
|
/**
|
|
|
* Deletes vectors in a collection in Milvus.
|
|
@@ -285,7 +397,7 @@ public class MilvusClientV2 {
|
|
|
* @return DeleteResp
|
|
|
*/
|
|
|
public DeleteResp delete(DeleteReq request) {
|
|
|
- return vectorService.delete(this.blockingStub, request);
|
|
|
+ return retry(()->vectorService.delete(this.blockingStub, request));
|
|
|
}
|
|
|
/**
|
|
|
* Gets vectors in a collection in Milvus.
|
|
@@ -294,7 +406,7 @@ public class MilvusClientV2 {
|
|
|
* @return GetResp
|
|
|
*/
|
|
|
public GetResp get(GetReq request) {
|
|
|
- return vectorService.get(this.blockingStub, request);
|
|
|
+ return retry(()->vectorService.get(this.blockingStub, request));
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -304,7 +416,7 @@ public class MilvusClientV2 {
|
|
|
* @return QueryResp
|
|
|
*/
|
|
|
public QueryResp query(QueryReq request) {
|
|
|
- return vectorService.query(this.blockingStub, request);
|
|
|
+ return retry(()->vectorService.query(this.blockingStub, request));
|
|
|
}
|
|
|
/**
|
|
|
* Searches vectors in a collection in Milvus.
|
|
@@ -313,7 +425,7 @@ public class MilvusClientV2 {
|
|
|
* @return SearchResp
|
|
|
*/
|
|
|
public SearchResp search(SearchReq request) {
|
|
|
- return vectorService.search(this.blockingStub, request);
|
|
|
+ return retry(()->vectorService.search(this.blockingStub, request));
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -324,7 +436,7 @@ public class MilvusClientV2 {
|
|
|
* @return {status:result code,data: QueryIterator}
|
|
|
*/
|
|
|
public QueryIterator queryIterator(QueryIteratorReq request) {
|
|
|
- return vectorService.queryIterator(this.blockingStub, request);
|
|
|
+ return retry(()->vectorService.queryIterator(this.blockingStub, request));
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -334,7 +446,7 @@ public class MilvusClientV2 {
|
|
|
* @return {status:result code, data: SearchIterator}
|
|
|
*/
|
|
|
public SearchIterator searchIterator(SearchIteratorReq request) {
|
|
|
- return vectorService.searchIterator(this.blockingStub, request);
|
|
|
+ return retry(()->vectorService.searchIterator(this.blockingStub, request));
|
|
|
}
|
|
|
|
|
|
// Partition Operations
|
|
@@ -344,7 +456,7 @@ public class MilvusClientV2 {
|
|
|
* @param request create partition request
|
|
|
*/
|
|
|
public void createPartition(CreatePartitionReq request) {
|
|
|
- partitionService.createPartition(this.blockingStub, request);
|
|
|
+ retry(()->partitionService.createPartition(this.blockingStub, request));
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -353,7 +465,7 @@ public class MilvusClientV2 {
|
|
|
* @param request drop partition request
|
|
|
*/
|
|
|
public void dropPartition(DropPartitionReq request) {
|
|
|
- partitionService.dropPartition(this.blockingStub, request);
|
|
|
+ retry(()->partitionService.dropPartition(this.blockingStub, request));
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -363,7 +475,7 @@ public class MilvusClientV2 {
|
|
|
* @return Boolean
|
|
|
*/
|
|
|
public Boolean hasPartition(HasPartitionReq request) {
|
|
|
- return partitionService.hasPartition(this.blockingStub, request);
|
|
|
+ return retry(()->partitionService.hasPartition(this.blockingStub, request));
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -373,7 +485,7 @@ public class MilvusClientV2 {
|
|
|
* @return List of String partition names
|
|
|
*/
|
|
|
public List<String> listPartitions(ListPartitionsReq request) {
|
|
|
- return partitionService.listPartitions(this.blockingStub, request);
|
|
|
+ return retry(()->partitionService.listPartitions(this.blockingStub, request));
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -382,7 +494,7 @@ public class MilvusClientV2 {
|
|
|
* @param request load partitions request
|
|
|
*/
|
|
|
public void loadPartitions(LoadPartitionsReq request) {
|
|
|
- partitionService.loadPartitions(this.blockingStub, request);
|
|
|
+ retry(()->partitionService.loadPartitions(this.blockingStub, request));
|
|
|
}
|
|
|
/**
|
|
|
* Releases partitions in a collection in Milvus.
|
|
@@ -390,7 +502,7 @@ public class MilvusClientV2 {
|
|
|
* @param request release partitions request
|
|
|
*/
|
|
|
public void releasePartitions(ReleasePartitionsReq request) {
|
|
|
- partitionService.releasePartitions(this.blockingStub, request);
|
|
|
+ retry(()->partitionService.releasePartitions(this.blockingStub, request));
|
|
|
}
|
|
|
// rbac operations
|
|
|
// user operations
|
|
@@ -400,7 +512,7 @@ public class MilvusClientV2 {
|
|
|
* @return List of String usernames
|
|
|
*/
|
|
|
public List<String> listUsers() {
|
|
|
- return userService.listUsers(this.blockingStub);
|
|
|
+ return retry(()->userService.listUsers(this.blockingStub));
|
|
|
}
|
|
|
/**
|
|
|
* describe user
|
|
@@ -409,7 +521,7 @@ public class MilvusClientV2 {
|
|
|
* @return DescribeUserResp
|
|
|
*/
|
|
|
public DescribeUserResp describeUser(DescribeUserReq request) {
|
|
|
- return userService.describeUser(this.blockingStub, request);
|
|
|
+ return retry(()->userService.describeUser(this.blockingStub, request));
|
|
|
}
|
|
|
/**
|
|
|
* create user
|
|
@@ -417,7 +529,7 @@ public class MilvusClientV2 {
|
|
|
* @param request create user request
|
|
|
*/
|
|
|
public void createUser(CreateUserReq request) {
|
|
|
- userService.createUser(this.blockingStub, request);
|
|
|
+ retry(()->userService.createUser(this.blockingStub, request));
|
|
|
}
|
|
|
/**
|
|
|
* change password
|
|
@@ -425,7 +537,7 @@ public class MilvusClientV2 {
|
|
|
* @param request change password request
|
|
|
*/
|
|
|
public void updatePassword(UpdatePasswordReq request) {
|
|
|
- userService.updatePassword(this.blockingStub, request);
|
|
|
+ retry(()->userService.updatePassword(this.blockingStub, request));
|
|
|
}
|
|
|
/**
|
|
|
* drop user
|
|
@@ -433,7 +545,7 @@ public class MilvusClientV2 {
|
|
|
* @param request drop user request
|
|
|
*/
|
|
|
public void dropUser(DropUserReq request) {
|
|
|
- userService.dropUser(this.blockingStub, request);
|
|
|
+ retry(()->userService.dropUser(this.blockingStub, request));
|
|
|
}
|
|
|
// role operations
|
|
|
/**
|
|
@@ -442,7 +554,7 @@ public class MilvusClientV2 {
|
|
|
* @return List of String role names
|
|
|
*/
|
|
|
public List<String> listRoles() {
|
|
|
- return roleService.listRoles(this.blockingStub);
|
|
|
+ return retry(()->roleService.listRoles(this.blockingStub));
|
|
|
}
|
|
|
/**
|
|
|
* describe role
|
|
@@ -451,7 +563,7 @@ public class MilvusClientV2 {
|
|
|
* @return DescribeRoleResp
|
|
|
*/
|
|
|
public DescribeRoleResp describeRole(DescribeRoleReq request) {
|
|
|
- return roleService.describeRole(this.blockingStub, request);
|
|
|
+ return retry(()->roleService.describeRole(this.blockingStub, request));
|
|
|
}
|
|
|
/**
|
|
|
* create role
|
|
@@ -459,7 +571,7 @@ public class MilvusClientV2 {
|
|
|
* @param request create role request
|
|
|
*/
|
|
|
public void createRole(CreateRoleReq request) {
|
|
|
- roleService.createRole(this.blockingStub, request);
|
|
|
+ retry(()->roleService.createRole(this.blockingStub, request));
|
|
|
}
|
|
|
/**
|
|
|
* drop role
|
|
@@ -467,7 +579,7 @@ public class MilvusClientV2 {
|
|
|
* @param request drop role request
|
|
|
*/
|
|
|
public void dropRole(DropRoleReq request) {
|
|
|
- roleService.dropRole(this.blockingStub, request);
|
|
|
+ retry(()->roleService.dropRole(this.blockingStub, request));
|
|
|
}
|
|
|
/**
|
|
|
* grant privilege
|
|
@@ -475,7 +587,7 @@ public class MilvusClientV2 {
|
|
|
* @param request grant privilege request
|
|
|
*/
|
|
|
public void grantPrivilege(GrantPrivilegeReq request) {
|
|
|
- roleService.grantPrivilege(this.blockingStub, request);
|
|
|
+ retry(()->roleService.grantPrivilege(this.blockingStub, request));
|
|
|
}
|
|
|
/**
|
|
|
* revoke privilege
|
|
@@ -483,7 +595,7 @@ public class MilvusClientV2 {
|
|
|
* @param request revoke privilege request
|
|
|
*/
|
|
|
public void revokePrivilege(RevokePrivilegeReq request) {
|
|
|
- roleService.revokePrivilege(this.blockingStub, request);
|
|
|
+ retry(()->roleService.revokePrivilege(this.blockingStub, request));
|
|
|
}
|
|
|
/**
|
|
|
* grant role
|
|
@@ -491,7 +603,7 @@ public class MilvusClientV2 {
|
|
|
* @param request grant role request
|
|
|
*/
|
|
|
public void grantRole(GrantRoleReq request) {
|
|
|
- roleService.grantRole(this.blockingStub, request);
|
|
|
+ retry(()->roleService.grantRole(this.blockingStub, request));
|
|
|
}
|
|
|
/**
|
|
|
* revoke role
|
|
@@ -499,7 +611,7 @@ public class MilvusClientV2 {
|
|
|
* @param request revoke role request
|
|
|
*/
|
|
|
public void revokeRole(RevokeRoleReq request) {
|
|
|
- roleService.revokeRole(this.blockingStub, request);
|
|
|
+ retry(()->roleService.revokeRole(this.blockingStub, request));
|
|
|
}
|
|
|
|
|
|
// Utility Operations
|
|
@@ -510,7 +622,7 @@ public class MilvusClientV2 {
|
|
|
* @param request create alias request
|
|
|
*/
|
|
|
public void createAlias(CreateAliasReq request) {
|
|
|
- utilityService.createAlias(this.blockingStub, request);
|
|
|
+ retry(()->utilityService.createAlias(this.blockingStub, request));
|
|
|
}
|
|
|
/**
|
|
|
* drop aliases
|
|
@@ -518,7 +630,7 @@ public class MilvusClientV2 {
|
|
|
* @param request drop alias request
|
|
|
*/
|
|
|
public void dropAlias(DropAliasReq request) {
|
|
|
- utilityService.dropAlias(this.blockingStub, request);
|
|
|
+ retry(()->utilityService.dropAlias(this.blockingStub, request));
|
|
|
}
|
|
|
/**
|
|
|
* alter aliases
|
|
@@ -526,7 +638,7 @@ public class MilvusClientV2 {
|
|
|
* @param request alter alias request
|
|
|
*/
|
|
|
public void alterAlias(AlterAliasReq request) {
|
|
|
- utilityService.alterAlias(this.blockingStub, request);
|
|
|
+ retry(()->utilityService.alterAlias(this.blockingStub, request));
|
|
|
}
|
|
|
/**
|
|
|
* list aliases
|
|
@@ -535,7 +647,7 @@ public class MilvusClientV2 {
|
|
|
* @return List of String aliases names
|
|
|
*/
|
|
|
public ListAliasResp listAliases(ListAliasesReq request) {
|
|
|
- return utilityService.listAliases(this.blockingStub, request);
|
|
|
+ return retry(()->utilityService.listAliases(this.blockingStub, request));
|
|
|
}
|
|
|
/**
|
|
|
* describe aliases
|
|
@@ -544,7 +656,7 @@ public class MilvusClientV2 {
|
|
|
* @return DescribeAliasResp
|
|
|
*/
|
|
|
public DescribeAliasResp describeAlias(DescribeAliasReq request) {
|
|
|
- return utilityService.describeAlias(this.blockingStub, request);
|
|
|
+ return retry(()->utilityService.describeAlias(this.blockingStub, request));
|
|
|
}
|
|
|
|
|
|
/**
|