ImportState
Represents the state of a bulk-import task.
export enum ImportState {
ImportPending = 'ImportPending', // Task is in pending list
ImportFailed = 'ImportFailed', // Task is failed, use state.infos["failed_reason"] to get the failed reason
ImportStarted = 'ImportStarted', // Task is dispatched to data node, gonna to be executed.
ImportPersisted = 'ImportPersisted', // New segments have been generated and persisted.
ImportCompleted = 'ImportCompleted', // If the collection index has been specified, ImportCompleted indicates the new segments have been indexed successfully. Otherwise, the task state will be directly converted from ImportPersisted to ImportCompleted.
ImportFailedAndCleaned = 'ImportFailedAndCleaned', // The task is failed, and the temporary data generated by this task has been cleaned.
}
Constants:
ImportPending (‘ImportPending’)
The task is in the pending list.
ImportFailed (‘ImportFailed’)
The task failed; see
infos["failed_reason"]for the reason.ImportStarted (‘ImportStarted’)
The task has been dispatched to a data node and will be executed.
ImportPersisted (‘ImportPersisted’)
New segments have been generated and persisted.
ImportCompleted (‘ImportCompleted’)
The import completed; segments are indexed when an index was specified.
ImportFailedAndCleaned (‘ImportFailedAndCleaned’)
The task failed, and the temporary data generated by this task has been cleaned.
Example
import { MilvusClient } from '@zilliz/milvus2-sdk-node';
const milvusClient = new MilvusClient({
address: 'localhost:19530',
token: 'root:Milvus',
});
const res = await milvusClient.getImportState({
task: 454468498888852203,
});
console.log(res.state); // ImportState