Browse Source

remove unused API

Signed-off-by: ruiyi.jiang <ruiyi.jiang@zilliz.com>
ruiyi.jiang 1 year ago
parent
commit
ff242bc255

+ 0 - 16
client/src/http/MilvusIndex.ts

@@ -52,22 +52,6 @@ export class IndexHttp extends BaseModel implements IndexView {
     return super.batchDelete({ path, data: { ...param, type } });
   }
 
-  static async getIndexBuildProgress(
-    collectionName: string,
-    fieldName: string,
-    indexName: string
-  ) {
-    const path = `${this.BASE_URL}/progress`;
-    return super.search({
-      path,
-      params: {
-        collection_name: collectionName,
-        field_name: fieldName,
-        index_name: indexName,
-      },
-    });
-  }
-
   get _indexType() {
     return this.params.find(p => p.key === 'index_type')?.value || '';
   }

+ 7 - 7
server/src/collections/collections.service.ts

@@ -141,8 +141,8 @@ export class CollectionsService {
    * @param data
    * @returns
    */
-  async getIndexStatus(data: GetIndexStateReq) {
-    const res = await this.milvusService.client.getIndexState(data);
+  async getIndexInfo(data: GetIndexStateReq) {
+    const res = await this.milvusService.client.describeIndex(data);
     return res;
   }
 
@@ -167,7 +167,7 @@ export class CollectionsService {
           collection_name: name,
         });
 
-        const indexRes = await this.getIndexStatus({
+        const indexRes = await this.getIndexInfo({
           collection_name: item.name,
         });
 
@@ -204,7 +204,7 @@ export class CollectionsService {
           id: collectionInfo.collectionID,
           loadedPercentage,
           createdTime: parseInt(collectionInfo.created_utc_timestamp, 10),
-          index_status: indexRes.state,
+          index_descriptions: indexRes,
           consistency_level: collectionInfo.consistency_level,
           replicas: replicas && replicas.replicas,
         });
@@ -261,19 +261,19 @@ export class CollectionsService {
 
   /**
    * Get all collection index status
-   * @returns {collection_name:string, index_status: IndexState}[]
+   * @returns {collection_name:string, index_descriptions: index_descriptions}[]
    */
   async getCollectionsIndexStatus() {
     const data = [];
     const res = await this.getCollections();
     if (res.data.length > 0) {
       for (const item of res.data) {
-        const indexRes = await this.getIndexStatus({
+        const indexRes = await this.getIndexInfo({
           collection_name: item.name,
         });
         data.push({
           collection_name: item.name,
-          index_status: indexRes.state,
+          index_descriptions: indexRes,
         });
       }
     }

+ 0 - 37
server/src/schema/schema.controller.ts

@@ -23,10 +23,6 @@ export class SchemaController {
 
     this.router.get('/index', this.describeIndex.bind(this));
 
-    this.router.get('/index/progress', this.getIndexBuildProgress.bind(this));
-
-    this.router.get('/index/state', this.getIndexState.bind(this));
-
     return this.router;
   }
 
@@ -64,37 +60,4 @@ export class SchemaController {
       next(error);
     }
   }
-
-  async getIndexBuildProgress(req: Request, res: Response, next: NextFunction) {
-    const collection_name = '' + req.query?.collection_name;
-    const index_name = '' + req.query?.index_name;
-    const field_name = '' + req.query?.field_name;
-    try {
-      const result = await this.schemaService.getIndexBuildProgress({
-        collection_name,
-        index_name,
-        field_name,
-      });
-      res.send(result);
-    } catch (error) {
-      next(error);
-    }
-  }
-
-  async getIndexState(req: Request, res: Response, next: NextFunction) {
-    const collection_name = '' + req.query?.collection_name;
-    const index_name = '' + req.query?.index_name;
-    const field_name = '' + req.query?.field_name;
-
-    try {
-      const result = await this.schemaService.getIndexState({
-        collection_name,
-        index_name,
-        field_name,
-      });
-      res.send(result);
-    } catch (error) {
-      next(error);
-    }
-  }
 }

+ 0 - 12
server/src/schema/schema.service.ts

@@ -31,16 +31,4 @@ export class SchemaService {
     throwErrorFromSDK(res);
     return res;
   }
-
-  async getIndexState(data: GetIndexStateReq) {
-    const res = await this.milvusService.client.getIndexState(data);
-    throwErrorFromSDK(res.status);
-    return res;
-  }
-
-  async getIndexBuildProgress(data: GetIndexBuildProgressReq) {
-    const res = await this.milvusService.client.getIndexBuildProgress(data);
-    throwErrorFromSDK(res.status);
-    return res;
-  }
 }