@ejfdelgado/ejflab-common 1.11.3 → 1.12.1
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/package.json
CHANGED
|
@@ -20,25 +20,35 @@ class CommandMilvus extends CommandBasic {
|
|
|
20
20
|
|
|
21
21
|
const milvusSrv = this.context.getSuperContext().getMilvusClient();
|
|
22
22
|
const { client } = milvusSrv.connect();
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
23
|
+
const response = null;
|
|
24
|
+
try {
|
|
25
|
+
if (action == "database.create") {
|
|
26
|
+
response = await this.dataBaseCreate(milvusSrv, client, dataBaseName);
|
|
27
|
+
} else if (action == "database.recreate") {
|
|
28
|
+
response = await this.dataBaseRecreate(milvusSrv, client, dataBaseName);
|
|
29
|
+
} else if (action == "collection.create") {
|
|
30
|
+
const collectionConfig = this.args[2];
|
|
31
|
+
const configuration = SimpleObj.getValue(this.context.data, collectionConfig, null);
|
|
32
|
+
if (configuration) {
|
|
33
|
+
response = await this.collectionCreate(milvusSrv, client, dataBaseName, configuration);
|
|
34
|
+
} else {
|
|
35
|
+
throw new Error(`No MILVUS configuration in ${collectionConfig}`);
|
|
36
|
+
}
|
|
37
|
+
} else if (action == "introspect") {
|
|
38
|
+
response = await milvusSrv.introspect(client);
|
|
39
|
+
} else if (action == "database.destroy") {
|
|
40
|
+
response = await milvusSrv.dropDatabase(client, dataBaseName);
|
|
41
|
+
} else if (action == "database.destroy_temp") {
|
|
42
|
+
response = await milvusSrv.dropDatabaseTemp(client);
|
|
43
|
+
} else if (action == "database.exists") {
|
|
44
|
+
response = await milvusSrv.existsDatabase(client, dataBaseName);
|
|
34
45
|
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
await milvusSrv.
|
|
39
|
-
} else if (action == "database.destroy_temp") {
|
|
40
|
-
await milvusSrv.dropDatabaseTemp(client);
|
|
46
|
+
} catch (err) {
|
|
47
|
+
throw err;
|
|
48
|
+
} finally {
|
|
49
|
+
await milvusSrv.releaseConnection(client);
|
|
41
50
|
}
|
|
51
|
+
return response;
|
|
42
52
|
}
|
|
43
53
|
}
|
|
44
54
|
|
|
@@ -120,7 +120,8 @@ class StepProcess extends StepBasic {
|
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
const room = this.context.getRoom();
|
|
123
|
-
const dbData = SimpleObj.getValue(this.context.data, `args.db`,
|
|
123
|
+
const dbData = SimpleObj.getValue(this.context.data, `args.db`, {});
|
|
124
|
+
const general = SimpleObj.getValue(this.context.data, `args.general`, {});
|
|
124
125
|
//console.log(`StepProcess processorName:${processorName} processorInstance:${processorInstance} processorMethod:${processorMethod} in room ${room}`);
|
|
125
126
|
this.messageUID = IdGen.num2ord(new Date().getTime());
|
|
126
127
|
this.pendingCall = `${room}-${this.id}-${this.messageUID}`;
|
|
@@ -136,7 +137,8 @@ class StepProcess extends StepBasic {
|
|
|
136
137
|
id: this.pendingCall,
|
|
137
138
|
data: this.configuration[instanceNumber],
|
|
138
139
|
room,
|
|
139
|
-
dbData
|
|
140
|
+
dbData,
|
|
141
|
+
general
|
|
140
142
|
};
|
|
141
143
|
//console.log("dbData="+JSON.stringify(dbData));
|
|
142
144
|
|