瀏覽代碼

rename api

Signed-off-by: sahuang <xiaohai.xu@zilliz.com>
sahuang 5 年之前
父節點
當前提交
b7a8c1d697

+ 1 - 1
examples/src/main/java/MilvusClientExample.java

@@ -230,7 +230,7 @@ public class MilvusClientExample {
 
     // Try to get the corresponding vector of the first id you just deleted.
     List<GetVectorByIdResponse> getVectorByIdResponse =
-        client.getVectorsById(collectionName, vectorIds.subList(0, searchBatchSize));
+        client.getVectorsByIds(collectionName, vectorIds.subList(0, searchBatchSize));
     // Obviously you won't get anything
     if (getVectorByIdResponse.get(0).exists()) {
       throw new AssertionError("This can never happen!");

+ 1 - 1
src/main/java/io/milvus/client/GetVectorByIdResponse.java

@@ -6,7 +6,7 @@ import java.util.Optional;
 
 /**
  * Contains the returned <code>response</code> and either a <code>floatVector</code> or a <code>
- * binaryVector</code> for each vector of <code>getVectorsById</code>. If the id does not exist, both returned
+ * binaryVector</code> for each vector of <code>getVectorsByIds</code>. If the id does not exist, both returned
  * vectors will be empty.
  */
 public class GetVectorByIdResponse {

+ 1 - 1
src/main/java/io/milvus/client/MilvusClient.java

@@ -440,7 +440,7 @@ public interface MilvusClient {
    * @see GetVectorByIdResponse
    * @see Response
    */
-  List<GetVectorByIdResponse> getVectorsById(String collectionName, List<Long> ids);
+  List<GetVectorByIdResponse> getVectorsByIds(String collectionName, List<Long> ids);
 
   /**
    * Gets all vector ids in a segment

+ 4 - 4
src/main/java/io/milvus/client/MilvusGrpcClient.java

@@ -1108,7 +1108,7 @@ public class MilvusGrpcClient implements MilvusClient {
   }
 
   @Override
-  public List<GetVectorByIdResponse> getVectorsById(String collectionName, List<Long> ids) {
+  public List<GetVectorByIdResponse> getVectorsByIds(String collectionName, List<Long> ids) {
     List<GetVectorByIdResponse> res = new ArrayList<>();
     if (!channelIsReadyOrIdle()) {
       logWarning("You are not connected to Milvus server");
@@ -1127,7 +1127,7 @@ public class MilvusGrpcClient implements MilvusClient {
       if (response.getStatus().getErrorCode() == ErrorCode.SUCCESS) {
 
         logInfo(
-            "getVectorsById in collection `{0}` returned successfully!", collectionName);
+            "getVectorsByIds in collection `{0}` returned successfully!", collectionName);
 
         for (int i = 0; i < ids.size(); i++) {
           res.add(new GetVectorByIdResponse(
@@ -1139,7 +1139,7 @@ public class MilvusGrpcClient implements MilvusClient {
 
       } else {
         logSevere(
-            "getVectorsById in collection `{0}` failed:\n{1}",
+            "getVectorsByIds in collection `{0}` failed:\n{1}",
             collectionName, response.getStatus().toString());
         res.add(new GetVectorByIdResponse(
             new Response(
@@ -1150,7 +1150,7 @@ public class MilvusGrpcClient implements MilvusClient {
         return res;
       }
     } catch (StatusRuntimeException e) {
-      logSevere("getVectorsById RPC failed:\n{0}", e.getStatus().toString());
+      logSevere("getVectorsByIds RPC failed:\n{0}", e.getStatus().toString());
       res.add(new GetVectorByIdResponse(
           new Response(Response.Status.RPC_ERROR, e.toString()), new ArrayList<>(), null));
       return res;

+ 2 - 2
src/test/java/io/milvus/client/MilvusGrpcClientTest.java

@@ -630,7 +630,7 @@ class MilvusClientTest {
   }
 
   @org.junit.jupiter.api.Test
-  void getVectorsById() {
+  void getVectorsByIds() {
     List<List<Float>> vectors = generateFloatVectors(size, dimension);
     InsertParam insertParam =
         new InsertParam.Builder(randomCollectionName).withFloatVectors(vectors).build();
@@ -642,7 +642,7 @@ class MilvusClientTest {
     assertTrue(client.flush(randomCollectionName).ok());
 
     List<GetVectorByIdResponse> getVectorByIdResponse =
-        client.getVectorsById(randomCollectionName, vectorIds.subList(0, 100));
+        client.getVectorsByIds(randomCollectionName, vectorIds.subList(0, 100));
     assertTrue(getVectorByIdResponse.size() == 100);
     assertTrue(getVectorByIdResponse.get(0).ok());
     assertTrue(getVectorByIdResponse.get(0).exists());