summaryrefslogtreecommitdiff
path: root/groot-bootstrap
diff options
context:
space:
mode:
authordoufenghu <[email protected]>2024-04-02 17:36:46 +0800
committerdoufenghu <[email protected]>2024-04-02 17:36:46 +0800
commit95bcb7db323b12d7e7f864dff615d73622d7e688 (patch)
tree919b582cbcefb9304004444fda1d350a3041a2f5 /groot-bootstrap
parent80e93523eb12f986acac73a81f2614516c718a5e (diff)
[Feature][Tests] add Kafka Container for unit test.
Diffstat (limited to 'groot-bootstrap')
-rw-r--r--groot-bootstrap/src/main/bin/stop.sh5
-rw-r--r--groot-bootstrap/src/main/java/com/geedgenetworks/bootstrap/main/GrootStreamServer.java2
-rw-r--r--groot-bootstrap/src/main/java/com/geedgenetworks/bootstrap/utils/EnvironmentUtil.java12
-rw-r--r--groot-bootstrap/src/main/resources/log4j.properties22
4 files changed, 8 insertions, 33 deletions
diff --git a/groot-bootstrap/src/main/bin/stop.sh b/groot-bootstrap/src/main/bin/stop.sh
index 9fd0469..91e24b9 100644
--- a/groot-bootstrap/src/main/bin/stop.sh
+++ b/groot-bootstrap/src/main/bin/stop.sh
@@ -16,7 +16,7 @@ stop_jobs() {
done
;;
yarn-per-job)
- # Command to stop YARN applications for the specified job name
+ # Command to stop YARN applications for the specified Yarn cluster app name
yarn application -list -appStates RUNNING | grep "$job_name" | awk '{print $1}' | while read -r appId
do
yarn application -kill "$appId"
@@ -65,9 +65,6 @@ fi
deployment_mode=$1 # standalone, yarn-per-job, or yarn-session
job_name=$2 # The Flink job name to stop
-# Trim whitespace from job_name
-job_name=$(echo "$job_name" | tr -d '[:space:]')
-
# Checking for empty input arguments
if [ -z "$deployment_mode" ] || [ -z "$job_name" ]; then
display_usage
diff --git a/groot-bootstrap/src/main/java/com/geedgenetworks/bootstrap/main/GrootStreamServer.java b/groot-bootstrap/src/main/java/com/geedgenetworks/bootstrap/main/GrootStreamServer.java
index 38d91c5..93cb972 100644
--- a/groot-bootstrap/src/main/java/com/geedgenetworks/bootstrap/main/GrootStreamServer.java
+++ b/groot-bootstrap/src/main/java/com/geedgenetworks/bootstrap/main/GrootStreamServer.java
@@ -43,7 +43,7 @@ public class GrootStreamServer {
private static void outputFatalError(Throwable throwable) {
log.error("\\n\\n===============================================================================\\n\\n");
String errorMsg = throwable.getMessage();
- log.error("Fatal Error ,Reason is :{} \n", errorMsg);
+ log.error("Fatal Error: {} \n", errorMsg);
log.error("Exception StackTrace :{}", ExceptionUtils.getStackTrace(throwable));
log.error("\\n\\n===============================================================================\\n\\n");
}
diff --git a/groot-bootstrap/src/main/java/com/geedgenetworks/bootstrap/utils/EnvironmentUtil.java b/groot-bootstrap/src/main/java/com/geedgenetworks/bootstrap/utils/EnvironmentUtil.java
index 79cd8bf..13db3d4 100644
--- a/groot-bootstrap/src/main/java/com/geedgenetworks/bootstrap/utils/EnvironmentUtil.java
+++ b/groot-bootstrap/src/main/java/com/geedgenetworks/bootstrap/utils/EnvironmentUtil.java
@@ -52,7 +52,7 @@ public final class EnvironmentUtil {
if (envConfig.hasPath(ExecutionConfigKeyName.RESTART_STRATEGY)) {
String restartStrategy = envConfig.getString(ExecutionConfigKeyName.RESTART_STRATEGY);
switch (restartStrategy.toLowerCase()) {
- case "no":
+ case "none":
executionConfig.setRestartStrategy(RestartStrategies.noRestart());
break;
case "fixed-delay":
@@ -68,18 +68,18 @@ public final class EnvironmentUtil {
long delayInterval = envConfig.getLong(ExecutionConfigKeyName.RESTART_DELAY_INTERVAL);
executionConfig.setRestartStrategy(
RestartStrategies.failureRateRestart(
- rate,
- Time.of(failureInterval, TimeUnit.MILLISECONDS),
- Time.of(delayInterval, TimeUnit.MILLISECONDS)));
+ rate, // max failures per interval
+ Time.of(failureInterval, TimeUnit.MILLISECONDS), //time interval for measuring failure rate
+ Time.of(delayInterval, TimeUnit.MILLISECONDS))); // delay
break;
default:
log.warn(
- "set restart.strategy failed, unknown restart.strategy [{}],only support no,fixed-delay,failure-rate",
+ "Set restart strategy failed, unknown restart strategy [{}],only support no,fixed-delay,failure-rate",
restartStrategy);
}
}
} catch (Exception e) {
- log.warn("set restart.strategy in config '{}' exception", envConfig, e);
+ log.warn("Set restart strategy in config '{}' exception", envConfig, e);
}
}
diff --git a/groot-bootstrap/src/main/resources/log4j.properties b/groot-bootstrap/src/main/resources/log4j.properties
deleted file mode 100644
index db5d9e5..0000000
--- a/groot-bootstrap/src/main/resources/log4j.properties
+++ /dev/null
@@ -1,22 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# Set everything to be logged to the console
-log4j.rootCategory=INFO, console
-log4j.appender.console=org.apache.log4j.ConsoleAppender
-log4j.appender.console.target=System.err
-log4j.appender.console.layout=org.apache.log4j.PatternLayout
-log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{1}: %m%n