GetBulkInsertStateParam
A MilvusClient interface. This method gets the state of a bulk-insert task.
<GetImportStateResponse> getBulkInsertState(GetBulkInsertStateParam requestParam);
GetBulkInsertStateParam
Use the GetBulkInsertStateParam.Builder to construct a GetBulkInsertStateParam object.
import io.milvus.param.GetBulkInsertStateParam;
GetBulkInsertStateParam.Builder builder = GetBulkInsertStateParam.newBuilder();
Methods of GetBulkInsertStateParam.Builder:
| Method | Description | Parameters |
|---|---|---|
withTask(Long task) | Sets the bulk-insert task id returned by bulkInsert() to query. | task: A task id. |
build() | Constructs a GetBulkInsertStateParam object | N/A |
The GetBulkInsertStateParam.Builder.build() can throw the following exceptions:
ParamException: error if the parameter is invalid.
Returns
This method catches all the exceptions and returns an R<GetImportStateResponse> object. Since only one row-based JSON file is allowed for each call, this result contains one bulk insert task ID.
GetBulkInsertStateWrapper
A tool class to encapsulate the GetImportStateResponse.
import io.milvus.response.GetBulkInsertStateWrapper;
GetBulkInsertStateWrapper wrapper = new GetBulkInsertStateWrapper(response);
Methods of GetBulkInsertStateWrapper:
| Method | Description | Parameters | Returns |
|---|---|---|---|
getTaskID() | Gets ID of the bulk insert task. | N/A | long |
getAutoGeneratedIDs() | Gets the long ID array for auto-id primary key, generated by bulk insert task. | N/A | List |
getState() | Gets state of the bulk insert task. | N/A | ImportState |
getImportedCount() | Gets how many rows were imported by the bulk insert task. | N/A | long |
getCreateTimestamp() | Gets the integer timestamp when this task is created. | N/A | long |
getCreateTimeStr() | Gets the timestamp in string format when this task is created. | N/A | String |
getFailedReason() | Gets fail reason of the bulk insert task if it failed. | N/A | String |
getFiles() | Gets target files of the bulk insert task. | N/A | String |
getCollectionName() | Gets target collection name of the bulk insert task. | N/A | String |
getPartitionName() | Gets target partition name of the bulk insert task. | N/A | String |
getProgress() | Gets the working progress of a data-import task in percentage | N/A | int |
ImportState
package io.milvus.grpc;
public enum ImportState
| State | Code | Description |
|---|---|---|
| Pending | 0 | The task is in the pending list. |
| Failed | 1 | The task failed. Use getFailedReason() to get the failure description. |
| Started | 2 | The task is dispatched to the data node and going to be executed. |
| Persisted | 5 | New segments have been generated and persisted. |
| Completed | 6 | If the collection index has been specified, Completed indicates new segments have been indexed successfully. Otherwise, the task state will be directly converted from Persisted to Completed. |
| Failed and cleaned | 7 | The task failed, and the temporary data generated by this task has been cleaned. |