Cpaulyz commented on code in PR #14135:
URL: https://github.com/apache/iotdb/pull/14135#discussion_r1856228760
##########
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/UDFManager.java:
##########
@@ -83,35 +86,43 @@ public TSStatus createFunction(TCreateFunctionReq req) {
final String jarMD5 = req.getJarMD5();
final String jarName = req.getJarName();
final byte[] jarFile = req.getJarFile();
- udfInfo.validate(udfName, jarName, jarMD5);
+ final Model model = req.getModel();
+ udfInfo.validate(model, udfName, jarName, jarMD5);
- final UDFInformation udfInformation =
- new UDFInformation(udfName, req.getClassName(), false, isUsingURI,
jarName, jarMD5);
- final boolean needToSaveJar = isUsingURI &&
udfInfo.needToSaveJar(jarName);
+ UDFInformation udfInformation =
+ new UDFInformation(
+ udfName, req.getClassName(), model, false, isUsingURI, jarName,
jarMD5);
- LOGGER.info(
- "Start to create UDF [{}] on Data Nodes, needToSaveJar[{}]",
udfName, needToSaveJar);
-
- final TSStatus dataNodesStatus =
- RpcUtils.squashResponseStatusList(
- createFunctionOnDataNodes(udfInformation, needToSaveJar ?
jarFile : null));
- if (dataNodesStatus.getCode() !=
TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
- return dataNodesStatus;
- }
+ final boolean needToSaveJar = isUsingURI &&
udfInfo.needToSaveJar(jarName);
+ LOGGER.info("Start to add UDF [{}] in UDF_Table on Config Nodes",
udfName);
CreateFunctionPlan createFunctionPlan =
new CreateFunctionPlan(udfInformation, needToSaveJar ? new
Binary(jarFile) : null);
+
+ udfInformation.setAvailable(true);
Review Comment:
It should be true here. We should set it to true after executing
`CreateFunctionPlan`(pre-creation) with avaliable=false.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]