Skip to content

Commit

Permalink
update code comments
Browse files Browse the repository at this point in the history
  • Loading branch information
shanghaikid committed Feb 28, 2023
1 parent 9b732d4 commit 5d93356
Show file tree
Hide file tree
Showing 8 changed files with 538 additions and 412 deletions.
276 changes: 171 additions & 105 deletions milvus/Collection.ts

Large diffs are not rendered by default.

224 changes: 115 additions & 109 deletions milvus/Data.ts

Large diffs are not rendered by default.

93 changes: 49 additions & 44 deletions milvus/MilvusIndex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,20 @@ export class Index extends Client {
* Create an index on a vector field. Note that index building is an async progress.
*
* @param data
* | Property | Type | Description |
* | :----------------- | :---- | :------------------------------- |
* | collection_name | String | Collection name |
* | field_name | String | Field name |
* | index_name | String | Index name is unique in one collection |
* | extra_params | Object | Parameters: { index_type: string; metric_type: string; params: string; }; |
* | timeout | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
* | Property | Type | Description |
* | :-- | :-- | :-- |
* | collection_name | String | Collection name |
* | field_name | String | Field name |
* | index_name | String | Index name is unique in one collection |
* | extra_params | Object | Parameters: { index_type: string; metric_type: string; params: string; }; |
* | timeout? | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
*
* @return
* | Property | Description |
* | :-------------| :-------- |
* | error_code | Error code number |
* | reason | Error cause |
* | Property | Description |
* | :-- | :-- |
* | error_code | Error code number |
* | reason | Error cause |
*
*
* #### Example
Expand Down Expand Up @@ -68,14 +69,15 @@ export class Index extends Client {
* Show index information. Current release of Milvus only supports showing latest built index.
*
* @param data
* | Property | Type | Description |
* | :----------------- | :---- | :------------------------------- |
* | collection_name | String | Collection name |
* | timeout | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
* | Property | Type | Description |
* | :-- | :-- | :-- |
* | collection_name | String | Collection name |
* | timeout? | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
*
* @return
* | Property | Description |
* | :-------------| :-------- |
* | :-- | :-- |
* | status | { error_code: number, reason: string } |
* | index_descriptions | Index information |
*
Expand Down Expand Up @@ -103,17 +105,18 @@ export class Index extends Client {
* Show index building state.
*
* @param data
* | Property | Type | Description |
* | :----------------- | :---- | :------------------------------- |
* | collection_name | string | Collection name |
* | field_name | string | Field name |
* | timeout | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
* | Property | Type | Description |
* | :-- | :-- | :-- |
* | collection_name | string | Collection name |
* | field_name | string | Field name |
* | timeout? | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
*
* @return
* | Property | Description |
* | :-------------| :-------- |
* | status | { error_code: number, reason: string } |
* | state | Index building state |
* | Property | Description |
* | :-- | :-- |
* | status | { error_code: number, reason: string } |
* | state | Index building state |
*
*
* #### Example
Expand All @@ -139,18 +142,19 @@ export class Index extends Client {
* Show index building progress.
*
* @param data
* | Property | Type | Description |
* | :----------------- | :---- | :------------------------------- |
* | collection_name | String | Collection name |
* | field_name | String | Field name |
* | timeout | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
* | Property | Type | Description |
* | :-- | :-- | :-- |
* | collection_name | String | Collection name |
* | field_name | String | Field name |
* | timeout? | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
*
* @return
* | Property | Description |
* | :-------------| :-------- |
* | status | { error_code: number, reason: string } |
* | indexed_rows | Row count that successfully built with index |
* | total_rows | Total row count |
* | Property | Description |
* | :-- | :-- |
* | status | { error_code: number, reason: string } |
* | indexed_rows | Row count that successfully built with index |
* | total_rows | Total row count |
*
*
*
Expand Down Expand Up @@ -179,17 +183,18 @@ export class Index extends Client {
* Drop an index.
*
* @param data
* | Property | Type | Description |
* | :----------------- | :---- | :------------------------------- |
* | collection_name | String | Collection name |
* | field_name | String | Field name |
* | timeout | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
* | Property | Type | Description |
* | :-- | :-- | :-- |
* | collection_name | String | Collection name |
* | field_name | String | Field name |
* | timeout? | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
*
* @return
* | Property | Description |
* | :-------------| :-------- |
* | error_code | Error code number |
* | reason | Error cause |
* | Property | Description |
* | :-- | :-- |
* | error_code | Error code number |
* | reason | Error cause |
*
* #### Example
*
Expand Down
126 changes: 66 additions & 60 deletions milvus/Partition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,18 @@ export class Partition extends Client {
* Create a partition in a collection.
*
* @param data
* | Property | Type | Description |
* | :----------------- | :---- | :------------------------------- |
* | collection_name | String | Collection name |
* | partition_name | String | Partition name |
* | timeout | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
* | Property | Type | Description |
* | :-- | :-- | :-- |
* | collection_name | String | Collection name |
* | partition_name | String | Partition name |
* | timeout? | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
*
* @return
* | Property | Description |
* | :-------------| :-------- |
* | error_code | Error code number |
* | reason | Error cause | *
* | Property | Description |
* | :-- | :-- |
* | error_code | Error code number |
* | reason | Error cause |
*
* #### Example
*
Expand All @@ -61,17 +62,18 @@ export class Partition extends Client {
* Check if a partition exists in a collection.
*
* @param data
* | Property | Type | Description |
* | :----------------- | :---- | :------------------------------- |
* | collection_name | string | Collection name |
* | partition_name | string | Parititon name |
* | timeout | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
* | Property | Type | Description |
* | :-- | :-- | :-- |
* | collection_name | string | Collection name |
* | partition_name | string | Parititon name |
* | timeout? | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
*
* @return
* | Property | Description |
* | :-------------| :------------------------------- |
* | status | { error_code: number,reason:string }|
* | value | `true` or `false` |
* | Property | Description |
* | :-- | :-- |
* | status | { error_code: number,reason:string } |
* | value | `true` or `false` |
*
* #### Example
*
Expand All @@ -97,17 +99,18 @@ export class Partition extends Client {
* Show all partitions in a collection.
*
* @param data
* | Property | Type | Description |
* | :----------------- | :---- | :------------------------------- |
* | collection_name | String | Collection name |
* | timeout | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
* | Property | Type | Description |
* | :-- | :-- | :-- |
* | collection_name | String | Collection name |
* | timeout? | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
*
* @return
* | Property | Description |
* | :-------------| :------------------------------- |
* | status | { error_code: number, reason: string }|
* | partition_names | Array of partition names |
* | partitionIDs | Array of partition IDs |
* | Property | Description |
* | :-- | :-- |
* | status | { error_code: number, reason: string } |
* | partition_names | Array of partition names |
* | partitionIDs | Array of partition IDs |
*
*
* #### Example
Expand Down Expand Up @@ -135,18 +138,19 @@ export class Partition extends Client {
* Show the statistics information of a partition.
*
* @param data
* | Property | Type | Description |
* | :----------------- | :---- | :------------------------------- |
* | collection_name | String | Collection name |
* | partition_name | String | Partition name |
* | timeout | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
* | Property | Type | Description |
* | :-- | :-- | :-- |
* | collection_name | String | Collection name |
* | partition_name | String | Partition name |
* | timeout? | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
*
* @return
* | Property | Description |
* | :-------------| :------------------------------- |
* | status | { error_code: number, reason: string }|
* | stats | [{key: string, value: string}] |
* | data | { row_count: 0 } transformed from **stats** |
* | Property | Description |
* | :-- | :-- |
* | status | { error_code: number, reason: string } |
* | stats | [{key: string, value: string}] |
* | data | { row_count: 0 } transformed from **stats** |
*
*
* #### Example
Expand Down Expand Up @@ -176,17 +180,17 @@ export class Partition extends Client {
* Load multiple partitions into query nodes.
*
* @param data
* | Property | Type | Description |
* | :--- | :-- | :-- |
* | Property | Type | Description |
* | :--- | :-- | :-- |
* | collection_name | String | Collection name |
* | partition_names | String[] | Array of partition names |
* | replica_number? | number | replica number |
* | resource_groups | String[] | resource group names |
* | timeout | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
* | timeout? | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
*
* @return
* | Property | Description |
* | :-------------| :-------- |
* | :-- | :-- |
* | error_code | Error code number |
* | reason | Error cause |
*
Expand Down Expand Up @@ -217,18 +221,19 @@ export class Partition extends Client {
* Release a partition from cache.
*
* @param data
* | Property | Type | Description |
* | :----------------- | :---- | :------------------------------- |
* | collection_name | String | Collection name |
* | partition_names | String[] | Array of partition names |
* | timeout | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
* | Property | Type | Description |
* | :-- | :-- | :-- |
* | collection_name | String | Collection name |
* | partition_names | String[] | Array of partition names |
* | timeout? | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
*
* @return
* | Property | Description |
* | :-------------| :-------- |
* | error_code | Error code number |
* | reason | Error cause | *
*
* | Property | Description |
* | :-- | :-- |
* | error_code | Error code number |
* | reason | Error cause |
*
* #### Example
*
* ```
Expand Down Expand Up @@ -262,17 +267,18 @@ export class Partition extends Client {
* To drop a partition will drop all data in this partition and the `_default` partition cannot be dropped.
*
* @param data
* | Property | Type | Description |
* | :----------------- | :---- | :------------------------------- |
* | collection_name | String | Collection name |
* | partition_name | String | Partition name |
* | timeout | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
* | Property | Type | Description |
* | :-- | :-- | :-- |
* | collection_name | String | Collection name |
* | partition_name | String | Partition name |
* | timeout? | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
*
* @return
* | Property | Description |
* | :-------------| :-------- |
* | error_code | Error code number |
* | reason | Error cause | *
* | Property | Description |
* | :-- | :-- |
* | error_code | Error code number |
* | reason | Error cause |
*
* #### Example
*
Expand Down
Loading

0 comments on commit 5d93356

Please sign in to comment.