milvus-logo

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:

MethodDescriptionParameters
withTask(Long task)Sets the bulk-insert task id returned by bulkInsert() to query.task: A task id.
build()Constructs a GetBulkInsertStateParam objectN/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:

MethodDescriptionParametersReturns
getTaskID()Gets ID of the bulk insert task.N/Along
getAutoGeneratedIDs()Gets the long ID array for auto-id primary key, generated by bulk insert task.N/AList
getState()Gets state of the bulk insert task.N/AImportState
getImportedCount()Gets how many rows were imported by the bulk insert task.N/Along
getCreateTimestamp()Gets the integer timestamp when this task is created.N/Along
getCreateTimeStr()Gets the timestamp in string format when this task is created.N/AString
getFailedReason()Gets fail reason of the bulk insert task if it failed.N/AString
getFiles()Gets target files of the bulk insert task.N/AString
getCollectionName()Gets target collection name of the bulk insert task.N/AString
getPartitionName()Gets target partition name of the bulk insert task.N/AString

ImportState

package io.milvus.grpc;
public enum ImportState
StateCodeDescription
Pending0The task is in the pending list.
Failed1The task failed. Use getFailedReason() to get the failure description.
Started2The task is dispatched to the data node and going to be executed.
Persisted5New segments have been generated and persisted.
Completed6If 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 cleaned7The task failed, and the temporary data generated by this task has been cleaned.