...
Code Block |
---|
service MilvusService { rpc Import(ImportRequest) returns (ImportResponse) {} rpc GetImportState(GetImportStateRequest) returns (GetImportStateResponse) {} } message ImportRequest { string collection_name = 1; // target collection string partition_name = 2; // target partition bool row_based = 3; // the file is row-based or column-based repeated string files = 4; // file paths to be imported repeated common.KeyValuePair options = 5; // import options, bucket, etc. } message ImportResponse { common.Status status = 1; repeated int64 tasks = 2; // id array of import tasks } message GetImportStateRequest { int64 task = 1; // id of an import task } enum ImportState { Pending ImportPending = 0; FailedImportFailed = 1; ParsingImportDownloaded = 2; PersistedImportParsed = 3; Indexing ImportPersisted = 4; CompletedImportCompleted = 5; } message GetImportStateResponse { common.Status status = 1; ImportState state = 2; // is this import task finished or not int64 row_count = 3; // if the task is finished, this value is how many rows are imported. if the task is not finished, this value is how many rows are parsed. return 0 if failed. repeated int64 id_list = 4; // auto generated ids if the primary key is autoid repeated common.KeyValuePair infos = 5; // more informations about the task, progress percent, file path, failed reason, etc. } |
...
The call chain of import worflow:
3. Rootcoord RPC interfaces
...
Code Block |
---|
service RootCoord { rpc Import(milvus.ImportRequest) returns (milvus.ImportResponse) {} rpc GetImportState(milvus.GetImportStateRequest) returns (milvus.GetImportStateResponse) {} rpc ReportImport(ImportResult) returns (common.Status) {} } message ImportResult { common.Status status = 1; repeated int64 segmentstask_id = 2; // id array of newthe sealed segmentstask int64 row_countcommon.ImportState state = 3; // state of the task repeated int64 segments = 4; // id array of new sealed segments repeated int64 auto_ids = 5; // auto-generated ids for auto-id primary key int64 row_count = 6; // how many rows are imported by this task repeated common.KeyValuePair infos = 47; // more informations about the task, file path, failed reason, etc. } |
...
Code Block |
---|
service DataCoord { rpc Import(ImportTask) returns (common.StatusImportTaskResponse) {} } message ImportTask { common.Status status = 1; string collection_name = 2; // target collection string partition_name = 3; // target collectionpartition stringbool partitionrow_namebased = 34; // target partition the file is row-based or column-based boolint64 rowtask_basedid = 4;5; // id of the task repeated string files = 6; // the file is row-based or column-based int64 task_id = 5; // file paths to be imported repeated common.KeyValuePair infos = 7; // more informations about the // id of the task repeated string files = 6; task, bucket, etc. } message ImportTaskResponse { common.Status status = 1; int64 datanode_id = 2; // file paths to be imported repeated common.KeyValuePair infos = 7; // morewhich informationsdatanode abouttakes thethis task, bucket, etc. } |
5. Datanode interfaces
The declaration of import API in datanode RPC:
...