You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ja...@apache.org on 2022/11/28 05:49:17 UTC
[iotdb] branch rel/1.0 updated: [To rel/1.0] [IOTDB-5067] Add check of URI scheme
This is an automated email from the ASF dual-hosted git repository.
jackietien pushed a commit to branch rel/1.0
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/rel/1.0 by this push:
new 89add7bae6 [To rel/1.0] [IOTDB-5067] Add check of URI scheme
89add7bae6 is described below
commit 89add7bae6919d954fd5458ef90d04a52572dc4f
Author: Liao Lanyu <14...@qq.com>
AuthorDate: Mon Nov 28 13:49:10 2022 +0800
[To rel/1.0] [IOTDB-5067] Add check of URI scheme
---
.../config/executor/ClusterConfigTaskExecutor.java | 24 ++++++++++++++++++----
1 file changed, 20 insertions(+), 4 deletions(-)
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/execution/config/executor/ClusterConfigTaskExecutor.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/execution/config/executor/ClusterConfigTaskExecutor.java
index b56b79ab8e..5cd7cdb25a 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/execution/config/executor/ClusterConfigTaskExecutor.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/execution/config/executor/ClusterConfigTaskExecutor.java
@@ -305,9 +305,17 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
TSStatusCode.TRIGGER_DOWNLOAD_ERROR.getStatusCode()));
return future;
}
- jarFileName = new File(createFunctionStatement.getUriString()).getName();
+ jarFileName = new File(uriString).getName();
try {
- if (!new URI(uriString).getScheme().equals("file")) {
+ URI uri = new URI(uriString);
+ if (uri.getScheme() == null) {
+ future.setException(
+ new IoTDBException(
+ "The scheme of URI is not set, please specify the scheme of URI.",
+ TSStatusCode.TRIGGER_DOWNLOAD_ERROR.getStatusCode()));
+ return future;
+ }
+ if (!uri.getScheme().equals("file")) {
// download executable
ExecutableResource resource =
UDFExecutableManager.getInstance().request(Collections.singletonList(uriString));
@@ -468,9 +476,17 @@ public class ClusterConfigTaskExecutor implements IConfigTaskExecutor {
TSStatusCode.UDF_DOWNLOAD_ERROR.getStatusCode()));
return future;
}
- jarFileName = new File(createTriggerStatement.getUriString()).getName();
+ jarFileName = new File(uriString).getName();
try {
- if (!new URI(uriString).getScheme().equals("file")) {
+ URI uri = new URI(uriString);
+ if (uri.getScheme() == null) {
+ future.setException(
+ new IoTDBException(
+ "The scheme of URI is not set, please specify the scheme of URI.",
+ TSStatusCode.TRIGGER_DOWNLOAD_ERROR.getStatusCode()));
+ return future;
+ }
+ if (!uri.getScheme().equals("file")) {
// download executable
ExecutableResource resource =
TriggerExecutableManager.getInstance()