Quellcode durchsuchen

Breaking change: Rename Stage to Volume

Signed-off-by: lentitude2tk <xushuang.hu@zilliz.com>
lentitude2tk vor 2 Monaten
Ursprung
Commit
47a989eb66
25 geänderte Dateien mit 626 neuen und 636 gelöschten Zeilen
  1. 0 77
      examples/src/main/java/io/milvus/v2/StageManagerExample.java
  2. 11 14
      examples/src/main/java/io/milvus/v2/VolumeFileManagerExample.java
  3. 74 0
      examples/src/main/java/io/milvus/v2/VolumeManagerExample.java
  4. 27 31
      examples/src/main/java/io/milvus/v2/bulkwriter/BulkWriterVolumeExample.java
  5. 0 59
      sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/StageManager.java
  6. 16 16
      sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/VolumeBulkWriter.java
  7. 17 17
      sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/VolumeBulkWriterParam.java
  8. 53 53
      sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/VolumeFileManager.java
  9. 18 18
      sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/VolumeFileManagerParam.java
  10. 59 0
      sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/VolumeManager.java
  11. 9 9
      sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/VolumeManagerParam.java
  12. 13 13
      sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/model/UploadFilesResult.java
  13. 31 31
      sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/request/import_/VolumeImportRequest.java
  14. 0 71
      sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/request/stage/DeleteStageRequest.java
  15. 25 25
      sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/request/volume/ApplyVolumeRequest.java
  16. 12 12
      sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/request/volume/BaseVolumeRequest.java
  17. 26 26
      sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/request/volume/CreateVolumeRequest.java
  18. 71 0
      sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/request/volume/DeleteVolumeRequest.java
  19. 15 15
      sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/request/volume/ListVolumesRequest.java
  20. 15 15
      sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/request/volume/UploadFilesRequest.java
  21. 43 43
      sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/response/ApplyVolumeResponse.java
  22. 0 52
      sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/response/stage/StageInfo.java
  23. 26 26
      sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/response/volume/ListVolumesResponse.java
  24. 52 0
      sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/response/volume/VolumeInfo.java
  25. 13 13
      sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/restful/DataVolumeUtils.java

+ 0 - 77
examples/src/main/java/io/milvus/v2/StageManagerExample.java

@@ -1,77 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package io.milvus.v2;
-
-import com.google.gson.Gson;
-import io.milvus.bulkwriter.StageManager;
-import io.milvus.bulkwriter.StageManagerParam;
-import io.milvus.bulkwriter.request.stage.CreateStageRequest;
-import io.milvus.bulkwriter.request.stage.DeleteStageRequest;
-import io.milvus.bulkwriter.request.stage.ListStagesRequest;
-import io.milvus.bulkwriter.response.stage.ListStagesResponse;
-
-
-/**
- * This is currently a private preview feature. If you need to use it, please submit a request and contact us.
- */
-public class StageManagerExample {
-    private static final StageManager stageManager;
-
-    static {
-        StageManagerParam stageManagerParam = StageManagerParam.newBuilder()
-                .withCloudEndpoint("https://api.cloud.zilliz.com")
-                .withApiKey("_api_key_for_cluster_org_")
-                .build();
-        stageManager = new StageManager(stageManagerParam);
-    }
-
-    private static final String PROJECT_ID = "_id_for_project_";
-    private static final String REGION_ID = "_id_for_region_";
-    private static final String STAGE_NAME = "_stage_name_for_project_";
-
-    public static void main(String[] args) throws Exception {
-        createStage();
-        listStages();
-        deleteStage();
-    }
-
-    private static void createStage() {
-        CreateStageRequest request = CreateStageRequest.builder()
-                .projectId(PROJECT_ID).regionId(REGION_ID).stageName(STAGE_NAME)
-                .build();
-        stageManager.createStage(request);
-        System.out.printf("\nStage %s created%n", STAGE_NAME);
-    }
-
-    private static void listStages() {
-        ListStagesRequest request = ListStagesRequest.builder()
-                .projectId(PROJECT_ID).currentPage(1).pageSize(10)
-                .build();
-        ListStagesResponse listStagesResponse = stageManager.listStages(request);
-        System.out.println("\nlistStages results: " + new Gson().toJson(listStagesResponse));
-    }
-
-    private static void deleteStage() {
-        DeleteStageRequest request = DeleteStageRequest.builder()
-                .stageName(STAGE_NAME)
-                .build();
-        stageManager.deleteStage(request);
-        System.out.printf("\nStage %s deleted%n", STAGE_NAME);
-    }
-}

+ 11 - 14
examples/src/main/java/io/milvus/v2/StageFileManagerExample.java → examples/src/main/java/io/milvus/v2/VolumeFileManagerExample.java

@@ -19,27 +19,24 @@
 package io.milvus.v2;
 
 import com.google.gson.Gson;
-import io.milvus.bulkwriter.StageFileManager;
-import io.milvus.bulkwriter.StageFileManagerParam;
+import io.milvus.bulkwriter.VolumeFileManager;
+import io.milvus.bulkwriter.VolumeFileManagerParam;
 import io.milvus.bulkwriter.common.clientenum.ConnectType;
 import io.milvus.bulkwriter.model.UploadFilesResult;
-import io.milvus.bulkwriter.request.stage.UploadFilesRequest;
+import io.milvus.bulkwriter.request.volume.UploadFilesRequest;
 
 
-/**
- * This is currently a private preview feature. If you need to use it, please submit a request and contact us.
- */
-public class StageFileManagerExample {
-    private static final StageFileManager stageFileManager;
+public class VolumeFileManagerExample {
+    private static final VolumeFileManager volumeFileManager;
 
     static {
-        StageFileManagerParam stageFileManagerParam = StageFileManagerParam.newBuilder()
+        VolumeFileManagerParam volumeFileManagerParam = VolumeFileManagerParam.newBuilder()
                 .withCloudEndpoint("https://api.cloud.zilliz.com")
                 .withApiKey("_api_key_for_cluster_org_")
-                .withStageName("_stage_name_for_project_")
+                .withVolumeName("_volume_name_for_project_")
                 .withConnectType(ConnectType.AUTO)
                 .build();
-        stageFileManager = new StageFileManager(stageFileManagerParam);
+        volumeFileManager = new VolumeFileManager(volumeFileManagerParam);
     }
 
     public static void main(String[] args) throws Exception {
@@ -50,13 +47,13 @@ public class StageFileManagerExample {
     private static void uploadFiles() throws Exception {
         UploadFilesRequest request = UploadFilesRequest.builder()
                 .sourceFilePath("/Users/zilliz/data/")
-                .targetStagePath("data/")
+                .targetVolumePath("data/")
                 .build();
-        UploadFilesResult result = stageFileManager.uploadFilesAsync(request).get();
+        UploadFilesResult result = volumeFileManager.uploadFilesAsync(request).get();
         System.out.println("\nuploadFiles results: " + new Gson().toJson(result));
     }
 
     private static void shutdown() {
-        stageFileManager.shutdownGracefully();
+        volumeFileManager.shutdownGracefully();
     }
 }

+ 74 - 0
examples/src/main/java/io/milvus/v2/VolumeManagerExample.java

@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package io.milvus.v2;
+
+import com.google.gson.Gson;
+import io.milvus.bulkwriter.VolumeManager;
+import io.milvus.bulkwriter.VolumeManagerParam;
+import io.milvus.bulkwriter.request.volume.CreateVolumeRequest;
+import io.milvus.bulkwriter.request.volume.DeleteVolumeRequest;
+import io.milvus.bulkwriter.request.volume.ListVolumesRequest;
+import io.milvus.bulkwriter.response.volume.ListVolumesResponse;
+
+
+public class VolumeManagerExample {
+    private static final VolumeManager volumeManager;
+
+    static {
+        VolumeManagerParam volumeManagerParam = VolumeManagerParam.newBuilder()
+                .withCloudEndpoint("https://api.cloud.zilliz.com")
+                .withApiKey("_api_key_for_cluster_org_")
+                .build();
+        volumeManager = new VolumeManager(volumeManagerParam);
+    }
+
+    private static final String PROJECT_ID = "_id_for_project_";
+    private static final String REGION_ID = "_id_for_region_";
+    private static final String VOLUME_NAME = "_volume_name_for_project_";
+
+    public static void main(String[] args) throws Exception {
+        createVolume();
+        listVolumes();
+        deleteVolume();
+    }
+
+    private static void createVolume() {
+        CreateVolumeRequest request = CreateVolumeRequest.builder()
+                .projectId(PROJECT_ID).regionId(REGION_ID).volumeName(VOLUME_NAME)
+                .build();
+        volumeManager.createVolume(request);
+        System.out.printf("\nVolume %s created%n", VOLUME_NAME);
+    }
+
+    private static void listVolumes() {
+        ListVolumesRequest request = ListVolumesRequest.builder()
+                .projectId(PROJECT_ID).currentPage(1).pageSize(10)
+                .build();
+        ListVolumesResponse response = volumeManager.listVolumes(request);
+        System.out.println("\nlistVolumes results: " + new Gson().toJson(response));
+    }
+
+    private static void deleteVolume() {
+        DeleteVolumeRequest request = DeleteVolumeRequest.builder()
+                .volumeName(VOLUME_NAME)
+                .build();
+        volumeManager.deleteVolume(request);
+        System.out.printf("\nVolume %s deleted%n", VOLUME_NAME);
+    }
+}

+ 27 - 31
examples/src/main/java/io/milvus/v2/bulkwriter/BulkWriterStageExample.java → examples/src/main/java/io/milvus/v2/bulkwriter/BulkWriterVolumeExample.java

@@ -23,13 +23,13 @@ import com.google.gson.Gson;
 import com.google.gson.JsonElement;
 import com.google.gson.JsonNull;
 import com.google.gson.JsonObject;
-import io.milvus.bulkwriter.StageBulkWriter;
-import io.milvus.bulkwriter.StageBulkWriterParam;
+import io.milvus.bulkwriter.VolumeBulkWriter;
+import io.milvus.bulkwriter.VolumeBulkWriterParam;
 import io.milvus.bulkwriter.common.clientenum.BulkFileType;
 import io.milvus.bulkwriter.common.utils.GeneratorUtils;
 import io.milvus.bulkwriter.model.UploadFilesResult;
 import io.milvus.bulkwriter.request.describe.CloudDescribeImportRequest;
-import io.milvus.bulkwriter.request.import_.StageImportRequest;
+import io.milvus.bulkwriter.request.import_.VolumeImportRequest;
 import io.milvus.bulkwriter.request.list.CloudListImportJobsRequest;
 import io.milvus.bulkwriter.restful.BulkImportUtils;
 import io.milvus.v1.CommonUtils;
@@ -49,7 +49,7 @@ import java.util.*;
 import java.util.concurrent.TimeUnit;
 
 
-public class BulkWriterStageExample {
+public class BulkWriterVolumeExample {
     private static final Gson GSON_INSTANCE = new Gson();
 
     // milvus
@@ -66,11 +66,7 @@ public class BulkWriterStageExample {
     public static final String CLOUD_ENDPOINT = "https://api.cloud.zilliz.com";
     public static final String API_KEY = "_api_key_for_cluster_org_";
 
-
-    /**
-     * This is currently a private preview feature. If you need to use it, please submit a request and contact us.
-     */
-    public static final String STAGE_NAME = "_stage_name_for_project_";
+    public static final String VOLUME_NAME = "_volume_name_for_project_";
 
     public static final String CLUSTER_ID = "_your_cloud_cluster_id_";
     // If db_name is not specified, use ""
@@ -85,7 +81,7 @@ public class BulkWriterStageExample {
 
     public static void main(String[] args) throws Exception {
         createConnection();
-        exampleCollectionRemoteStage(BulkFileType.PARQUET);
+        exampleCollectionRemoteVolume(BulkFileType.PARQUET);
     }
 
     private static void createConnection() {
@@ -99,7 +95,7 @@ public class BulkWriterStageExample {
         System.out.println("\nConnected");
     }
 
-    private static void exampleCollectionRemoteStage(BulkFileType fileType) throws Exception {
+    private static void exampleCollectionRemoteVolume(BulkFileType fileType) throws Exception {
         List<Map<String, Object>> originalData = genOriginalData(5);
         List<JsonObject> rows = genImportData(originalData, true);
 
@@ -108,19 +104,19 @@ public class BulkWriterStageExample {
         CreateCollectionReq.CollectionSchema collectionSchema = buildAllTypesSchema();
         createCollection(COLLECTION_NAME, collectionSchema, false);
 
-        UploadFilesResult stageUploadResult = stageRemoteWriter(collectionSchema, fileType, rows);
-        callStageImport(stageUploadResult.getStageName(), stageUploadResult.getPath());
+        UploadFilesResult uploadFilesResult = volumeRemoteWriter(collectionSchema, fileType, rows);
+        callVolumeImport(uploadFilesResult.getVolumeName(), uploadFilesResult.getPath());
         verifyImportData(collectionSchema, originalData);
     }
 
-    private static void callStageImport(String stageName, String path) throws InterruptedException {
+    private static void callVolumeImport(String volumeName, String path) throws InterruptedException {
         List<String> importDataPath = Lists.newArrayList(path);
-        StageImportRequest stageImportRequest = StageImportRequest.builder()
+        VolumeImportRequest volumeImportRequest = VolumeImportRequest.builder()
                 .apiKey(API_KEY)
-                .stageName(stageName).dataPaths(Lists.newArrayList(Collections.singleton(importDataPath)))
+                .volumeName(volumeName).dataPaths(Lists.newArrayList(Collections.singleton(importDataPath)))
                 .clusterId(CLUSTER_ID).dbName(DB_NAME).collectionName(COLLECTION_NAME).partitionName(PARTITION_NAME)
                 .build();
-        String bulkImportResult = BulkImportUtils.bulkImport(CLOUD_ENDPOINT, stageImportRequest);
+        String bulkImportResult = BulkImportUtils.bulkImport(CLOUD_ENDPOINT, volumeImportRequest);
         System.out.println(bulkImportResult);
 
         JsonObject bulkImportObject = convertJsonObject(bulkImportResult);
@@ -274,30 +270,30 @@ public class BulkWriterStageExample {
         return data;
     }
 
-    private static UploadFilesResult stageRemoteWriter(CreateCollectionReq.CollectionSchema collectionSchema,
-                                                       BulkFileType fileType,
-                                                       List<JsonObject> data) throws Exception {
+    private static UploadFilesResult volumeRemoteWriter(CreateCollectionReq.CollectionSchema collectionSchema,
+                                                        BulkFileType fileType,
+                                                        List<JsonObject> data) throws Exception {
         System.out.printf("\n===================== all field types (%s) ====================%n", fileType.name());
 
-        try (StageBulkWriter stageBulkWriter = buildStageBulkWriter(collectionSchema, fileType)) {
+        try (VolumeBulkWriter volumeBulkWriter = buildVolumeBulkWriter(collectionSchema, fileType)) {
             for (JsonObject rowObject : data) {
-                stageBulkWriter.appendRow(rowObject);
+                volumeBulkWriter.appendRow(rowObject);
             }
-            System.out.printf("%s rows appends%n", stageBulkWriter.getTotalRowCount());
+            System.out.printf("%s rows appends%n", volumeBulkWriter.getTotalRowCount());
             System.out.println("Generate data files...");
-            stageBulkWriter.commit(false);
+            volumeBulkWriter.commit(false);
 
-            UploadFilesResult stageUploadResult = stageBulkWriter.getStageUploadResult();
-            System.out.printf("Data files have been uploaded: %s%n", stageUploadResult);
-            return stageUploadResult;
+            UploadFilesResult uploadResult = volumeBulkWriter.getVolumeUploadResult();
+            System.out.printf("Data files have been uploaded: %s%n", uploadResult);
+            return uploadResult;
         } catch (Exception e) {
             System.out.println("allTypesRemoteWriter catch exception: " + e);
             throw e;
         }
     }
 
-    private static StageBulkWriter buildStageBulkWriter(CreateCollectionReq.CollectionSchema collectionSchema, BulkFileType fileType) throws IOException {
-        StageBulkWriterParam bulkWriterParam = StageBulkWriterParam.newBuilder()
+    private static VolumeBulkWriter buildVolumeBulkWriter(CreateCollectionReq.CollectionSchema collectionSchema, BulkFileType fileType) throws IOException {
+        VolumeBulkWriterParam bulkWriterParam = VolumeBulkWriterParam.newBuilder()
                 .withCollectionSchema(collectionSchema)
                 .withRemotePath("bulk_data")
                 .withFileType(fileType)
@@ -305,9 +301,9 @@ public class BulkWriterStageExample {
                 .withConfig("sep", "|") // only take effect for CSV file
                 .withCloudEndpoint(CLOUD_ENDPOINT)
                 .withApiKey(API_KEY)
-                .withStageName(STAGE_NAME)
+                .withVolumeName(VOLUME_NAME)
                 .build();
-        return new StageBulkWriter(bulkWriterParam);
+        return new VolumeBulkWriter(bulkWriterParam);
     }
 
     /**

+ 0 - 59
sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/StageManager.java

@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package io.milvus.bulkwriter;
-
-import com.google.gson.Gson;
-import io.milvus.bulkwriter.request.stage.CreateStageRequest;
-import io.milvus.bulkwriter.request.stage.DeleteStageRequest;
-import io.milvus.bulkwriter.request.stage.ListStagesRequest;
-import io.milvus.bulkwriter.response.stage.ListStagesResponse;
-import io.milvus.bulkwriter.restful.DataStageUtils;
-
-public class StageManager {
-    private final String cloudEndpoint;
-    private final String apiKey;
-
-    public StageManager(StageManagerParam stageWriterParam) {
-        cloudEndpoint = stageWriterParam.getCloudEndpoint();
-        apiKey = stageWriterParam.getApiKey();
-    }
-
-    /**
-     * Create a stage under the specified project and regionId.
-     */
-    public void createStage(CreateStageRequest request) {
-        DataStageUtils.createStage(cloudEndpoint, apiKey, request);
-    }
-
-    /**
-     * Delete a stage.
-     */
-    public void deleteStage(DeleteStageRequest request) {
-        DataStageUtils.deleteStage(cloudEndpoint, apiKey, request);
-    }
-
-    /**
-     * Paginated query of the stage list under a specified projectId.
-     */
-    public ListStagesResponse listStages(ListStagesRequest request) {
-        String result = DataStageUtils.listStages(cloudEndpoint, apiKey, request);
-        return new Gson().fromJson(result, ListStagesResponse.class);
-    }
-}

+ 16 - 16
sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/StageBulkWriter.java → sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/VolumeBulkWriter.java

@@ -23,7 +23,7 @@ import com.google.common.collect.Lists;
 import com.google.gson.JsonObject;
 import io.milvus.bulkwriter.common.clientenum.ConnectType;
 import io.milvus.bulkwriter.model.UploadFilesResult;
-import io.milvus.bulkwriter.request.stage.UploadFilesRequest;
+import io.milvus.bulkwriter.request.volume.UploadFilesRequest;
 import io.milvus.common.utils.ExceptionUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -36,15 +36,15 @@ import java.nio.file.Paths;
 import java.util.ArrayList;
 import java.util.List;
 
-public class StageBulkWriter extends LocalBulkWriter {
-    private static final Logger logger = LoggerFactory.getLogger(StageBulkWriter.class);
+public class VolumeBulkWriter extends LocalBulkWriter {
+    private static final Logger logger = LoggerFactory.getLogger(VolumeBulkWriter.class);
 
     private final String remotePath;
     private final List<List<String>> remoteFiles;
-    private final StageFileManager stageFileManager;
-    private final StageBulkWriterParam stageBulkWriterParam;
+    private final VolumeFileManager volumeFileManager;
+    private final VolumeBulkWriterParam volumeBulkWriterParam;
 
-    public StageBulkWriter(StageBulkWriterParam bulkWriterParam) throws IOException {
+    public VolumeBulkWriter(VolumeBulkWriterParam bulkWriterParam) throws IOException {
         super(bulkWriterParam.getCollectionSchema(),
                 bulkWriterParam.getChunkSize(),
                 bulkWriterParam.getFileType(),
@@ -53,20 +53,20 @@ public class StageBulkWriter extends LocalBulkWriter {
         Path path = Paths.get(bulkWriterParam.getRemotePath());
         Path remoteDirPath = path.resolve(getUUID());
         this.remotePath = remoteDirPath + "/";
-        this.stageFileManager = initStageFileManagerParams(bulkWriterParam);
-        this.stageBulkWriterParam = bulkWriterParam;
+        this.volumeFileManager = initVolumeFileManagerParams(bulkWriterParam);
+        this.volumeBulkWriterParam = bulkWriterParam;
 
         this.remoteFiles = Lists.newArrayList();
         logger.info("Remote buffer writer initialized, target path: {}", remotePath);
 
     }
 
-    private StageFileManager initStageFileManagerParams(StageBulkWriterParam bulkWriterParam) throws IOException {
-        StageFileManagerParam stageFileManagerParam = StageFileManagerParam.newBuilder()
+    private VolumeFileManager initVolumeFileManagerParams(VolumeBulkWriterParam bulkWriterParam) throws IOException {
+        VolumeFileManagerParam volumeFileManagerParam = VolumeFileManagerParam.newBuilder()
                 .withCloudEndpoint(bulkWriterParam.getCloudEndpoint()).withApiKey(bulkWriterParam.getApiKey())
-                .withStageName(bulkWriterParam.getStageName()).withConnectType(ConnectType.AUTO)
+                .withVolumeName(bulkWriterParam.getVolumeName()).withConnectType(ConnectType.AUTO)
                 .build();
-        return new StageFileManager(stageFileManagerParam);
+        return new VolumeFileManager(volumeFileManagerParam);
     }
 
     @Override
@@ -89,9 +89,9 @@ public class StageBulkWriter extends LocalBulkWriter {
         return remoteFiles;
     }
 
-    public UploadFilesResult getStageUploadResult() {
+    public UploadFilesResult getVolumeUploadResult() {
         return UploadFilesResult.builder()
-                .stageName(stageBulkWriterParam.getStageName())
+                .volumeName(volumeBulkWriterParam.getVolumeName())
                 .path(remotePath)
                 .build();
     }
@@ -178,10 +178,10 @@ public class StageBulkWriter extends LocalBulkWriter {
         logger.info(String.format("Prepare to upload %s to %s", filePath, objectName));
 
         UploadFilesRequest uploadFilesRequest = UploadFilesRequest.builder()
-                .sourceFilePath(filePath).targetStagePath(remotePath)
+                .sourceFilePath(filePath).targetVolumePath(remotePath)
                 .build();
 
-        stageFileManager.uploadFilesAsync(uploadFilesRequest).get();
+        volumeFileManager.uploadFilesAsync(uploadFilesRequest).get();
         logger.info(String.format("Upload file %s to %s", filePath, objectName));
 
     }

+ 17 - 17
sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/StageBulkWriterParam.java → sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/VolumeBulkWriterParam.java

@@ -30,9 +30,9 @@ import java.util.HashMap;
 import java.util.Map;
 
 /**
- * Parameters for <code>stageBulkWriter</code> interface.
+ * Parameters for <code>volumeBulkWriter</code> interface.
  */
-public class StageBulkWriterParam {
+public class VolumeBulkWriterParam {
     private final CreateCollectionReq.CollectionSchema collectionSchema;
     private final String remotePath;
     private final long chunkSize;
@@ -41,9 +41,9 @@ public class StageBulkWriterParam {
 
     private final String cloudEndpoint;
     private final String apiKey;
-    private final String stageName;
+    private final String volumeName;
 
-    private StageBulkWriterParam(Builder builder) {
+    private VolumeBulkWriterParam(Builder builder) {
         this.collectionSchema = builder.collectionSchema;
         this.remotePath = builder.remotePath;
         this.chunkSize = builder.chunkSize;
@@ -52,7 +52,7 @@ public class StageBulkWriterParam {
 
         this.cloudEndpoint = builder.cloudEndpoint;
         this.apiKey = builder.apiKey;
-        this.stageName = builder.stageName;
+        this.volumeName = builder.volumeName;
     }
 
     public CreateCollectionReq.CollectionSchema getCollectionSchema() {
@@ -83,19 +83,19 @@ public class StageBulkWriterParam {
         return apiKey;
     }
 
-    public String getStageName() {
-        return stageName;
+    public String getVolumeName() {
+        return volumeName;
     }
 
     @Override
     public String toString() {
-        return "StageBulkWriterParam{" +
+        return "VolumeBulkWriterParam{" +
                 "collectionSchema=" + collectionSchema +
                 ", remotePath='" + remotePath + '\'' +
                 ", chunkSize=" + chunkSize +
                 ", fileType=" + fileType +
                 ", cloudEndpoint='" + cloudEndpoint + '\'' +
-                ", stageName='" + stageName + '\'' +
+                ", volumeName='" + volumeName + '\'' +
                 '}';
     }
 
@@ -104,7 +104,7 @@ public class StageBulkWriterParam {
     }
 
     /**
-     * Builder for {@link StageBulkWriterParam} class.
+     * Builder for {@link VolumeBulkWriterParam} class.
      */
     public static final class Builder {
         private CreateCollectionReq.CollectionSchema collectionSchema;
@@ -116,7 +116,7 @@ public class StageBulkWriterParam {
         private String cloudEndpoint;
         private String apiKey;
 
-        private String stageName;
+        private String volumeName;
 
         private Builder() {
         }
@@ -179,24 +179,24 @@ public class StageBulkWriterParam {
             return this;
         }
 
-        public Builder withStageName(String stageName) {
-            this.stageName = stageName;
+        public Builder withVolumeName(String volumeName) {
+            this.volumeName = volumeName;
             return this;
         }
 
         /**
-         * Verifies parameters and creates a new {@link StageBulkWriterParam} instance.
+         * Verifies parameters and creates a new {@link VolumeBulkWriterParam} instance.
          *
-         * @return {@link StageBulkWriterParam}
+         * @return {@link VolumeBulkWriterParam}
          */
-        public StageBulkWriterParam build() throws ParamException {
+        public VolumeBulkWriterParam build() throws ParamException {
             ParamUtils.CheckNullEmptyString(remotePath, "localPath");
 
             if (collectionSchema == null) {
                 throw new ParamException("collectionSchema cannot be null");
             }
 
-            return new StageBulkWriterParam(this);
+            return new VolumeBulkWriterParam(this);
         }
     }
 

+ 53 - 53
sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/StageFileManager.java → sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/VolumeFileManager.java

@@ -23,11 +23,11 @@ import com.google.gson.Gson;
 import io.milvus.bulkwriter.common.clientenum.ConnectType;
 import io.milvus.bulkwriter.common.utils.FileUtils;
 import io.milvus.bulkwriter.model.UploadFilesResult;
-import io.milvus.bulkwriter.request.stage.ApplyStageRequest;
-import io.milvus.bulkwriter.request.stage.UploadFilesRequest;
+import io.milvus.bulkwriter.request.volume.ApplyVolumeRequest;
+import io.milvus.bulkwriter.request.volume.UploadFilesRequest;
 import io.milvus.bulkwriter.resolver.EndpointResolver;
-import io.milvus.bulkwriter.response.ApplyStageResponse;
-import io.milvus.bulkwriter.restful.DataStageUtils;
+import io.milvus.bulkwriter.response.ApplyVolumeResponse;
+import io.milvus.bulkwriter.restful.DataVolumeUtils;
 import io.milvus.bulkwriter.storage.StorageClient;
 import io.milvus.bulkwriter.storage.client.MinioStorageClient;
 import io.milvus.exception.ParamException;
@@ -46,30 +46,30 @@ import java.util.concurrent.*;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.atomic.AtomicLong;
 
-public class StageFileManager {
-    private static final Logger logger = LoggerFactory.getLogger(StageFileManager.class);
+public class VolumeFileManager {
+    private static final Logger logger = LoggerFactory.getLogger(VolumeFileManager.class);
     private final String cloudEndpoint;
     private final String apiKey;
-    private final String stageName;
+    private final String volumeName;
     private final ConnectType connectType;
     private final ExecutorService executor;
 
     private StorageClient storageClient;
-    private ApplyStageResponse applyStageResponse;
+    private ApplyVolumeResponse applyVolumeResponse;
 
-    public StageFileManager(StageFileManagerParam stageWriterParam) {
-        this.cloudEndpoint = stageWriterParam.getCloudEndpoint();
-        this.apiKey = stageWriterParam.getApiKey();
-        this.stageName = stageWriterParam.getStageName();
-        this.connectType = stageWriterParam.getConnectType();
+    public VolumeFileManager(VolumeFileManagerParam volumeFileManagerParam) {
+        this.cloudEndpoint = volumeFileManagerParam.getCloudEndpoint();
+        this.apiKey = volumeFileManagerParam.getApiKey();
+        this.volumeName = volumeFileManagerParam.getVolumeName();
+        this.connectType = volumeFileManagerParam.getConnectType();
         this.executor = Executors.newFixedThreadPool(10);
     }
 
     /**
-     * Asynchronously uploads a local file or directory to the specified path within the Stage.
+     * Asynchronously uploads a local file or directory to the specified path within the Volume.
      *
      * @param request the upload request containing the source local file or directory path
-     *                and the target directory path in the Stage {@link UploadFilesRequest}
+     *                and the target directory path in the Volume {@link UploadFilesRequest}
      * @return a {@link CompletableFuture} that completes with an {@link UploadFilesResult}
      * once all files have been uploaded successfully
      * @throws CompletionException if an error occurs during the upload process
@@ -77,9 +77,9 @@ public class StageFileManager {
     public CompletableFuture<UploadFilesResult> uploadFilesAsync(UploadFilesRequest request) {
         String localDirOrFilePath = request.getSourceFilePath();
         Pair<List<String>, Long> localPathPair = FileUtils.processLocalPath(localDirOrFilePath);
-        String stagePath = convertDirPath(request.getTargetStagePath());
+        String volumePath = convertDirPath(request.getTargetVolumePath());
 
-        refreshStageAndClient(stagePath);
+        refreshVolumeAndClient(volumePath);
         initValidator(localPathPair);
 
         AtomicInteger currentFileCount = new AtomicInteger(0);
@@ -94,7 +94,7 @@ public class StageFileManager {
                             long fileStartTime = System.currentTimeMillis();
 
                             try {
-                                uploadLocalFileToStage(localFilePath, localDirOrFilePath, stagePath);
+                                uploadLocalFileToVolume(localFilePath, localDirOrFilePath, volumePath);
                                 long bytes = processedBytes.addAndGet(file.length());
                                 int completeCount = currentFileCount.incrementAndGet();
                                 long elapsed = System.currentTimeMillis() - fileStartTime;
@@ -110,11 +110,11 @@ public class StageFileManager {
                 })
                 .thenApply(v -> {
                     long totalElapsed = (System.currentTimeMillis() - startTime) / 1000;
-                    logger.info("all files in {} has been async uploaded to stage, stageName:{}, stagePath:{}, totalFileCount:{}, totalFileSize:{}, cost times:{} s",
-                            localDirOrFilePath, applyStageResponse.getStageName(), stagePath, localPathPair.getKey().size(), localPathPair.getValue(), totalElapsed);
+                    logger.info("all files in {} has been async uploaded to volume, volumeName:{}, volumePath:{}, totalFileCount:{}, totalFileSize:{}, cost times:{} s",
+                            localDirOrFilePath, applyVolumeResponse.getVolumeName(), volumePath, localPathPair.getKey().size(), localPathPair.getValue(), totalElapsed);
                     return UploadFilesResult.builder()
-                            .stageName(applyStageResponse.getStageName())
-                            .path(stagePath)
+                            .volumeName(applyVolumeResponse.getVolumeName())
+                            .path(volumePath)
                             .build();
                 });
     }
@@ -129,7 +129,7 @@ public class StageFileManager {
      * <p>
      * Usage recommendation:
      * <ul>
-     *   <li>Call this method when the StageFileManager is no longer needed.</li>
+     *   <li>Call this method when the VolumeFileManager is no longer needed.</li>
      * </ul>
      * <p>
      * Thread interruption is respected, and the interrupt status is restored if interrupted during shutdown.
@@ -149,33 +149,33 @@ public class StageFileManager {
     }
 
     private void initValidator(Pair<List<String>, Long> localPathPair) {
-        if (localPathPair.getValue() > applyStageResponse.getCondition().getMaxContentLength()) {
-            String msg = String.format("localFileTotalSize %s exceeds the maximum contentLength limit %s defined in the condition. If you want to upload larger files, please contact us to lift the restriction", localPathPair.getValue(), applyStageResponse.getCondition().getMaxContentLength());
+        if (localPathPair.getValue() > applyVolumeResponse.getCondition().getMaxContentLength()) {
+            String msg = String.format("localFileTotalSize %s exceeds the maximum contentLength limit %s defined in the condition. If you want to upload larger files, please contact us to lift the restriction", localPathPair.getValue(), applyVolumeResponse.getCondition().getMaxContentLength());
             logger.error(msg);
             throw new ParamException(msg);
         }
     }
 
-    private void refreshStageAndClient(String path) {
-        logger.info("refreshing Stage info...");
-        ApplyStageRequest applyStageRequest = ApplyStageRequest.builder()
+    private void refreshVolumeAndClient(String path) {
+        logger.info("refreshing Volume info...");
+        ApplyVolumeRequest applyVolumeRequest = ApplyVolumeRequest.builder()
                 .apiKey(apiKey)
-                .stageName(stageName)
+                .volumeName(volumeName)
                 .path(path)
                 .build();
-        String result = DataStageUtils.applyStage(cloudEndpoint, applyStageRequest);
-        applyStageResponse = new Gson().fromJson(result, ApplyStageResponse.class);
-        logger.info("stage info refreshed");
+        String result = DataVolumeUtils.applyVolume(cloudEndpoint, applyVolumeRequest);
+        applyVolumeResponse = new Gson().fromJson(result, ApplyVolumeResponse.class);
+        logger.info("volume info refreshed");
 
-        String endpoint = EndpointResolver.resolveEndpoint(applyStageResponse.getEndpoint(), applyStageResponse.getCloud(),
-                applyStageResponse.getRegion(), connectType);
+        String endpoint = EndpointResolver.resolveEndpoint(applyVolumeResponse.getEndpoint(), applyVolumeResponse.getCloud(),
+                applyVolumeResponse.getRegion(), connectType);
         storageClient = MinioStorageClient.getStorageClient(
-                applyStageResponse.getCloud(),
+                applyVolumeResponse.getCloud(),
                 endpoint,
-                applyStageResponse.getCredentials().getTmpAK(),
-                applyStageResponse.getCredentials().getTmpSK(),
-                applyStageResponse.getCredentials().getSessionToken(),
-                applyStageResponse.getRegion(), null);
+                applyVolumeResponse.getCredentials().getTmpAK(),
+                applyVolumeResponse.getCredentials().getTmpSK(),
+                applyVolumeResponse.getCredentials().getSessionToken(),
+                applyVolumeResponse.getRegion(), null);
         logger.info("storage client refreshed");
     }
 
@@ -189,7 +189,7 @@ public class StageFileManager {
         return inputPath + "/";
     }
 
-    private void uploadLocalFileToStage(String localFilePath, String rootPath, String stagePath) {
+    private void uploadLocalFileToVolume(String localFilePath, String rootPath, String volumePath) {
         File file = new File(localFilePath);
         Path filePath = file.toPath().toAbsolutePath();
         Path root = Paths.get(rootPath).toAbsolutePath();
@@ -201,36 +201,36 @@ public class StageFileManager {
             relativePath = root.relativize(filePath).toString().replace("\\", "/");
         }
 
-        String remoteFilePath = applyStageResponse.getStagePrefix() + stagePath + relativePath;
-        putObjectWithRetry(file, remoteFilePath, stagePath);
+        String remoteFilePath = applyVolumeResponse.getVolumePrefix() + volumePath + relativePath;
+        putObjectWithRetry(file, remoteFilePath, volumePath);
     }
 
-    private void putObjectWithRetry(File file, String remoteFilePath, String stagePath) {
-        refreshIfExpire(stagePath);
+    private void putObjectWithRetry(File file, String remoteFilePath, String volumePath) {
+        refreshIfExpire(volumePath);
         String msg = "upload " + file.getAbsolutePath();
         withRetry(msg, () -> {
             try {
-                storageClient.putObject(file, applyStageResponse.getBucketName(), remoteFilePath);
+                storageClient.putObject(file, applyVolumeResponse.getBucketName(), remoteFilePath);
             } catch (Exception e) {
                 throw new RuntimeException(e);
             }
-        }, stagePath);
+        }, volumePath);
 
     }
 
-    private void refreshIfExpire(String stagePath) {
-        Instant instant = Instant.parse(applyStageResponse.getCredentials().getExpireTime());
+    private void refreshIfExpire(String volumePath) {
+        Instant instant = Instant.parse(applyVolumeResponse.getCredentials().getExpireTime());
         Date expireTime = Date.from(instant);
         if (new Date().after(expireTime)) {
             synchronized (this) {
                 if (new Date().after(expireTime)) {
-                    refreshStageAndClient(stagePath);
+                    refreshVolumeAndClient(volumePath);
                 }
             }
         }
     }
 
-    private <T> T withRetry(String actionName, Callable<T> callable, String stagePath) {
+    private <T> T withRetry(String actionName, Callable<T> callable, String volumePath) {
         final int maxRetries = 5;
         int attempt = 0;
         while (attempt < maxRetries) {
@@ -240,7 +240,7 @@ public class StageFileManager {
                 throw e;
             } catch (Exception e) {
                 attempt++;
-                refreshStageAndClient(stagePath);
+                refreshVolumeAndClient(volumePath);
                 logger.warn("Attempt {} failed to {}", attempt, actionName, e);
                 if (attempt == maxRetries) {
                     throw new RuntimeException(actionName + " failed after " + maxRetries + " attempts", e);
@@ -254,11 +254,11 @@ public class StageFileManager {
         throw new RuntimeException(actionName + " failed unexpectedly.");
     }
 
-    private void withRetry(String actionName, Runnable runnable, String stagePath) {
+    private void withRetry(String actionName, Runnable runnable, String volumePath) {
         withRetry(actionName, () -> {
             runnable.run();
             return null;
-        }, stagePath);
+        }, volumePath);
     }
 
 

+ 18 - 18
sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/StageFileManagerParam.java → sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/VolumeFileManagerParam.java

@@ -24,18 +24,18 @@ import io.milvus.exception.ParamException;
 import io.milvus.param.ParamUtils;
 
 /**
- * Parameters for <code>stageFileManager</code> interface.
+ * Parameters for <code>volumeFileManager</code> interface.
  */
-public class StageFileManagerParam {
+public class VolumeFileManagerParam {
     private final String cloudEndpoint;
     private final String apiKey;
-    private final String stageName;
+    private final String volumeName;
     private final ConnectType connectType;
 
-    private StageFileManagerParam(Builder builder) {
+    private VolumeFileManagerParam(Builder builder) {
         this.cloudEndpoint = builder.cloudEndpoint;
         this.apiKey = builder.apiKey;
-        this.stageName = builder.stageName;
+        this.volumeName = builder.volumeName;
         this.connectType = builder.connectType;
     }
 
@@ -47,8 +47,8 @@ public class StageFileManagerParam {
         return apiKey;
     }
 
-    public String getStageName() {
-        return stageName;
+    public String getVolumeName() {
+        return volumeName;
     }
 
     public ConnectType getConnectType() {
@@ -57,9 +57,9 @@ public class StageFileManagerParam {
 
     @Override
     public String toString() {
-        return "StageFileManagerParam{" +
+        return "VolumeFileManagerParam{" +
                 "cloudEndpoint='" + cloudEndpoint + '\'' +
-                ", stageName='" + stageName + '\'' +
+                ", volumeName='" + volumeName + '\'' +
                 ", connectType=" + connectType +
                 '}';
     }
@@ -69,14 +69,14 @@ public class StageFileManagerParam {
     }
 
     /**
-     * Builder for {@link StageFileManagerParam} class.
+     * Builder for {@link VolumeFileManagerParam} class.
      */
     public static final class Builder {
         private String cloudEndpoint;
 
         private String apiKey;
 
-        private String stageName;
+        private String volumeName;
 
         private ConnectType connectType = ConnectType.AUTO;
 
@@ -98,8 +98,8 @@ public class StageFileManagerParam {
             return this;
         }
 
-        public Builder withStageName(String stageName) {
-            this.stageName = stageName;
+        public Builder withVolumeName(String volumeName) {
+            this.volumeName = volumeName;
             return this;
         }
 
@@ -115,16 +115,16 @@ public class StageFileManagerParam {
         }
 
         /**
-         * Verifies parameters and creates a new {@link StageFileManagerParam} instance.
+         * Verifies parameters and creates a new {@link VolumeFileManagerParam} instance.
          *
-         * @return {@link StageFileManagerParam}
+         * @return {@link VolumeFileManagerParam}
          */
-        public StageFileManagerParam build() throws ParamException {
+        public VolumeFileManagerParam build() throws ParamException {
             ParamUtils.CheckNullEmptyString(cloudEndpoint, "cloudEndpoint");
             ParamUtils.CheckNullEmptyString(apiKey, "apiKey");
-            ParamUtils.CheckNullEmptyString(stageName, "stageName");
+            ParamUtils.CheckNullEmptyString(volumeName, "volumeName");
 
-            return new StageFileManagerParam(this);
+            return new VolumeFileManagerParam(this);
         }
     }
 

+ 59 - 0
sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/VolumeManager.java

@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package io.milvus.bulkwriter;
+
+import com.google.gson.Gson;
+import io.milvus.bulkwriter.request.volume.CreateVolumeRequest;
+import io.milvus.bulkwriter.request.volume.DeleteVolumeRequest;
+import io.milvus.bulkwriter.request.volume.ListVolumesRequest;
+import io.milvus.bulkwriter.response.volume.ListVolumesResponse;
+import io.milvus.bulkwriter.restful.DataVolumeUtils;
+
+public class VolumeManager {
+    private final String cloudEndpoint;
+    private final String apiKey;
+
+    public VolumeManager(VolumeManagerParam volumeManagerParam) {
+        cloudEndpoint = volumeManagerParam.getCloudEndpoint();
+        apiKey = volumeManagerParam.getApiKey();
+    }
+
+    /**
+     * Create a volume under the specified project and regionId.
+     */
+    public void createVolume(CreateVolumeRequest request) {
+        DataVolumeUtils.createVolume(cloudEndpoint, apiKey, request);
+    }
+
+    /**
+     * Delete a volume.
+     */
+    public void deleteVolume(DeleteVolumeRequest request) {
+        DataVolumeUtils.deleteVolume(cloudEndpoint, apiKey, request);
+    }
+
+    /**
+     * Paginated query of the volume list under a specified projectId.
+     */
+    public ListVolumesResponse listVolumes(ListVolumesRequest request) {
+        String result = DataVolumeUtils.listVolumes(cloudEndpoint, apiKey, request);
+        return new Gson().fromJson(result, ListVolumesResponse.class);
+    }
+}

+ 9 - 9
sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/StageManagerParam.java → sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/VolumeManagerParam.java

@@ -23,13 +23,13 @@ import io.milvus.exception.ParamException;
 import io.milvus.param.ParamUtils;
 
 /**
- * Parameters for <code>stageManager</code> interface.
+ * Parameters for <code>volumeManager</code> interface.
  */
-public class StageManagerParam {
+public class VolumeManagerParam {
     private final String cloudEndpoint;
     private final String apiKey;
 
-    private StageManagerParam(Builder builder) {
+    private VolumeManagerParam(Builder builder) {
         this.cloudEndpoint = builder.cloudEndpoint;
         this.apiKey = builder.apiKey;
     }
@@ -44,7 +44,7 @@ public class StageManagerParam {
 
     @Override
     public String toString() {
-        return "StageManagerParam{" +
+        return "VolumeManagerParam{" +
                 "cloudEndpoint='" + cloudEndpoint + '\'' +
                 '}';
     }
@@ -54,7 +54,7 @@ public class StageManagerParam {
     }
 
     /**
-     * Builder for {@link StageManagerParam} class.
+     * Builder for {@link VolumeManagerParam} class.
      */
     public static final class Builder {
         private String cloudEndpoint;
@@ -80,15 +80,15 @@ public class StageManagerParam {
         }
 
         /**
-         * Verifies parameters and creates a new {@link StageManagerParam} instance.
+         * Verifies parameters and creates a new {@link VolumeManagerParam} instance.
          *
-         * @return {@link StageManagerParam}
+         * @return {@link VolumeManagerParam}
          */
-        public StageManagerParam build() throws ParamException {
+        public VolumeManagerParam build() throws ParamException {
             ParamUtils.CheckNullEmptyString(cloudEndpoint, "cloudEndpoint");
             ParamUtils.CheckNullEmptyString(apiKey, "apiKey");
 
-            return new StageManagerParam(this);
+            return new VolumeManagerParam(this);
         }
     }
 

+ 13 - 13
sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/model/UploadFilesResult.java

@@ -1,28 +1,28 @@
 package io.milvus.bulkwriter.model;
 
 public class UploadFilesResult {
-    private String stageName;
+    private String volumeName;
     private String path;
 
     public UploadFilesResult() {
     }
 
-    public UploadFilesResult(String stageName, String path) {
-        this.stageName = stageName;
+    public UploadFilesResult(String volumeName, String path) {
+        this.volumeName = volumeName;
         this.path = path;
     }
 
     private UploadFilesResult(UploadFilesResultBuilder builder) {
-        this.stageName = builder.stageName;
+        this.volumeName = builder.volumeName;
         this.path = builder.path;
     }
 
-    public String getStageName() {
-        return stageName;
+    public String getVolumeName() {
+        return volumeName;
     }
 
-    public void setStageName(String stageName) {
-        this.stageName = stageName;
+    public void setVolumeName(String volumeName) {
+        this.volumeName = volumeName;
     }
 
     public String getPath() {
@@ -36,7 +36,7 @@ public class UploadFilesResult {
     @Override
     public String toString() {
         return "UploadFilesResult{" +
-                "stageName='" + stageName + '\'' +
+                "volumeName='" + volumeName + '\'' +
                 ", path='" + path + '\'' +
                 '}';
     }
@@ -46,16 +46,16 @@ public class UploadFilesResult {
     }
 
     public static class UploadFilesResultBuilder {
-        private String stageName;
+        private String volumeName;
         private String path;
 
         private UploadFilesResultBuilder() {
-            this.stageName = "";
+            this.volumeName = "";
             this.path = "";
         }
 
-        public UploadFilesResultBuilder stageName(String stageName) {
-            this.stageName = stageName;
+        public UploadFilesResultBuilder volumeName(String volumeName) {
+            this.volumeName = volumeName;
             return this;
         }
 

+ 31 - 31
sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/request/import_/StageImportRequest.java → sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/request/import_/VolumeImportRequest.java

@@ -23,10 +23,10 @@ import java.util.ArrayList;
 import java.util.List;
 
 /*
-  If you want to import data into a Zilliz cloud instance and your data is stored in a Zilliz stage,
-  you can use this method to import the data from the stage.
+  If you want to import data into a Zilliz cloud instance and your data is stored in a Zilliz volume,
+  you can use this method to import the data from the volume.
  */
-public class StageImportRequest extends BaseImportRequest {
+public class VolumeImportRequest extends BaseImportRequest {
     private String clusterId;
 
     /**
@@ -45,7 +45,7 @@ public class StageImportRequest extends BaseImportRequest {
      */
     private String partitionName;
 
-    private String stageName;
+    private String volumeName;
 
     /**
      * Data import can be configured in multiple ways using `dataPaths`:
@@ -69,26 +69,26 @@ public class StageImportRequest extends BaseImportRequest {
      */
     private List<List<String>> dataPaths;
 
-    public StageImportRequest() {
+    public VolumeImportRequest() {
     }
 
-    public StageImportRequest(String clusterId, String dbName, String collectionName, String partitionName,
-                              String stageName, List<List<String>> dataPaths) {
+    public VolumeImportRequest(String clusterId, String dbName, String collectionName, String partitionName,
+                               String volumeName, List<List<String>> dataPaths) {
         this.clusterId = clusterId;
         this.dbName = dbName;
         this.collectionName = collectionName;
         this.partitionName = partitionName;
-        this.stageName = stageName;
+        this.volumeName = volumeName;
         this.dataPaths = dataPaths;
     }
 
-    protected StageImportRequest(StageImportRequestBuilder builder) {
+    protected VolumeImportRequest(VolumeImportRequestBuilder builder) {
         super(builder);
         this.clusterId = builder.clusterId;
         this.dbName = builder.dbName;
         this.collectionName = builder.collectionName;
         this.partitionName = builder.partitionName;
-        this.stageName = builder.stageName;
+        this.volumeName = builder.volumeName;
         this.dataPaths = builder.dataPaths;
     }
 
@@ -124,12 +124,12 @@ public class StageImportRequest extends BaseImportRequest {
         this.partitionName = partitionName;
     }
 
-    public String getStageName() {
-        return stageName;
+    public String getVolumeName() {
+        return volumeName;
     }
 
-    public void setStageName(String stageName) {
-        this.stageName = stageName;
+    public void setVolumeName(String volumeName) {
+        this.volumeName = volumeName;
     }
 
     public List<List<String>> getDataPaths() {
@@ -142,69 +142,69 @@ public class StageImportRequest extends BaseImportRequest {
 
     @Override
     public String toString() {
-        return "StageImportRequest{" +
+        return "VolumeImportRequest{" +
                 "clusterId='" + clusterId + '\'' +
                 ", dbName='" + dbName + '\'' +
                 ", collectionName='" + collectionName + '\'' +
                 ", partitionName='" + partitionName + '\'' +
-                ", stageName='" + stageName + '\'' +
+                ", volumeName='" + volumeName + '\'' +
                 ", dataPaths=" + dataPaths +
                 '}';
     }
 
-    public static StageImportRequestBuilder builder() {
-        return new StageImportRequestBuilder();
+    public static VolumeImportRequestBuilder builder() {
+        return new VolumeImportRequestBuilder();
     }
 
-    public static class StageImportRequestBuilder extends BaseImportRequestBuilder<StageImportRequestBuilder> {
+    public static class VolumeImportRequestBuilder extends BaseImportRequestBuilder<VolumeImportRequestBuilder> {
         private String clusterId;
         private String dbName;
         private String collectionName;
         private String partitionName;
-        private String stageName;
+        private String volumeName;
         private List<List<String>> dataPaths;
 
-        private StageImportRequestBuilder() {
+        private VolumeImportRequestBuilder() {
             this.clusterId = "";
             this.dbName = "";
             this.collectionName = "";
             this.partitionName = "";
-            this.stageName = "";
+            this.volumeName = "";
             this.dataPaths = new ArrayList<>();
         }
 
-        public StageImportRequestBuilder clusterId(String clusterId) {
+        public VolumeImportRequestBuilder clusterId(String clusterId) {
             this.clusterId = clusterId;
             return this;
         }
 
-        public StageImportRequestBuilder dbName(String dbName) {
+        public VolumeImportRequestBuilder dbName(String dbName) {
             this.dbName = dbName;
             return this;
         }
 
-        public StageImportRequestBuilder collectionName(String collectionName) {
+        public VolumeImportRequestBuilder collectionName(String collectionName) {
             this.collectionName = collectionName;
             return this;
         }
 
-        public StageImportRequestBuilder partitionName(String partitionName) {
+        public VolumeImportRequestBuilder partitionName(String partitionName) {
             this.partitionName = partitionName;
             return this;
         }
 
-        public StageImportRequestBuilder stageName(String stageName) {
-            this.stageName = stageName;
+        public VolumeImportRequestBuilder volumeName(String volumeName) {
+            this.volumeName = volumeName;
             return this;
         }
 
-        public StageImportRequestBuilder dataPaths(List<List<String>> dataPaths) {
+        public VolumeImportRequestBuilder dataPaths(List<List<String>> dataPaths) {
             this.dataPaths = dataPaths;
             return this;
         }
 
-        public StageImportRequest build() {
-            return new StageImportRequest(this);
+        public VolumeImportRequest build() {
+            return new VolumeImportRequest(this);
         }
     }
 }

+ 0 - 71
sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/request/stage/DeleteStageRequest.java

@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package io.milvus.bulkwriter.request.stage;
-
-public class DeleteStageRequest {
-    private String stageName;
-
-    public DeleteStageRequest() {
-    }
-
-    public DeleteStageRequest(String stageName) {
-        this.stageName = stageName;
-    }
-
-    protected DeleteStageRequest(DeleteStageRequestBuilder builder) {
-        this.stageName = builder.stageName;
-    }
-
-    public String getStageName() {
-        return stageName;
-    }
-
-    public void setStageName(String stageName) {
-        this.stageName = stageName;
-    }
-
-    @Override
-    public String toString() {
-        return "DeleteStageRequest{" +
-                "stageName='" + stageName + '\'' +
-                '}';
-    }
-
-    public static DeleteStageRequestBuilder builder() {
-        return new DeleteStageRequestBuilder();
-    }
-
-    public static class DeleteStageRequestBuilder {
-        private String stageName;
-
-        private DeleteStageRequestBuilder() {
-            this.stageName = "";
-        }
-
-        public DeleteStageRequestBuilder stageName(String stageName) {
-            this.stageName = stageName;
-            return this;
-        }
-
-        public DeleteStageRequest build() {
-            return new DeleteStageRequest(this);
-        }
-    }
-}

+ 25 - 25
sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/request/stage/ApplyStageRequest.java → sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/request/volume/ApplyVolumeRequest.java

@@ -17,32 +17,32 @@
  * under the License.
  */
 
-package io.milvus.bulkwriter.request.stage;
+package io.milvus.bulkwriter.request.volume;
 
-public class ApplyStageRequest extends BaseStageRequest {
-    private String stageName;
+public class ApplyVolumeRequest extends BaseVolumeRequest {
+    private String volumeName;
     private String path;
 
-    protected ApplyStageRequest() {
+    protected ApplyVolumeRequest() {
     }
 
-    protected ApplyStageRequest(String stageName, String path) {
-        this.stageName = stageName;
+    protected ApplyVolumeRequest(String volumeName, String path) {
+        this.volumeName = volumeName;
         this.path = path;
     }
 
-    protected ApplyStageRequest(ApplyStageRequestBuilder builder) {
+    protected ApplyVolumeRequest(ApplyVolumeRequestBuilder builder) {
         super(builder);
-        this.stageName = builder.stageName;
+        this.volumeName = builder.volumeName;
         this.path = builder.path;
     }
 
-    public String getStageName() {
-        return stageName;
+    public String getVolumeName() {
+        return volumeName;
     }
 
-    public void setStageName(String stageName) {
-        this.stageName = stageName;
+    public void setVolumeName(String volumeName) {
+        this.volumeName = volumeName;
     }
 
     public String getPath() {
@@ -55,37 +55,37 @@ public class ApplyStageRequest extends BaseStageRequest {
 
     @Override
     public String toString() {
-        return "ApplyStageRequest{" +
-                "stageName='" + stageName + '\'' +
+        return "ApplyVolumeRequest{" +
+                "volumeName='" + volumeName + '\'' +
                 ", path='" + path + '\'' +
                 '}';
     }
 
-    public static ApplyStageRequestBuilder builder() {
-        return new ApplyStageRequestBuilder();
+    public static ApplyVolumeRequestBuilder builder() {
+        return new ApplyVolumeRequestBuilder();
     }
 
-    public static class ApplyStageRequestBuilder extends BaseStageRequestBuilder<ApplyStageRequestBuilder> {
-        private String stageName;
+    public static class ApplyVolumeRequestBuilder extends BaseVolumeRequestBuilder<ApplyVolumeRequestBuilder> {
+        private String volumeName;
         private String path;
 
-        private ApplyStageRequestBuilder() {
-            this.stageName = "";
+        private ApplyVolumeRequestBuilder() {
+            this.volumeName = "";
             this.path = "";
         }
 
-        public ApplyStageRequestBuilder stageName(String stageName) {
-            this.stageName = stageName;
+        public ApplyVolumeRequestBuilder volumeName(String volumeName) {
+            this.volumeName = volumeName;
             return this;
         }
 
-        public ApplyStageRequestBuilder path(String path) {
+        public ApplyVolumeRequestBuilder path(String path) {
             this.path = path;
             return this;
         }
 
-        public ApplyStageRequest build() {
-            return new ApplyStageRequest(this);
+        public ApplyVolumeRequest build() {
+            return new ApplyVolumeRequest(this);
         }
     }
 }

+ 12 - 12
sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/request/stage/BaseStageRequest.java → sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/request/volume/BaseVolumeRequest.java

@@ -17,13 +17,13 @@
  * under the License.
  */
 
-package io.milvus.bulkwriter.request.stage;
+package io.milvus.bulkwriter.request.volume;
 
 import java.io.Serializable;
 import java.util.HashMap;
 import java.util.Map;
 
-public class BaseStageRequest implements Serializable {
+public class BaseVolumeRequest implements Serializable {
     private static final long serialVersionUID = 8192049841043084620L;
     /**
      * If you are calling the cloud API, this parameter needs to be filled in; otherwise, you can ignore it.
@@ -31,15 +31,15 @@ public class BaseStageRequest implements Serializable {
     private String apiKey;
     private Map<String, Object> options;
 
-    protected BaseStageRequest() {
+    protected BaseVolumeRequest() {
     }
 
-    protected BaseStageRequest(String apiKey, Map<String, Object> options) {
+    protected BaseVolumeRequest(String apiKey, Map<String, Object> options) {
         this.apiKey = apiKey;
         this.options = options;
     }
 
-    protected BaseStageRequest(BaseStageRequestBuilder<?> builder) {
+    protected BaseVolumeRequest(BaseVolumeRequestBuilder<?> builder) {
         this.apiKey = builder.apiKey;
         this.options = builder.options;
     }
@@ -62,21 +62,21 @@ public class BaseStageRequest implements Serializable {
 
     @Override
     public String toString() {
-        return "BaseStageRequest{" +
+        return "BaseVolumeRequest{" +
                 "apiKey='" + apiKey + '\'' +
                 "options=" + options +
                 '}';
     }
 
-    public static BaseStageRequestBuilder<?> builder() {
-        return new BaseStageRequestBuilder<>();
+    public static BaseVolumeRequestBuilder<?> builder() {
+        return new BaseVolumeRequestBuilder<>();
     }
 
-    public static class BaseStageRequestBuilder<T extends BaseStageRequestBuilder<T>> {
+    public static class BaseVolumeRequestBuilder<T extends BaseVolumeRequestBuilder<T>> {
         private String apiKey;
         private Map<String, Object> options;
 
-        protected BaseStageRequestBuilder() {
+        protected BaseVolumeRequestBuilder() {
             this.apiKey = "";
             this.options = new HashMap<>();
         }
@@ -91,8 +91,8 @@ public class BaseStageRequest implements Serializable {
             return (T) this;
         }
 
-        public BaseStageRequest build() {
-            return new BaseStageRequest(this);
+        public BaseVolumeRequest build() {
+            return new BaseVolumeRequest(this);
         }
     }
 }

+ 26 - 26
sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/request/stage/CreateStageRequest.java → sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/request/volume/CreateVolumeRequest.java

@@ -17,26 +17,26 @@
  * under the License.
  */
 
-package io.milvus.bulkwriter.request.stage;
+package io.milvus.bulkwriter.request.volume;
 
-public class CreateStageRequest {
+public class CreateVolumeRequest {
     private String projectId;
     private String regionId;
-    private String stageName;
+    private String volumeName;
 
-    public CreateStageRequest() {
+    public CreateVolumeRequest() {
     }
 
-    public CreateStageRequest(String projectId, String regionId, String stageName) {
+    public CreateVolumeRequest(String projectId, String regionId, String volumeName) {
         this.projectId = projectId;
         this.regionId = regionId;
-        this.stageName = stageName;
+        this.volumeName = volumeName;
     }
 
-    protected CreateStageRequest(CreateStageRequestBuilder builder) {
+    protected CreateVolumeRequest(CreateVolumeRequestBuilder builder) {
         this.projectId = builder.projectId;
         this.regionId = builder.regionId;
-        this.stageName = builder.stageName;
+        this.volumeName = builder.volumeName;
     }
 
     public String getProjectId() {
@@ -55,55 +55,55 @@ public class CreateStageRequest {
         this.regionId = regionId;
     }
 
-    public String getStageName() {
-        return stageName;
+    public String getVolumeName() {
+        return volumeName;
     }
 
-    public void setStageName(String stageName) {
-        this.stageName = stageName;
+    public void setVolumeName(String volumeName) {
+        this.volumeName = volumeName;
     }
 
     @Override
     public String toString() {
-        return "CreateStageRequest{" +
+        return "CreateVolumeRequest{" +
                 "projectId='" + projectId + '\'' +
                 ", regionId='" + regionId + '\'' +
-                ", stageName='" + stageName + '\'' +
+                ", volumeName='" + volumeName + '\'' +
                 '}';
     }
 
-    public static CreateStageRequestBuilder builder() {
-        return new CreateStageRequestBuilder();
+    public static CreateVolumeRequestBuilder builder() {
+        return new CreateVolumeRequestBuilder();
     }
 
-    public static class CreateStageRequestBuilder {
+    public static class CreateVolumeRequestBuilder {
         private String projectId;
         private String regionId;
-        private String stageName;
+        private String volumeName;
 
-        private CreateStageRequestBuilder() {
+        private CreateVolumeRequestBuilder() {
             this.projectId = "";
             this.regionId = "";
-            this.stageName = "";
+            this.volumeName = "";
         }
 
-        public CreateStageRequestBuilder projectId(String projectId) {
+        public CreateVolumeRequestBuilder projectId(String projectId) {
             this.projectId = projectId;
             return this;
         }
 
-        public CreateStageRequestBuilder regionId(String regionId) {
+        public CreateVolumeRequestBuilder regionId(String regionId) {
             this.regionId = regionId;
             return this;
         }
 
-        public CreateStageRequestBuilder stageName(String stageName) {
-            this.stageName = stageName;
+        public CreateVolumeRequestBuilder volumeName(String volumeName) {
+            this.volumeName = volumeName;
             return this;
         }
 
-        public CreateStageRequest build() {
-            return new CreateStageRequest(this);
+        public CreateVolumeRequest build() {
+            return new CreateVolumeRequest(this);
         }
     }
 }

+ 71 - 0
sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/request/volume/DeleteVolumeRequest.java

@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package io.milvus.bulkwriter.request.volume;
+
+public class DeleteVolumeRequest {
+    private String volumeName;
+
+    public DeleteVolumeRequest() {
+    }
+
+    public DeleteVolumeRequest(String volumeName) {
+        this.volumeName = volumeName;
+    }
+
+    protected DeleteVolumeRequest(DeleteVolumeRequestBuilder builder) {
+        this.volumeName = builder.volumeName;
+    }
+
+    public String getVolumeName() {
+        return volumeName;
+    }
+
+    public void setVolumeName(String volumeName) {
+        this.volumeName = volumeName;
+    }
+
+    @Override
+    public String toString() {
+        return "DeleteVolumeRequest{" +
+                "volumeName='" + volumeName + '\'' +
+                '}';
+    }
+
+    public static DeleteVolumeRequestBuilder builder() {
+        return new DeleteVolumeRequestBuilder();
+    }
+
+    public static class DeleteVolumeRequestBuilder {
+        private String volumeName;
+
+        private DeleteVolumeRequestBuilder() {
+            this.volumeName = "";
+        }
+
+        public DeleteVolumeRequestBuilder volumeName(String volumeName) {
+            this.volumeName = volumeName;
+            return this;
+        }
+
+        public DeleteVolumeRequest build() {
+            return new DeleteVolumeRequest(this);
+        }
+    }
+}

+ 15 - 15
sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/request/stage/ListStagesRequest.java → sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/request/volume/ListVolumesRequest.java

@@ -17,24 +17,24 @@
  * under the License.
  */
 
-package io.milvus.bulkwriter.request.stage;
+package io.milvus.bulkwriter.request.volume;
 
 
-public class ListStagesRequest {
+public class ListVolumesRequest {
     private String projectId;
     private Integer pageSize;
     private Integer currentPage;
 
-    public ListStagesRequest() {
+    public ListVolumesRequest() {
     }
 
-    public ListStagesRequest(String projectId, Integer pageSize, Integer currentPage) {
+    public ListVolumesRequest(String projectId, Integer pageSize, Integer currentPage) {
         this.projectId = projectId;
         this.pageSize = pageSize;
         this.currentPage = currentPage;
     }
 
-    protected ListStagesRequest(ListStagesRequestBuilder builder) {
+    protected ListVolumesRequest(ListVolumesRequestBuilder builder) {
         this.projectId = builder.projectId;
         this.pageSize = builder.pageSize;
         this.currentPage = builder.currentPage;
@@ -66,45 +66,45 @@ public class ListStagesRequest {
 
     @Override
     public String toString() {
-        return "ListStagesRequest{" +
+        return "ListVolumesRequest{" +
                 "projectId='" + projectId + '\'' +
                 ", pageSize=" + pageSize +
                 ", currentPage=" + currentPage +
                 '}';
     }
 
-    public static ListStagesRequestBuilder builder() {
-        return new ListStagesRequestBuilder();
+    public static ListVolumesRequestBuilder builder() {
+        return new ListVolumesRequestBuilder();
     }
 
-    public static class ListStagesRequestBuilder {
+    public static class ListVolumesRequestBuilder {
         private String projectId;
         private Integer pageSize;
         private Integer currentPage;
 
-        private ListStagesRequestBuilder() {
+        private ListVolumesRequestBuilder() {
             this.projectId = "";
             this.pageSize = 0;
             this.currentPage = 0;
         }
 
-        public ListStagesRequestBuilder projectId(String projectId) {
+        public ListVolumesRequestBuilder projectId(String projectId) {
             this.projectId = projectId;
             return this;
         }
 
-        public ListStagesRequestBuilder pageSize(Integer pageSize) {
+        public ListVolumesRequestBuilder pageSize(Integer pageSize) {
             this.pageSize = pageSize;
             return this;
         }
 
-        public ListStagesRequestBuilder currentPage(Integer currentPage) {
+        public ListVolumesRequestBuilder currentPage(Integer currentPage) {
             this.currentPage = currentPage;
             return this;
         }
 
-        public ListStagesRequest build() {
-            return new ListStagesRequest(this);
+        public ListVolumesRequest build() {
+            return new ListVolumesRequest(this);
         }
     }
 }

+ 15 - 15
sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/request/stage/UploadFilesRequest.java → sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/request/volume/UploadFilesRequest.java

@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package io.milvus.bulkwriter.request.stage;
+package io.milvus.bulkwriter.request.volume;
 
 public class UploadFilesRequest {
     /**
@@ -28,23 +28,23 @@ public class UploadFilesRequest {
     private String sourceFilePath;
 
     /**
-     * The target stage directory path:
+     * The target volume directory path:
      * Leave it empty to upload to the root directory.
      * To upload to a specific folder, end the path with a /, e.g., data/
      */
-    private String targetStagePath;
+    private String targetVolumePath;
 
     public UploadFilesRequest() {
     }
 
-    public UploadFilesRequest(String sourceFilePath, String targetStagePath) {
+    public UploadFilesRequest(String sourceFilePath, String targetVolumePath) {
         this.sourceFilePath = sourceFilePath;
-        this.targetStagePath = targetStagePath;
+        this.targetVolumePath = targetVolumePath;
     }
 
     protected UploadFilesRequest(UploadFilesRequestBuilder builder) {
         this.sourceFilePath = builder.sourceFilePath;
-        this.targetStagePath = builder.targetStagePath;
+        this.targetVolumePath = builder.targetVolumePath;
     }
 
     public String getSourceFilePath() {
@@ -55,19 +55,19 @@ public class UploadFilesRequest {
         this.sourceFilePath = sourceFilePath;
     }
 
-    public String getTargetStagePath() {
-        return targetStagePath;
+    public String getTargetVolumePath() {
+        return targetVolumePath;
     }
 
-    public void setTargetStagePath(String targetStagePath) {
-        this.targetStagePath = targetStagePath;
+    public void setTargetVolumePath(String targetVolumePath) {
+        this.targetVolumePath = targetVolumePath;
     }
 
     @Override
     public String toString() {
         return "UploadFilesRequest{" +
                 "sourceFilePath='" + sourceFilePath + '\'' +
-                ", targetStagePath='" + targetStagePath + '\'' +
+                ", targetVolumePath='" + targetVolumePath + '\'' +
                 '}';
     }
 
@@ -77,11 +77,11 @@ public class UploadFilesRequest {
 
     public static class UploadFilesRequestBuilder {
         private String sourceFilePath;
-        private String targetStagePath;
+        private String targetVolumePath;
 
         private UploadFilesRequestBuilder() {
             this.sourceFilePath = "";
-            this.targetStagePath = "";
+            this.targetVolumePath = "";
         }
 
         public UploadFilesRequestBuilder sourceFilePath(String sourceFilePath) {
@@ -89,8 +89,8 @@ public class UploadFilesRequest {
             return this;
         }
 
-        public UploadFilesRequestBuilder targetStagePath(String targetStagePath) {
-            this.targetStagePath = targetStagePath;
+        public UploadFilesRequestBuilder targetVolumePath(String targetVolumePath) {
+            this.targetVolumePath = targetVolumePath;
             return this;
         }
 

+ 43 - 43
sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/response/ApplyStageResponse.java → sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/response/ApplyVolumeResponse.java

@@ -3,7 +3,7 @@ package io.milvus.bulkwriter.response;
 import java.io.Serializable;
 
 
-public class ApplyStageResponse implements Serializable {
+public class ApplyVolumeResponse implements Serializable {
     private String endpoint;
     private String cloud;
     private String region;
@@ -11,14 +11,14 @@ public class ApplyStageResponse implements Serializable {
     private String uploadPath;
     private Credentials credentials;
     private Condition condition;
-    private String stageName;
-    private String stagePrefix;
+    private String volumeName;
+    private String volumePrefix;
 
-    public ApplyStageResponse() {
+    public ApplyVolumeResponse() {
     }
 
-    public ApplyStageResponse(String endpoint, String cloud, String region, String bucketName, String uploadPath,
-                              Credentials credentials, Condition condition, String stageName, String stagePrefix) {
+    public ApplyVolumeResponse(String endpoint, String cloud, String region, String bucketName, String uploadPath,
+                               Credentials credentials, Condition condition, String volumeName, String volumePrefix) {
         this.endpoint = endpoint;
         this.cloud = cloud;
         this.region = region;
@@ -26,11 +26,11 @@ public class ApplyStageResponse implements Serializable {
         this.uploadPath = uploadPath;
         this.credentials = credentials;
         this.condition = condition;
-        this.stageName = stageName;
-        this.stagePrefix = stagePrefix;
+        this.volumeName = volumeName;
+        this.volumePrefix = volumePrefix;
     }
 
-    private ApplyStageResponse(ApplyStageResponseBuilder builder) {
+    private ApplyVolumeResponse(ApplyVolumeResponseBuilder builder) {
         this.endpoint = builder.endpoint;
         this.cloud = builder.cloud;
         this.region = builder.region;
@@ -38,8 +38,8 @@ public class ApplyStageResponse implements Serializable {
         this.uploadPath = builder.uploadPath;
         this.credentials = builder.credentials;
         this.condition = builder.condition;
-        this.stageName = builder.stageName;
-        this.stagePrefix = builder.stagePrefix;
+        this.volumeName = builder.volumeName;
+        this.volumePrefix = builder.volumePrefix;
     }
 
     public String getEndpoint() {
@@ -98,25 +98,25 @@ public class ApplyStageResponse implements Serializable {
         this.condition = condition;
     }
 
-    public String getStageName() {
-        return stageName;
+    public String getVolumeName() {
+        return volumeName;
     }
 
-    public void setStageName(String stageName) {
-        this.stageName = stageName;
+    public void setVolumeName(String volumeName) {
+        this.volumeName = volumeName;
     }
 
-    public String getStagePrefix() {
-        return stagePrefix;
+    public String getVolumePrefix() {
+        return volumePrefix;
     }
 
-    public void setStagePrefix(String stagePrefix) {
-        this.stagePrefix = stagePrefix;
+    public void setVolumePrefix(String volumePrefix) {
+        this.volumePrefix = volumePrefix;
     }
 
     @Override
     public String toString() {
-        return "ApplyStageResponse{" +
+        return "ApplyVolumeResponse{" +
                 ", endpoint='" + endpoint + '\'' +
                 ", cloud='" + cloud + '\'' +
                 ", region='" + region + '\'' +
@@ -124,16 +124,16 @@ public class ApplyStageResponse implements Serializable {
                 ", uploadPath='" + uploadPath + '\'' +
                 ", credentials=" + credentials +
                 ", condition=" + condition +
-                ", stageName='" + stageName + '\'' +
-                ", stagePrefix='" + stagePrefix + '\'' +
+                ", volumeName='" + volumeName + '\'' +
+                ", volumePrefix='" + volumePrefix + '\'' +
                 '}';
     }
 
-    public static ApplyStageResponseBuilder builder() {
-        return new ApplyStageResponseBuilder();
+    public static ApplyVolumeResponseBuilder builder() {
+        return new ApplyVolumeResponseBuilder();
     }
 
-    public static class ApplyStageResponseBuilder {
+    public static class ApplyVolumeResponseBuilder {
         private String endpoint;
         private String cloud;
         private String region;
@@ -141,10 +141,10 @@ public class ApplyStageResponse implements Serializable {
         private String uploadPath;
         private Credentials credentials;
         private Condition condition;
-        private String stageName;
-        private String stagePrefix;
+        private String volumeName;
+        private String volumePrefix;
 
-        private ApplyStageResponseBuilder() {
+        private ApplyVolumeResponseBuilder() {
             this.endpoint = "";
             this.cloud = "";
             this.region = "";
@@ -152,57 +152,57 @@ public class ApplyStageResponse implements Serializable {
             this.uploadPath = "";
             this.credentials = new Credentials();
             this.condition = new Condition();
-            this.stageName = "";
-            this.stagePrefix = "";
+            this.volumeName = "";
+            this.volumePrefix = "";
         }
 
-        public ApplyStageResponseBuilder endpoint(String endpoint) {
+        public ApplyVolumeResponseBuilder endpoint(String endpoint) {
             this.endpoint = endpoint;
             return this;
         }
 
-        public ApplyStageResponseBuilder cloud(String cloud) {
+        public ApplyVolumeResponseBuilder cloud(String cloud) {
             this.cloud = cloud;
             return this;
         }
 
-        public ApplyStageResponseBuilder region(String region) {
+        public ApplyVolumeResponseBuilder region(String region) {
             this.region = region;
             return this;
         }
 
-        public ApplyStageResponseBuilder bucketName(String bucketName) {
+        public ApplyVolumeResponseBuilder bucketName(String bucketName) {
             this.bucketName = bucketName;
             return this;
         }
 
-        public ApplyStageResponseBuilder uploadPath(String uploadPath) {
+        public ApplyVolumeResponseBuilder uploadPath(String uploadPath) {
             this.uploadPath = uploadPath;
             return this;
         }
 
-        public ApplyStageResponseBuilder credentials(Credentials credentials) {
+        public ApplyVolumeResponseBuilder credentials(Credentials credentials) {
             this.credentials = credentials;
             return this;
         }
 
-        public ApplyStageResponseBuilder condition(Condition condition) {
+        public ApplyVolumeResponseBuilder condition(Condition condition) {
             this.condition = condition;
             return this;
         }
 
-        public ApplyStageResponseBuilder stageName(String stageName) {
-            this.stageName = stageName;
+        public ApplyVolumeResponseBuilder volumeName(String volumeName) {
+            this.volumeName = volumeName;
             return this;
         }
 
-        public ApplyStageResponseBuilder stagePrefix(String stagePrefix) {
-            this.stagePrefix = stagePrefix;
+        public ApplyVolumeResponseBuilder volumePrefix(String volumePrefix) {
+            this.volumePrefix = volumePrefix;
             return this;
         }
 
-        public ApplyStageResponse build() {
-            return new ApplyStageResponse(this);
+        public ApplyVolumeResponse build() {
+            return new ApplyVolumeResponse(this);
         }
     }
 

+ 0 - 52
sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/response/stage/StageInfo.java

@@ -1,52 +0,0 @@
-package io.milvus.bulkwriter.response.stage;
-
-public class StageInfo {
-    private String stageName;
-
-    public StageInfo() {
-    }
-
-    public StageInfo(String stageName) {
-        this.stageName = stageName;
-    }
-
-    private StageInfo(StageInfoBuilder builder) {
-        this.stageName = builder.stageName;
-    }
-
-    public String getStageName() {
-        return stageName;
-    }
-
-    public void setStageName(String stageName) {
-        this.stageName = stageName;
-    }
-
-    @Override
-    public String toString() {
-        return "StageInfo{" +
-                "stageName='" + stageName + '\'' +
-                '}';
-    }
-
-    public static StageInfoBuilder builder() {
-        return new StageInfoBuilder();
-    }
-
-    public static class StageInfoBuilder {
-        private String stageName;
-
-        private StageInfoBuilder() {
-            this.stageName = "";
-        }
-
-        public StageInfoBuilder stageName(String stageName) {
-            this.stageName = stageName;
-            return this;
-        }
-
-        public StageInfo build() {
-            return new StageInfo(this);
-        }
-    }
-}

+ 26 - 26
sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/response/stage/ListStagesResponse.java → sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/response/volume/ListVolumesResponse.java

@@ -17,32 +17,32 @@
  * under the License.
  */
 
-package io.milvus.bulkwriter.response.stage;
+package io.milvus.bulkwriter.response.volume;
 
 import java.util.ArrayList;
 import java.util.List;
 
-public class ListStagesResponse {
+public class ListVolumesResponse {
     private Integer count;
     private Integer currentPage;
     private Integer pageSize;
-    private List<StageInfo> stages;
+    private List<VolumeInfo> volumes;
 
-    public ListStagesResponse() {
+    public ListVolumesResponse() {
     }
 
-    public ListStagesResponse(Integer count, Integer currentPage, Integer pageSize, List<StageInfo> stages) {
+    public ListVolumesResponse(Integer count, Integer currentPage, Integer pageSize, List<VolumeInfo> volumes) {
         this.count = count;
         this.currentPage = currentPage;
         this.pageSize = pageSize;
-        this.stages = stages;
+        this.volumes = volumes;
     }
 
-    private ListStagesResponse(ListStagesResponseBuilder builder) {
+    private ListVolumesResponse(ListVolumesResponseBuilder builder) {
         this.count = builder.count;
         this.currentPage = builder.currentPage;
         this.pageSize = builder.pageSize;
-        this.stages = builder.stages;
+        this.volumes = builder.volumes;
     }
 
     public Integer getCount() {
@@ -69,62 +69,62 @@ public class ListStagesResponse {
         this.pageSize = pageSize;
     }
 
-    public List<StageInfo> getStages() {
-        return stages;
+    public List<VolumeInfo> getVolumes() {
+        return volumes;
     }
 
-    public void setStages(List<StageInfo> stages) {
-        this.stages = stages;
+    public void setVolumes(List<VolumeInfo> volumes) {
+        this.volumes = volumes;
     }
 
     @Override
     public String toString() {
-        return "ListStagesResponse{" +
+        return "ListVolumesResponse{" +
                 ", count=" + count +
                 ", currentPage=" + currentPage +
                 ", pageSize=" + pageSize +
                 '}';
     }
 
-    public static ListStagesResponseBuilder builder() {
-        return new ListStagesResponseBuilder();
+    public static ListVolumesResponseBuilder builder() {
+        return new ListVolumesResponseBuilder();
     }
 
-    public static class ListStagesResponseBuilder {
+    public static class ListVolumesResponseBuilder {
         private Integer count;
         private Integer currentPage;
         private Integer pageSize;
-        private List<StageInfo> stages;
+        private List<VolumeInfo> volumes;
 
-        private ListStagesResponseBuilder() {
+        private ListVolumesResponseBuilder() {
             this.count = 0;
             this.currentPage = 0;
             this.pageSize = 0;
-            this.stages = new ArrayList<>();
+            this.volumes = new ArrayList<>();
         }
 
-        public ListStagesResponseBuilder count(Integer count) {
+        public ListVolumesResponseBuilder count(Integer count) {
             this.count = count;
             return this;
         }
 
-        public ListStagesResponseBuilder currentPage(Integer currentPage) {
+        public ListVolumesResponseBuilder currentPage(Integer currentPage) {
             this.currentPage = currentPage;
             return this;
         }
 
-        public ListStagesResponseBuilder pageSize(Integer pageSize) {
+        public ListVolumesResponseBuilder pageSize(Integer pageSize) {
             this.pageSize = pageSize;
             return this;
         }
 
-        public ListStagesResponseBuilder stages(List<StageInfo> stages) {
-            this.stages = stages;
+        public ListVolumesResponseBuilder volumes(List<VolumeInfo> volumes) {
+            this.volumes = volumes;
             return this;
         }
 
-        public ListStagesResponse build() {
-            return new ListStagesResponse(this);
+        public ListVolumesResponse build() {
+            return new ListVolumesResponse(this);
         }
     }
 }

+ 52 - 0
sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/response/volume/VolumeInfo.java

@@ -0,0 +1,52 @@
+package io.milvus.bulkwriter.response.volume;
+
+public class VolumeInfo {
+    private String volumeName;
+
+    public VolumeInfo() {
+    }
+
+    public VolumeInfo(String volumeName) {
+        this.volumeName = volumeName;
+    }
+
+    private VolumeInfo(VolumeInfoBuilder builder) {
+        this.volumeName = builder.volumeName;
+    }
+
+    public String getVolumeName() {
+        return volumeName;
+    }
+
+    public void setVolumeName(String volumeName) {
+        this.volumeName = volumeName;
+    }
+
+    @Override
+    public String toString() {
+        return "VolumeInfo{" +
+                "volumeName='" + volumeName + '\'' +
+                '}';
+    }
+
+    public static VolumeInfoBuilder builder() {
+        return new VolumeInfoBuilder();
+    }
+
+    public static class VolumeInfoBuilder {
+        private String volumeName;
+
+        private VolumeInfoBuilder() {
+            this.volumeName = "";
+        }
+
+        public VolumeInfoBuilder volumeName(String volumeName) {
+            this.volumeName = volumeName;
+            return this;
+        }
+
+        public VolumeInfo build() {
+            return new VolumeInfo(this);
+        }
+    }
+}

+ 13 - 13
sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/restful/DataStageUtils.java → sdk-bulkwriter/src/main/java/io/milvus/bulkwriter/restful/DataVolumeUtils.java

@@ -21,18 +21,18 @@ package io.milvus.bulkwriter.restful;
 
 import com.google.gson.Gson;
 import com.google.gson.reflect.TypeToken;
-import io.milvus.bulkwriter.request.stage.BaseStageRequest;
-import io.milvus.bulkwriter.request.stage.CreateStageRequest;
-import io.milvus.bulkwriter.request.stage.DeleteStageRequest;
-import io.milvus.bulkwriter.request.stage.ListStagesRequest;
+import io.milvus.bulkwriter.request.volume.BaseVolumeRequest;
+import io.milvus.bulkwriter.request.volume.CreateVolumeRequest;
+import io.milvus.bulkwriter.request.volume.DeleteVolumeRequest;
+import io.milvus.bulkwriter.request.volume.ListVolumesRequest;
 import io.milvus.bulkwriter.response.RestfulResponse;
 import io.milvus.common.utils.JsonUtils;
 
 import java.util.Map;
 
-public class DataStageUtils extends BaseRestful {
-    public static String applyStage(String url, BaseStageRequest request) {
-        String requestURL = url + "/v2/stages/apply";
+public class DataVolumeUtils extends BaseRestful {
+    public static String applyVolume(String url, BaseVolumeRequest request) {
+        String requestURL = url + "/v2/volumes/apply";
 
         Map<String, Object> params = JsonUtils.fromJson(JsonUtils.toJson(request), new TypeToken<Map<String, Object>>() {
         }.getType());
@@ -43,8 +43,8 @@ public class DataStageUtils extends BaseRestful {
         return new Gson().toJson(response.getData());
     }
 
-    public static String listStages(String url, String apiKey, ListStagesRequest request) {
-        String requestURL = url + "/v2/stages";
+    public static String listVolumes(String url, String apiKey, ListVolumesRequest request) {
+        String requestURL = url + "/v2/volumes";
 
         Map<String, Object> params = JsonUtils.fromJson(JsonUtils.toJson(request), new TypeToken<Map<String, Object>>() {
         }.getType());
@@ -55,8 +55,8 @@ public class DataStageUtils extends BaseRestful {
         return new Gson().toJson(response.getData());
     }
 
-    public static void createStage(String url, String apiKey, CreateStageRequest request) {
-        String requestURL = url + "/v2/stages/create";
+    public static void createVolume(String url, String apiKey, CreateVolumeRequest request) {
+        String requestURL = url + "/v2/volumes/create";
 
         Map<String, Object> params = JsonUtils.fromJson(JsonUtils.toJson(request), new TypeToken<Map<String, Object>>() {
         }.getType());
@@ -66,8 +66,8 @@ public class DataStageUtils extends BaseRestful {
         handleResponse(requestURL, response);
     }
 
-    public static void deleteStage(String url, String apiKey, DeleteStageRequest request) {
-        String requestURL = url + "/v2/stages/" + request.getStageName();
+    public static void deleteVolume(String url, String apiKey, DeleteVolumeRequest request) {
+        String requestURL = url + "/v2/volumes/" + request.getVolumeName();
 
         Map<String, Object> params = JsonUtils.fromJson(JsonUtils.toJson(request), new TypeToken<Map<String, Object>>() {
         }.getType());