@zilliz/milvus2-sdk-node 2.2.3 → 2.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -21
- package/dist/milvus/BaseClient.d.ts +17 -0
- package/dist/milvus/BaseClient.js +58 -0
- package/dist/milvus/BaseClient.js.map +1 -0
- package/dist/milvus/Collection.d.ts +263 -171
- package/dist/milvus/Collection.js +328 -233
- package/dist/milvus/Collection.js.map +1 -1
- package/dist/milvus/Data.d.ts +142 -142
- package/dist/milvus/Data.js +211 -216
- package/dist/milvus/Data.js.map +1 -1
- package/dist/milvus/MilvusClient.d.ts +17 -0
- package/dist/milvus/MilvusClient.js +163 -0
- package/dist/milvus/MilvusClient.js.map +1 -0
- package/dist/milvus/MilvusIndex.d.ts +64 -60
- package/dist/milvus/MilvusIndex.js +74 -69
- package/dist/milvus/MilvusIndex.js.map +1 -1
- package/dist/milvus/Partition.d.ts +95 -88
- package/dist/milvus/Partition.js +108 -101
- package/dist/milvus/Partition.js.map +1 -1
- package/dist/milvus/Resource.d.ts +172 -0
- package/dist/milvus/Resource.js +356 -0
- package/dist/milvus/Resource.js.map +1 -0
- package/dist/milvus/User.d.ts +136 -110
- package/dist/milvus/User.js +171 -140
- package/dist/milvus/User.js.map +1 -1
- package/dist/milvus/Utils.d.ts +1 -1
- package/dist/milvus/Utils.js +1 -1
- package/dist/milvus/Utils.js.map +1 -1
- package/dist/milvus/const/Milvus.d.ts +270 -0
- package/dist/milvus/const/Milvus.js +370 -1
- package/dist/milvus/const/Milvus.js.map +1 -1
- package/dist/milvus/index.d.ts +11 -46
- package/dist/milvus/index.js +16 -186
- package/dist/milvus/index.js.map +1 -1
- package/dist/milvus/types/Collection.d.ts +88 -8
- package/dist/milvus/types/Collection.js +1 -9
- package/dist/milvus/types/Collection.js.map +1 -1
- package/dist/milvus/types/Common.d.ts +11 -267
- package/dist/milvus/types/Common.js +1 -369
- package/dist/milvus/types/Common.js.map +1 -1
- package/dist/milvus/types/Data.d.ts +154 -1
- package/dist/milvus/types/Index.d.ts +20 -1
- package/dist/milvus/types/Partition.d.ts +8 -1
- package/dist/milvus/types/Resource.d.ts +44 -0
- package/dist/milvus/types/{Search.js → Resource.js} +1 -1
- package/dist/milvus/types/Resource.js.map +1 -0
- package/dist/milvus/types/Response.d.ts +0 -246
- package/dist/milvus/types/Response.js.map +1 -1
- package/dist/milvus/types/User.d.ts +54 -2
- package/dist/milvus/types.d.ts +8 -7
- package/dist/milvus/types.js +2 -1
- package/dist/milvus/types.js.map +1 -1
- package/dist/proto/proto/common.proto +23 -2
- package/dist/proto/proto/feder.proto +40 -0
- package/dist/proto/proto/google/protobuf/descriptor.proto +31 -1
- package/dist/proto/proto/milvus.proto +101 -0
- package/dist/proto/proto/msg.proto +107 -0
- package/dist/proto/proto/schema.proto +18 -23
- package/dist/sdk.json +1 -1
- package/dist/utils/Blob.js.map +1 -0
- package/dist/{milvus/utils → utils}/Format.d.ts +12 -11
- package/dist/{milvus/utils → utils}/Format.js +18 -17
- package/dist/utils/Format.js.map +1 -0
- package/dist/utils/Function.d.ts +4 -0
- package/dist/utils/Function.js +33 -0
- package/dist/utils/Function.js.map +1 -0
- package/dist/utils/Grpc.d.ts +19 -0
- package/dist/utils/Grpc.js +64 -0
- package/dist/utils/Grpc.js.map +1 -0
- package/dist/utils/Validate.d.ts +21 -0
- package/dist/{milvus/utils → utils}/Validate.js +28 -6
- package/dist/utils/Validate.js.map +1 -0
- package/dist/utils/index.d.ts +5 -7
- package/dist/utils/index.js +17 -52
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/test.d.ts +14 -0
- package/dist/utils/test.js +68 -0
- package/dist/utils/test.js.map +1 -0
- package/package.json +7 -12
- package/dist/milvus/Client.d.ts +0 -12
- package/dist/milvus/Client.js +0 -28
- package/dist/milvus/Client.js.map +0 -1
- package/dist/milvus/types/Search.d.ts +0 -81
- package/dist/milvus/types/Search.js.map +0 -1
- package/dist/milvus/utils/Blob.js.map +0 -1
- package/dist/milvus/utils/Format.js.map +0 -1
- package/dist/milvus/utils/Validate.d.ts +0 -9
- package/dist/milvus/utils/Validate.js.map +0 -1
- package/dist/milvus/utils/index.d.ts +0 -3
- package/dist/milvus/utils/index.js +0 -10
- package/dist/milvus/utils/index.js.map +0 -1
- /package/dist/{milvus/utils → utils}/Blob.d.ts +0 -0
- /package/dist/{milvus/utils → utils}/Blob.js +0 -0
package/dist/milvus/Partition.js
CHANGED
|
@@ -29,7 +29,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
29
29
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
30
|
function step(op) {
|
|
31
31
|
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
-
while (_) try {
|
|
32
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
33
33
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
34
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
35
|
switch (op[0]) {
|
|
@@ -52,10 +52,9 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
52
52
|
};
|
|
53
53
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
54
|
exports.Partition = void 0;
|
|
55
|
+
var MilvusIndex_1 = require("./MilvusIndex");
|
|
55
56
|
var utils_1 = require("../utils");
|
|
56
|
-
var
|
|
57
|
-
var ErrorReason_1 = require("./const/ErrorReason");
|
|
58
|
-
var Format_1 = require("./utils/Format");
|
|
57
|
+
var _1 = require(".");
|
|
59
58
|
var Partition = /** @class */ (function (_super) {
|
|
60
59
|
__extends(Partition, _super);
|
|
61
60
|
function Partition() {
|
|
@@ -65,22 +64,23 @@ var Partition = /** @class */ (function (_super) {
|
|
|
65
64
|
* Create a partition in a collection.
|
|
66
65
|
*
|
|
67
66
|
* @param data
|
|
68
|
-
* | Property
|
|
69
|
-
* |
|
|
70
|
-
* | collection_name
|
|
71
|
-
* | partition_name
|
|
72
|
-
* | timeout
|
|
67
|
+
* | Property | Type | Description |
|
|
68
|
+
* | :-- | :-- | :-- |
|
|
69
|
+
* | collection_name | String | Collection name |
|
|
70
|
+
* | partition_name | String | Partition name |
|
|
71
|
+
* | 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 |
|
|
72
|
+
|
|
73
73
|
*
|
|
74
|
-
* @
|
|
75
|
-
* | Property
|
|
76
|
-
* |
|
|
77
|
-
* | error_code
|
|
78
|
-
* | reason
|
|
74
|
+
* @returns
|
|
75
|
+
* | Property | Description |
|
|
76
|
+
* | :-- | :-- |
|
|
77
|
+
* | error_code | Error code number |
|
|
78
|
+
* | reason | Error cause |
|
|
79
79
|
*
|
|
80
80
|
* #### Example
|
|
81
81
|
*
|
|
82
82
|
* ```
|
|
83
|
-
* new milvusClient(MILUVS_ADDRESS).
|
|
83
|
+
* new milvusClient(MILUVS_ADDRESS).createPartition({
|
|
84
84
|
* collection_name: 'my_collection',
|
|
85
85
|
* partition_name: 'my_partition',
|
|
86
86
|
* });
|
|
@@ -92,8 +92,8 @@ var Partition = /** @class */ (function (_super) {
|
|
|
92
92
|
return __generator(this, function (_a) {
|
|
93
93
|
switch (_a.label) {
|
|
94
94
|
case 0:
|
|
95
|
-
|
|
96
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
95
|
+
(0, utils_1.checkCollectionAndPartitionName)(data);
|
|
96
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.grpcClient, 'CreatePartition', data, data.timeout)];
|
|
97
97
|
case 1:
|
|
98
98
|
promise = _a.sent();
|
|
99
99
|
return [2 /*return*/, promise];
|
|
@@ -105,22 +105,23 @@ var Partition = /** @class */ (function (_super) {
|
|
|
105
105
|
* Check if a partition exists in a collection.
|
|
106
106
|
*
|
|
107
107
|
* @param data
|
|
108
|
-
* | Property
|
|
109
|
-
* |
|
|
110
|
-
* | collection_name
|
|
111
|
-
* | partition_name
|
|
112
|
-
* | timeout
|
|
108
|
+
* | Property | Type | Description |
|
|
109
|
+
* | :-- | :-- | :-- |
|
|
110
|
+
* | collection_name | string | Collection name |
|
|
111
|
+
* | partition_name | string | Parititon name |
|
|
112
|
+
* | 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 |
|
|
113
|
+
|
|
113
114
|
*
|
|
114
|
-
* @
|
|
115
|
-
*
|
|
116
|
-
* |
|
|
117
|
-
* | status
|
|
118
|
-
* | value
|
|
115
|
+
* @returns
|
|
116
|
+
* | Property | Description |
|
|
117
|
+
* | :-- | :-- |
|
|
118
|
+
* | status | { error_code: number,reason:string } |
|
|
119
|
+
* | value | `true` or `false` |
|
|
119
120
|
*
|
|
120
121
|
* #### Example
|
|
121
122
|
*
|
|
122
123
|
* ```
|
|
123
|
-
* new milvusClient(MILUVS_ADDRESS).
|
|
124
|
+
* new milvusClient(MILUVS_ADDRESS).hasPartition({
|
|
124
125
|
* collection_name: 'my_collection',
|
|
125
126
|
* partition_name: 'my_partition',
|
|
126
127
|
* });
|
|
@@ -132,8 +133,8 @@ var Partition = /** @class */ (function (_super) {
|
|
|
132
133
|
return __generator(this, function (_a) {
|
|
133
134
|
switch (_a.label) {
|
|
134
135
|
case 0:
|
|
135
|
-
|
|
136
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
136
|
+
(0, utils_1.checkCollectionAndPartitionName)(data);
|
|
137
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.grpcClient, 'HasPartition', data, data.timeout)];
|
|
137
138
|
case 1:
|
|
138
139
|
promise = _a.sent();
|
|
139
140
|
return [2 /*return*/, promise];
|
|
@@ -145,23 +146,24 @@ var Partition = /** @class */ (function (_super) {
|
|
|
145
146
|
* Show all partitions in a collection.
|
|
146
147
|
*
|
|
147
148
|
* @param data
|
|
148
|
-
* | Property
|
|
149
|
-
* |
|
|
150
|
-
* | collection_name
|
|
151
|
-
* | timeout
|
|
149
|
+
* | Property | Type | Description |
|
|
150
|
+
* | :-- | :-- | :-- |
|
|
151
|
+
* | collection_name | String | Collection name |
|
|
152
|
+
* | 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 |
|
|
153
|
+
|
|
152
154
|
*
|
|
153
|
-
* @
|
|
154
|
-
*
|
|
155
|
-
* |
|
|
156
|
-
* | status
|
|
157
|
-
* | partition_names
|
|
158
|
-
* | partitionIDs
|
|
155
|
+
* @returns
|
|
156
|
+
* | Property | Description |
|
|
157
|
+
* | :-- | :-- |
|
|
158
|
+
* | status | { error_code: number, reason: string } |
|
|
159
|
+
* | partition_names | Array of partition names |
|
|
160
|
+
* | partitionIDs | Array of partition IDs |
|
|
159
161
|
*
|
|
160
162
|
*
|
|
161
163
|
* #### Example
|
|
162
164
|
*
|
|
163
165
|
* ```
|
|
164
|
-
* new milvusClient(MILUVS_ADDRESS).
|
|
166
|
+
* new milvusClient(MILUVS_ADDRESS).showPartitions({
|
|
165
167
|
* collection_name: 'my_collection',
|
|
166
168
|
* });
|
|
167
169
|
* ```
|
|
@@ -172,8 +174,8 @@ var Partition = /** @class */ (function (_super) {
|
|
|
172
174
|
return __generator(this, function (_a) {
|
|
173
175
|
switch (_a.label) {
|
|
174
176
|
case 0:
|
|
175
|
-
|
|
176
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
177
|
+
(0, utils_1.checkCollectionName)(data);
|
|
178
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.grpcClient, 'ShowPartitions', data, data.timeout)];
|
|
177
179
|
case 1:
|
|
178
180
|
promise = _a.sent();
|
|
179
181
|
return [2 /*return*/, promise];
|
|
@@ -185,24 +187,25 @@ var Partition = /** @class */ (function (_super) {
|
|
|
185
187
|
* Show the statistics information of a partition.
|
|
186
188
|
*
|
|
187
189
|
* @param data
|
|
188
|
-
* | Property
|
|
189
|
-
* |
|
|
190
|
-
* | collection_name
|
|
191
|
-
* | partition_name
|
|
192
|
-
* | timeout
|
|
190
|
+
* | Property | Type | Description |
|
|
191
|
+
* | :-- | :-- | :-- |
|
|
192
|
+
* | collection_name | String | Collection name |
|
|
193
|
+
* | partition_name | String | Partition name |
|
|
194
|
+
* | 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 |
|
|
195
|
+
|
|
193
196
|
*
|
|
194
|
-
* @
|
|
195
|
-
*
|
|
196
|
-
* |
|
|
197
|
-
* | status
|
|
198
|
-
* | stats
|
|
199
|
-
* | data |
|
|
197
|
+
* @returns
|
|
198
|
+
* | Property | Description |
|
|
199
|
+
* | :-- | :-- |
|
|
200
|
+
* | status | { error_code: number, reason: string } |
|
|
201
|
+
* | stats | [{key: string, value: string}] |
|
|
202
|
+
* | data | { row_count: 0 } transformed from **stats** |
|
|
200
203
|
*
|
|
201
204
|
*
|
|
202
205
|
* #### Example
|
|
203
206
|
*
|
|
204
207
|
* ```
|
|
205
|
-
* new milvusClient(MILUVS_ADDRESS).
|
|
208
|
+
* new milvusClient(MILUVS_ADDRESS).getPartitionStatistics({
|
|
206
209
|
* collection_name: 'my_collection',
|
|
207
210
|
* partition_name: "_default",
|
|
208
211
|
* });
|
|
@@ -214,36 +217,38 @@ var Partition = /** @class */ (function (_super) {
|
|
|
214
217
|
return __generator(this, function (_a) {
|
|
215
218
|
switch (_a.label) {
|
|
216
219
|
case 0:
|
|
217
|
-
|
|
218
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
220
|
+
(0, utils_1.checkCollectionAndPartitionName)(data);
|
|
221
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.grpcClient, 'GetPartitionStatistics', data, data.timeout)];
|
|
219
222
|
case 1:
|
|
220
223
|
promise = _a.sent();
|
|
221
|
-
promise.data = (0,
|
|
224
|
+
promise.data = (0, utils_1.formatKeyValueData)(promise.stats, ['row_count']);
|
|
222
225
|
return [2 /*return*/, promise];
|
|
223
226
|
}
|
|
224
227
|
});
|
|
225
228
|
});
|
|
226
229
|
};
|
|
227
230
|
/**
|
|
228
|
-
* Load
|
|
231
|
+
* Load multiple partitions into query nodes.
|
|
229
232
|
*
|
|
230
233
|
* @param data
|
|
231
|
-
* | Property
|
|
232
|
-
* |
|
|
233
|
-
* | collection_name
|
|
234
|
-
* | partition_names
|
|
235
|
-
* |
|
|
234
|
+
* | Property | Type | Description |
|
|
235
|
+
* | :--- | :-- | :-- |
|
|
236
|
+
* | collection_name | String | Collection name |
|
|
237
|
+
* | partition_names | String[] | Array of partition names |
|
|
238
|
+
* | replica_number? | number | replica number |
|
|
239
|
+
* | resource_groups | String[] | resource group names |
|
|
240
|
+
* | 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 |
|
|
236
241
|
*
|
|
237
|
-
* @
|
|
238
|
-
* | Property
|
|
239
|
-
* |
|
|
240
|
-
* | error_code
|
|
241
|
-
* | reason
|
|
242
|
+
* @returns
|
|
243
|
+
* | Property | Description |
|
|
244
|
+
* | :-- | :-- |
|
|
245
|
+
* | error_code | Error code number |
|
|
246
|
+
* | reason | Error cause |
|
|
242
247
|
*
|
|
243
248
|
* #### Example
|
|
244
249
|
*
|
|
245
250
|
* ```
|
|
246
|
-
* new milvusClient(MILUVS_ADDRESS).
|
|
251
|
+
* new milvusClient(MILUVS_ADDRESS).loadPartitions({
|
|
247
252
|
* collection_name: 'my_collection',
|
|
248
253
|
* partition_names: ['my_partition'],
|
|
249
254
|
* });
|
|
@@ -255,11 +260,11 @@ var Partition = /** @class */ (function (_super) {
|
|
|
255
260
|
return __generator(this, function (_a) {
|
|
256
261
|
switch (_a.label) {
|
|
257
262
|
case 0:
|
|
258
|
-
|
|
263
|
+
(0, utils_1.checkCollectionName)(data);
|
|
259
264
|
if (!Array.isArray(data.partition_names) || !data.partition_names.length) {
|
|
260
|
-
throw new Error(
|
|
265
|
+
throw new Error(_1.ERROR_REASONS.PARTITION_NAMES_IS_REQUIRED);
|
|
261
266
|
}
|
|
262
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
267
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.grpcClient, 'LoadPartitions', data, data.timeout)];
|
|
263
268
|
case 1:
|
|
264
269
|
promise = _a.sent();
|
|
265
270
|
return [2 /*return*/, promise];
|
|
@@ -271,22 +276,23 @@ var Partition = /** @class */ (function (_super) {
|
|
|
271
276
|
* Release a partition from cache.
|
|
272
277
|
*
|
|
273
278
|
* @param data
|
|
274
|
-
* | Property
|
|
275
|
-
* |
|
|
276
|
-
* | collection_name
|
|
277
|
-
* | partition_names
|
|
278
|
-
* | timeout
|
|
279
|
+
* | Property | Type | Description |
|
|
280
|
+
* | :-- | :-- | :-- |
|
|
281
|
+
* | collection_name | String | Collection name |
|
|
282
|
+
* | partition_names | String[] | Array of partition names |
|
|
283
|
+
* | 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 |
|
|
284
|
+
|
|
279
285
|
*
|
|
280
|
-
* @
|
|
281
|
-
* | Property
|
|
282
|
-
* |
|
|
283
|
-
* | error_code
|
|
284
|
-
* | reason
|
|
286
|
+
* @returns
|
|
287
|
+
* | Property | Description |
|
|
288
|
+
* | :-- | :-- |
|
|
289
|
+
* | error_code | Error code number |
|
|
290
|
+
* | reason | Error cause |
|
|
285
291
|
*
|
|
286
292
|
* #### Example
|
|
287
293
|
*
|
|
288
294
|
* ```
|
|
289
|
-
* new milvusClient(MILUVS_ADDRESS).
|
|
295
|
+
* new milvusClient(MILUVS_ADDRESS).releasePartitions({
|
|
290
296
|
* collection_name: 'my_collection',
|
|
291
297
|
* partition_names: ['my_partition'],
|
|
292
298
|
* });
|
|
@@ -298,11 +304,11 @@ var Partition = /** @class */ (function (_super) {
|
|
|
298
304
|
return __generator(this, function (_a) {
|
|
299
305
|
switch (_a.label) {
|
|
300
306
|
case 0:
|
|
301
|
-
|
|
307
|
+
(0, utils_1.checkCollectionName)(data);
|
|
302
308
|
if (!Array.isArray(data.partition_names) || !data.partition_names.length) {
|
|
303
|
-
throw new Error(
|
|
309
|
+
throw new Error(_1.ERROR_REASONS.PARTITION_NAMES_IS_REQUIRED);
|
|
304
310
|
}
|
|
305
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
311
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.grpcClient, 'ReleasePartitions', data, data.timeout)];
|
|
306
312
|
case 1:
|
|
307
313
|
promise = _a.sent();
|
|
308
314
|
return [2 /*return*/, promise];
|
|
@@ -320,22 +326,23 @@ var Partition = /** @class */ (function (_super) {
|
|
|
320
326
|
* To drop a partition will drop all data in this partition and the `_default` partition cannot be dropped.
|
|
321
327
|
*
|
|
322
328
|
* @param data
|
|
323
|
-
* | Property
|
|
324
|
-
* |
|
|
325
|
-
* | collection_name
|
|
326
|
-
* | partition_name
|
|
327
|
-
* | timeout
|
|
329
|
+
* | Property | Type | Description |
|
|
330
|
+
* | :-- | :-- | :-- |
|
|
331
|
+
* | collection_name | String | Collection name |
|
|
332
|
+
* | partition_name | String | Partition name |
|
|
333
|
+
* | 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 |
|
|
334
|
+
|
|
328
335
|
*
|
|
329
|
-
* @
|
|
330
|
-
* | Property
|
|
331
|
-
* |
|
|
332
|
-
* | error_code
|
|
333
|
-
* | reason
|
|
336
|
+
* @returns
|
|
337
|
+
* | Property | Description |
|
|
338
|
+
* | :-- | :-- |
|
|
339
|
+
* | error_code | Error code number |
|
|
340
|
+
* | reason | Error cause |
|
|
334
341
|
*
|
|
335
342
|
* #### Example
|
|
336
343
|
*
|
|
337
344
|
* ```
|
|
338
|
-
* new milvusClient(MILUVS_ADDRESS).
|
|
345
|
+
* new milvusClient(MILUVS_ADDRESS).dropPartition({
|
|
339
346
|
* collection_name: 'my_collection',
|
|
340
347
|
* partition_name: 'my_partition',
|
|
341
348
|
* });
|
|
@@ -347,8 +354,8 @@ var Partition = /** @class */ (function (_super) {
|
|
|
347
354
|
return __generator(this, function (_a) {
|
|
348
355
|
switch (_a.label) {
|
|
349
356
|
case 0:
|
|
350
|
-
|
|
351
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
357
|
+
(0, utils_1.checkCollectionAndPartitionName)(data);
|
|
358
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.grpcClient, 'DropPartition', data, data.timeout)];
|
|
352
359
|
case 1:
|
|
353
360
|
promise = _a.sent();
|
|
354
361
|
return [2 /*return*/, promise];
|
|
@@ -357,6 +364,6 @@ var Partition = /** @class */ (function (_super) {
|
|
|
357
364
|
});
|
|
358
365
|
};
|
|
359
366
|
return Partition;
|
|
360
|
-
}(
|
|
367
|
+
}(MilvusIndex_1.Index));
|
|
361
368
|
exports.Partition = Partition;
|
|
362
369
|
//# sourceMappingURL=Partition.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Partition.js","sourceRoot":"","sources":["../../milvus/Partition.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"Partition.js","sourceRoot":"","sources":["../../milvus/Partition.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAsC;AACtC,kCAKkB;AAClB,sBAaW;AAEX;IAA+B,6BAAK;IAApC;;IAuRA,CAAC;IAtRC;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACG,mCAAe,GAArB,UAAsB,IAAwB;;;;;;wBAC5C,IAAA,uCAA+B,EAAC,IAAI,CAAC,CAAC;wBACtB,qBAAM,IAAA,iBAAS,EAC7B,IAAI,CAAC,UAAU,EACf,iBAA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BAAS"}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { Partition } from './Partition';
|
|
2
|
+
import { ResStatus, GrpcTimeOut, CreateResourceGroupReq, DropResourceGroupsReq, ListResourceGroupsResponse, DesribeResourceGroupsReq, DescribeResourceGroupResponse, TransferNodeReq, TransferReplicaReq } from '.';
|
|
3
|
+
export declare class Resource extends Partition {
|
|
4
|
+
/**
|
|
5
|
+
* Create a resource group.
|
|
6
|
+
*
|
|
7
|
+
* @param data
|
|
8
|
+
* | Property | Type | Description |
|
|
9
|
+
* | :--- | :-- | :-- |
|
|
10
|
+
* | resource_group | String | Resource group name |
|
|
11
|
+
* | 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 |
|
|
12
|
+
*
|
|
13
|
+
* @returns
|
|
14
|
+
* | Property | Type | Description |
|
|
15
|
+
* | :-- | :-- | :-- |
|
|
16
|
+
* | status.error_code | string | error code |
|
|
17
|
+
* | status.reason | string | error reason |
|
|
18
|
+
*
|
|
19
|
+
* #### Example
|
|
20
|
+
*
|
|
21
|
+
* ```
|
|
22
|
+
* new milvusClient(MILUVS_ADDRESS).createResourceGroup({
|
|
23
|
+
* resource_group: "vector_01",
|
|
24
|
+
* });
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
createResourceGroup(data: CreateResourceGroupReq): Promise<ResStatus>;
|
|
28
|
+
/**
|
|
29
|
+
* list resource groups.
|
|
30
|
+
*
|
|
31
|
+
* @returns
|
|
32
|
+
* | Property | Type | Description |
|
|
33
|
+
* | :-- | :-- | :-- |
|
|
34
|
+
* | status.error_code | string | error code |
|
|
35
|
+
* | status.reason | string | error reason |
|
|
36
|
+
* | resource_groups | string[] | Resource group string array |
|
|
37
|
+
* | 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 |
|
|
38
|
+
*
|
|
39
|
+
* #### Example
|
|
40
|
+
*
|
|
41
|
+
* ```
|
|
42
|
+
* new milvusClient(MILUVS_ADDRESS).listResourceGroups();
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
listResourceGroups(data?: GrpcTimeOut): Promise<ListResourceGroupsResponse>;
|
|
46
|
+
/**
|
|
47
|
+
* Describe a resource group.
|
|
48
|
+
*
|
|
49
|
+
* @param data
|
|
50
|
+
* | Property | Type | Description |
|
|
51
|
+
* | :--- | :-- | :-- |
|
|
52
|
+
* | resource_group | String | Resource group name |
|
|
53
|
+
* | 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 |
|
|
54
|
+
*
|
|
55
|
+
* @returns
|
|
56
|
+
* | Property | Type | Description |
|
|
57
|
+
* | :-- | :-- | :-- |
|
|
58
|
+
* | status.error_code | string | error code |
|
|
59
|
+
* | status.reason | string | error reason |
|
|
60
|
+
* | resource_group.capacity | number | num_node which has been transfer to this rg |
|
|
61
|
+
* | resource_group.num_available_node | number | available node_num, some node may shutdown |
|
|
62
|
+
* | resource_group.num_loaded_replica | { [key: string]: number } | from collection_name to loaded replica of each collecion in this rg |
|
|
63
|
+
* | resource_group.num_outgoing_node | { [key: string]: number } | from collection_name to outgoging accessed node num by replica loaded in this rg |
|
|
64
|
+
* | resource_group.num_incoming_node | { [key: string]: number } | from collection_name to incoming accessed node num by replica loaded in other rg |
|
|
65
|
+
*
|
|
66
|
+
* #### Example
|
|
67
|
+
*
|
|
68
|
+
* ```
|
|
69
|
+
* new milvusClient(MILUVS_ADDRESS).describeResrouceGroup({
|
|
70
|
+
* resource_group: 'my-resource-group'
|
|
71
|
+
* });
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
describeResourceGroup(data: DesribeResourceGroupsReq): Promise<DescribeResourceGroupResponse>;
|
|
75
|
+
/**
|
|
76
|
+
* drop a resource group.
|
|
77
|
+
* @param data
|
|
78
|
+
* | Property | Type | Description |
|
|
79
|
+
* | :--- | :-- | :-- |
|
|
80
|
+
* | resource_group | String | Resource group name |
|
|
81
|
+
* | 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 |
|
|
82
|
+
*
|
|
83
|
+
* @returns
|
|
84
|
+
* | Property | Type | Description |
|
|
85
|
+
* | :-- | :-- | :-- |
|
|
86
|
+
* | status.error_code | string | error code |
|
|
87
|
+
* | status.reason | string | error reason |
|
|
88
|
+
*
|
|
89
|
+
* #### Example
|
|
90
|
+
*
|
|
91
|
+
* ```
|
|
92
|
+
* new milvusClient(MILUVS_ADDRESS).dropResourceGroup({
|
|
93
|
+
* resource_group: 'my-resource-group'
|
|
94
|
+
* });
|
|
95
|
+
* ```
|
|
96
|
+
*/
|
|
97
|
+
dropResourceGroup(data: DropResourceGroupsReq): Promise<ResStatus>;
|
|
98
|
+
/**
|
|
99
|
+
* transfer nodes from one resource group to another
|
|
100
|
+
* @param data
|
|
101
|
+
* | Property | Type | Description |
|
|
102
|
+
* | :--- | :-- | :-- |
|
|
103
|
+
* | source_resource_group | String | source resource group name |
|
|
104
|
+
* | target_resource_group | String | target resource group name |
|
|
105
|
+
* | collection_name | String | collection name |
|
|
106
|
+
* | num_replica | Number | number of replicas to transfer |
|
|
107
|
+
* | 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 |
|
|
108
|
+
*
|
|
109
|
+
* @returns
|
|
110
|
+
* | Property | Type | Description |
|
|
111
|
+
* | :-- | :-- | :-- |
|
|
112
|
+
* | status.error_code | string | error code |
|
|
113
|
+
* | status.reason | string | error reason |
|
|
114
|
+
*
|
|
115
|
+
*
|
|
116
|
+
* #### Example
|
|
117
|
+
*
|
|
118
|
+
* ```
|
|
119
|
+
* new milvusClient(MILUVS_ADDRESS).transferNode({
|
|
120
|
+
* source_resource_group: 'source-resource-group',
|
|
121
|
+
* target_resource_group: 'target-resource-group',
|
|
122
|
+
* collection_name: 'my-collection',
|
|
123
|
+
* num_replica: 2
|
|
124
|
+
* });
|
|
125
|
+
* ```
|
|
126
|
+
*/
|
|
127
|
+
transferReplica(data: TransferReplicaReq): Promise<ResStatus>;
|
|
128
|
+
/**
|
|
129
|
+
* transfer nodes from one resource group to another
|
|
130
|
+
* @param data
|
|
131
|
+
* | Property | Type | Description |
|
|
132
|
+
* | :--- | :-- | :-- |
|
|
133
|
+
* | source_resource_group | String | source resource group name |
|
|
134
|
+
* | target_resource_group | String | target resource group name |
|
|
135
|
+
* | num_node | Number | number of nodes to transfer |
|
|
136
|
+
* | 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 |
|
|
137
|
+
*
|
|
138
|
+
* @returns
|
|
139
|
+
* | Property | Type | Description |
|
|
140
|
+
* | :-- | :-- | :-- |
|
|
141
|
+
* | status.error_code | string | error code |
|
|
142
|
+
* | status.reason | string | error reason |
|
|
143
|
+
*
|
|
144
|
+
*
|
|
145
|
+
* #### Example
|
|
146
|
+
*
|
|
147
|
+
* ```
|
|
148
|
+
* new milvusClient(MILUVS_ADDRESS).transferNode({
|
|
149
|
+
* source_resource_group: 'source-resource-group',
|
|
150
|
+
* target_resource_group: 'target-resource-group',
|
|
151
|
+
* num_node: 4
|
|
152
|
+
* });
|
|
153
|
+
* ```
|
|
154
|
+
*/
|
|
155
|
+
transferNode(data: TransferNodeReq): Promise<ResStatus>;
|
|
156
|
+
/**
|
|
157
|
+
* drop all resource groups, transfer all nodes to the default group
|
|
158
|
+
*
|
|
159
|
+
* @returns
|
|
160
|
+
* | Property | Type | Description |
|
|
161
|
+
* | :-- | :-- | :-- |
|
|
162
|
+
* | status.error_code | string | error code |
|
|
163
|
+
* | status.reason | string[] | error reason |
|
|
164
|
+
*
|
|
165
|
+
* #### Example
|
|
166
|
+
*
|
|
167
|
+
* ```
|
|
168
|
+
* new milvusClient(MILUVS_ADDRESS).dropResourceGroups();
|
|
169
|
+
* ```
|
|
170
|
+
*/
|
|
171
|
+
dropAllResourceGroups(): Promise<ResStatus[]>;
|
|
172
|
+
}
|