diff --git a/bin/build-all.sh b/bin/build-all.sh
index 8235915..89704b5 100755
--- a/bin/build-all.sh
+++ b/bin/build-all.sh
@@ -3,7 +3,7 @@ root_path=$(dirname $(cd $(dirname $0);pwd))
source $root_path/bin/library.sh
mvn deploy -N -D skipTests -P local -s ~/.m2/settings-development.xml
deploy service-common service-dependencies service-configuration service-forest service-cli service-cli/service-cli-core service-executor service-executor/service-executor-core utils/executor
-package service-api service-check service-cli/service-cli-runner service-cloud-query service-executor/service-executor-manager service-executor/service-executor-task service-command service-exporter service-flink-query service-gateway service-hudi-query service-info-query service-monitor service-loki-query service-pulsar-query service-queue service-scheduler service-uploader service-web service-yarn-query service-zookeeper-query utils/sync
+package service-api service-check service-cli/service-cli-runner service-cloud-query service-executor/service-executor-manager service-executor/service-executor-task service-command service-command-pro service-exporter service-flink-query service-gateway service-hudi-query service-info-query service-monitor service-loki-query service-pulsar-query service-queue service-scheduler service-uploader service-web service-yarn-query service-zookeeper-query utils/sync
configs=(b2a4 b2b1 b2b5 b2b12)
for config in ${configs[*]};
@@ -16,6 +16,7 @@ upload $root_path/service-api/target/service-api-1.0.0-SNAPSHOT.jar
upload $root_path/service-check/target/service-check-1.0.0-SNAPSHOT.jar
upload $root_path/service-cloud-query/target/service-cloud-query-1.0.0-SNAPSHOT.jar
upload $root_path/service-command/target/service-command-1.0.0-SNAPSHOT.jar
+upload $root_path/service-command-pro/target/service-command-pro-1.0.0-SNAPSHOT.jar
upload $root_path/service-executor/service-executor-manager/target/service-executor-manager-1.0.0-SNAPSHOT.jar
upload $root_path/service-executor/service-executor-task/target/service-executor-task-1.0.0-SNAPSHOT.jar
upload $root_path/service-exporter/target/service-exporter-1.0.0-SNAPSHOT.jar
diff --git a/bin/build-command-pro.sh b/bin/build-command-pro.sh
new file mode 100755
index 0000000..0b5b1bb
--- /dev/null
+++ b/bin/build-command-pro.sh
@@ -0,0 +1,6 @@
+#!/bin/bash
+root_path=$(dirname $(cd $(dirname $0);pwd))
+source $root_path/bin/library.sh
+deploy service-common service-dependencies service-configuration service-forest
+package service-command-pro
+upload $root_path/service-command-pro/target/service-command-pro-1.0.0-SNAPSHOT.jar
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 2df2773..07e11e8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -19,6 +19,7 @@
service-cli
service-cloud-query
service-command
+ service-command-pro
service-executor
service-exporter
service-flink-query
@@ -123,6 +124,11 @@
executor
${project.version}
+
+ com.lanyuanxiaoyao
+ sync
+ ${project.version}
+
diff --git a/service-cli/service-cli-runner/src/main/java/com/lanyuanxiaoyao/service/cli/runner/DeployInformationProperties.java b/service-cli/service-cli-runner/src/main/java/com/lanyuanxiaoyao/service/cli/runner/DeployInformationProperties.java
index 95640a6..08a1bc8 100644
--- a/service-cli/service-cli-runner/src/main/java/com/lanyuanxiaoyao/service/cli/runner/DeployInformationProperties.java
+++ b/service-cli/service-cli-runner/src/main/java/com/lanyuanxiaoyao/service/cli/runner/DeployInformationProperties.java
@@ -77,6 +77,7 @@ public class DeployInformationProperties {
public static final class Generate {
private Boolean cloud = true;
private Boolean command = true;
+ private Boolean commandPro = true;
private Boolean uploader = true;
private Boolean updateJar = true;
@@ -96,6 +97,14 @@ public class DeployInformationProperties {
this.command = command;
}
+ public Boolean getCommandPro() {
+ return commandPro;
+ }
+
+ public void setCommandPro(Boolean commandPro) {
+ this.commandPro = commandPro;
+ }
+
public Boolean getUploader() {
return uploader;
}
@@ -117,6 +126,7 @@ public class DeployInformationProperties {
return "Generate{" +
"cloud=" + cloud +
", command=" + command +
+ ", commandPro=" + commandPro +
", uploader=" + uploader +
", updateJar=" + updateJar +
'}';
diff --git a/service-cli/service-cli-runner/src/main/java/com/lanyuanxiaoyao/service/cli/runner/RunnerApplication.java b/service-cli/service-cli-runner/src/main/java/com/lanyuanxiaoyao/service/cli/runner/RunnerApplication.java
index a80d553..9133888 100644
--- a/service-cli/service-cli-runner/src/main/java/com/lanyuanxiaoyao/service/cli/runner/RunnerApplication.java
+++ b/service-cli/service-cli-runner/src/main/java/com/lanyuanxiaoyao/service/cli/runner/RunnerApplication.java
@@ -1,7 +1,6 @@
package com.lanyuanxiaoyao.service.cli.runner;
import cn.hutool.core.collection.ListUtil;
-import cn.hutool.core.io.IoUtil;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.RandomUtil;
@@ -34,7 +33,6 @@ import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.core.io.ClassPathResource;
/**
* 启动类
@@ -98,6 +96,8 @@ public class RunnerApplication implements ApplicationRunner {
generateCloud(Paths.get("cloud"));
if (deployInformationProperties.getGenerate().getCommand())
generateCommand(Paths.get("command"));
+ if (deployInformationProperties.getGenerate().getCommandPro())
+ generateCommand(Paths.get("command-pro"));
if (deployInformationProperties.getGenerate().getUploader())
generateUploader(Paths.get("uploader"));
if (deployInformationProperties.getGenerate().getUpdateJar())
@@ -252,7 +252,7 @@ public class RunnerApplication implements ApplicationRunner {
logger.info("Current path: {}", absolutRootPath);
TemplateEngine engine = TemplateUtil.createEngine(new TemplateConfig("template", TemplateConfig.ResourceMode.CLASSPATH));
- Template commandTemplate = engine.getTemplate("command/cli.ftl");
+ Template commandTemplate = engine.getTemplate(root.toFile().getName() + "/cli.ftl");
String commandScript = commandTemplate.render(MapUtil.builder()
.put("currentPath", absolutRootPath)
.put("runtime", runtimeInfo)
@@ -262,7 +262,7 @@ public class RunnerApplication implements ApplicationRunner {
Files.deleteIfExists(commandScriptFile);
Files.write(commandScriptFile, commandScript.getBytes());
- Template commandDirectlyTemplate = engine.getTemplate("command/cli.ftl");
+ Template commandDirectlyTemplate = engine.getTemplate(root.toFile().getName() + "/cli.ftl");
String commandDirectlyScript = commandDirectlyTemplate.render(MapUtil.builder()
.put("currentPath", absolutRootPath)
.put("runtime", runtimeInfo)
@@ -272,7 +272,7 @@ public class RunnerApplication implements ApplicationRunner {
Files.deleteIfExists(commandDirectlyScriptFile);
Files.write(commandDirectlyScriptFile, commandDirectlyScript.getBytes());
- Template updateTemplate = engine.getTemplate("command/update.ftl");
+ Template updateTemplate = engine.getTemplate(root.toFile().getName() + "/update.ftl");
String updateScript = updateTemplate.render(MapUtil.builder()
.put("currentPath", absolutRootPath)
.put("runtime", runtimeInfo)
diff --git a/service-cli/service-cli-runner/src/main/resources/template/command-pro/cli.ftl b/service-cli/service-cli-runner/src/main/resources/template/command-pro/cli.ftl
new file mode 100644
index 0000000..88febf2
--- /dev/null
+++ b/service-cli/service-cli-runner/src/main/resources/template/command-pro/cli.ftl
@@ -0,0 +1,4 @@
+#!/bin/bash
+mkdir -p ${runtime.jarPath}
+export JASYPT_ENCRYPTOR_PASSWORD='r#(R,P\"Dp^A47>WSn:Wn].gs/+\"v:q_Q*An~zF*g-@j@jtSTv5H/,S-3:R?r9R}.'
+${runtime.jdkPath}/bin/java <#noparse>-Ddeploy.datetime=$(date +%Y%m%d%H%M%S) -Ddeploy.hostname=$(hostname) -Ddeploy.hostname-full=$(hostname -f) -Ddeploy.start-time=$(date +%Y%m%d%H%M%S)#noparse> -Dlogging.parent=${runtime.logPath} -Dloki.url=${runtime.loki.servicePushUrl} -Dspring.cloud.zookeeper.connect-string=${runtime.zkUrl} -Dyarn-cluster.sync-clusters=${runtime.yarn.syncClusters} -Dyarn-cluster.compaction-clusters=${runtime.yarn.compactionClusters} -jar ${runtime.jarPath}/service-command-pro.jar<#if directly> $@#if>
diff --git a/service-cli/service-cli-runner/src/main/resources/template/command-pro/update.ftl b/service-cli/service-cli-runner/src/main/resources/template/command-pro/update.ftl
new file mode 100644
index 0000000..62d81a5
--- /dev/null
+++ b/service-cli/service-cli-runner/src/main/resources/template/command-pro/update.ftl
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+curl ${runtime.downloadUrl}/service-command-pro-1.0.0-SNAPSHOT.jar -o ${runtime.jarPath}/service-command-pro.jar
\ No newline at end of file
diff --git a/service-command-pro/pom.xml b/service-command-pro/pom.xml
new file mode 100644
index 0000000..628f31a
--- /dev/null
+++ b/service-command-pro/pom.xml
@@ -0,0 +1,191 @@
+
+
+ 4.0.0
+
+ com.lanyuanxiaoyao
+ hudi-service
+ 1.0.0-SNAPSHOT
+
+
+ service-command-pro
+
+
+
+ com.lanyuanxiaoyao
+ service-forest
+
+
+ org.springframework.cloud
+ spring-cloud-starter-loadbalancer
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+
+
+ com.google.protobuf
+ protobuf-java
+
+
+
+
+ org.springframework.shell
+ spring-shell-starter
+
+
+ me.tongfei
+ progressbar
+
+
+ com.sun.jersey
+ jersey-client
+
+
+ com.sun.jersey
+ jersey-core
+
+
+ com.sun.jersey.contribs
+ jersey-apache-client4
+
+
+ org.apache.hadoop
+ hadoop-client
+
+
+ com.squareup.okio
+ okio
+
+
+ com.google.guava
+ guava
+
+
+ commons-io
+ commons-io
+
+
+ commons-logging
+ commons-logging
+
+
+ org.apache.curator
+ curator-client
+
+
+
+
+ org.apache.hudi
+ hudi-flink${flink.major.version}-bundle
+
+
+ io.juicefs
+ juicefs-hadoop
+
+
+ org.apache.curator
+ curator-framework
+
+
+ log4j
+ log4j
+
+
+ netty
+ io.netty
+
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-resources-plugin
+
+
+ copy-config-file
+ validate
+
+ copy-resources
+
+
+ ${project.build.directory}/classes
+
+
+ ${project.parent.basedir}/config/${build-tag}
+
+ *.xml
+
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-shade-plugin
+
+ false
+ true
+
+
+ META-INF/spring.handlers
+
+
+ META-INF/spring.factories
+
+
+ META-INF/spring.schemas
+
+
+ com.lanyuanxiaoyao.service.command.pro.CommandProApplication
+
+
+ reference.conf
+
+
+
+
+
+ *:*
+
+ META-INF/*.SF
+ META-INF/*.DSA
+ META-INF/*.RSA
+ core-default.xml
+ hdfs-default.xml
+ yarn-default.xml
+ log4j-surefire*.properties
+
+
+
+
+
+
+ package
+
+ shade
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+ ${spring-boot.version}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/service-command-pro/src/main/java/com/lanyuanxiaoyao/service/command/pro/CommandProApplication.java b/service-command-pro/src/main/java/com/lanyuanxiaoyao/service/command/pro/CommandProApplication.java
new file mode 100644
index 0000000..c8db3c2
--- /dev/null
+++ b/service-command-pro/src/main/java/com/lanyuanxiaoyao/service/command/pro/CommandProApplication.java
@@ -0,0 +1,43 @@
+package com.lanyuanxiaoyao.service.command.pro;
+
+import com.lanyuanxiaoyao.service.configuration.SecurityConfig;
+import com.lanyuanxiaoyao.service.forest.configuration.SpringCloudDiscoveryInterceptor;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.boot.ApplicationArguments;
+import org.springframework.boot.ApplicationRunner;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.FilterType;
+
+/**
+ * 命令行工具入口
+ *
+ * @author ZhangJiacheng
+ * @date 2022-03-24
+ */
+@SpringBootApplication
+@EnableConfigurationProperties
+@ComponentScan(
+ basePackages = {"com.lanyuanxiaoyao.service"},
+ excludeFilters = {
+ @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = {
+ SpringCloudDiscoveryInterceptor.class,
+ SecurityConfig.class
+ }),
+ }
+)
+public class CommandProApplication implements ApplicationRunner {
+ private static final Logger logger = LoggerFactory.getLogger(CommandProApplication.class);
+
+ public static void main(String[] args) {
+ SpringApplication.run(CommandProApplication.class, args);
+ }
+
+ @Override
+ public void run(ApplicationArguments args) throws Exception {
+ // Test
+ }
+}
diff --git a/service-command-pro/src/main/java/com/lanyuanxiaoyao/service/command/pro/commands/HudiCommand.java b/service-command-pro/src/main/java/com/lanyuanxiaoyao/service/command/pro/commands/HudiCommand.java
new file mode 100644
index 0000000..93f02e9
--- /dev/null
+++ b/service-command-pro/src/main/java/com/lanyuanxiaoyao/service/command/pro/commands/HudiCommand.java
@@ -0,0 +1,21 @@
+package com.lanyuanxiaoyao.service.command.pro.commands;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.shell.standard.ShellComponent;
+import org.springframework.shell.standard.ShellMethod;
+
+/**
+ * Hudi相关操作
+ *
+ * @author lanyuanxiaoyao
+ * @date 2024-03-19
+ */
+@ShellComponent("Hudi相关操作")
+public class HudiCommand {
+ private static final Logger logger = LoggerFactory.getLogger(HudiCommand.class);
+
+ @ShellMethod("Test")
+ public void test() {
+ }
+}
diff --git a/service-command-pro/src/main/java/com/lanyuanxiaoyao/service/command/pro/configuration/ShellConfiguration.java b/service-command-pro/src/main/java/com/lanyuanxiaoyao/service/command/pro/configuration/ShellConfiguration.java
new file mode 100644
index 0000000..3946b9e
--- /dev/null
+++ b/service-command-pro/src/main/java/com/lanyuanxiaoyao/service/command/pro/configuration/ShellConfiguration.java
@@ -0,0 +1,19 @@
+package com.lanyuanxiaoyao.service.command.pro.configuration;
+
+import org.jline.utils.AttributedString;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.shell.jline.PromptProvider;
+
+/**
+ * Spring Shell 配置
+ *
+ * @author ZhangJiacheng
+ * @date 2022-04-27
+ */
+@Configuration
+public class ShellConfiguration implements PromptProvider {
+ @Override
+ public AttributedString getPrompt() {
+ return new AttributedString("hudi-pro:->");
+ }
+}
diff --git a/service-command-pro/src/main/java/com/lanyuanxiaoyao/service/command/pro/configuration/SpringCloudDiscoveryInterceptor.java b/service-command-pro/src/main/java/com/lanyuanxiaoyao/service/command/pro/configuration/SpringCloudDiscoveryInterceptor.java
new file mode 100644
index 0000000..263eda4
--- /dev/null
+++ b/service-command-pro/src/main/java/com/lanyuanxiaoyao/service/command/pro/configuration/SpringCloudDiscoveryInterceptor.java
@@ -0,0 +1,57 @@
+package com.lanyuanxiaoyao.service.command.pro.configuration;
+
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.core.util.RandomUtil;
+import cn.hutool.core.util.StrUtil;
+import cn.hutool.core.util.URLUtil;
+import com.dtflys.forest.auth.BasicAuth;
+import com.dtflys.forest.http.ForestAddress;
+import com.dtflys.forest.http.ForestRequest;
+import com.dtflys.forest.interceptor.Interceptor;
+import com.lanyuanxiaoyao.service.common.Constants;
+import java.net.URI;
+import java.net.URL;
+import org.eclipse.collections.api.factory.Lists;
+import org.eclipse.collections.api.list.ImmutableList;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.cloud.client.discovery.DiscoveryClient;
+import org.springframework.stereotype.Component;
+
+/**
+ * @author lanyuanxiaoyao
+ * @date 2023-04-24
+ */
+@Component
+public class SpringCloudDiscoveryInterceptor implements Interceptor