summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorchaochaoc <[email protected]>2024-05-28 14:56:27 +0800
committerchaochaoc <[email protected]>2024-05-28 14:56:27 +0800
commit509d263eeb26f9e4cb164b2b9ffd54f0b588d5cd (patch)
treee4d719595b06f3015f89b96d92a940ab018d507c /src
parent0dbfc207f4bff08e1ecd0ed436502931742afbaa (diff)
chore: create app
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/geedgenetworks/flink/easy/application/Applications.java19
-rw-r--r--src/main/resources/log4j2.properties32
2 files changed, 51 insertions, 0 deletions
diff --git a/src/main/java/com/geedgenetworks/flink/easy/application/Applications.java b/src/main/java/com/geedgenetworks/flink/easy/application/Applications.java
new file mode 100644
index 0000000..4deb56f
--- /dev/null
+++ b/src/main/java/com/geedgenetworks/flink/easy/application/Applications.java
@@ -0,0 +1,19 @@
+package com.geedgenetworks.flink.easy.application;
+
+import com.geedgenetworks.flink.easy.core.Runners;
+
+import java.net.URL;
+
+public enum Applications {
+ ;
+
+ public static void run(final String name) throws Exception {
+ final String path = String.format("/jobs/%s.yml", name);
+ final URL resource = JobApplication.class.getResource(path);
+ if (resource == null) {
+ throw new IllegalArgumentException(
+ String.format("Not found job '%s' in path [%s].", name, path));
+ }
+ Runners.run(resource.getPath());
+ }
+}
diff --git a/src/main/resources/log4j2.properties b/src/main/resources/log4j2.properties
new file mode 100644
index 0000000..d2455b2
--- /dev/null
+++ b/src/main/resources/log4j2.properties
@@ -0,0 +1,32 @@
+################################################################################
+# 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.
+################################################################################
+
+rootLogger.level = ERROR
+rootLogger.appenderRefs = console
+rootLogger.appenderRef.console.ref = ConsoleAppender
+
+appender.console.name = ConsoleAppender
+appender.console.type = CONSOLE
+appender.console.layout.type = PatternLayout
+appender.console.layout.pattern = %d{yyyy-MM-dd HH:mm:ss,SSS} %-5p %-20c %x - %m%n
+
+logger.easy.name = com.geedgenetworks.flink.easy
+logger.easy.level = DEBUG
+logger.easy.appenderRefs = console
+logger.easy.appenderRef.console.ref = ConsoleAppender
+logger.easy.additivity = false