diff --git a/pom.xml b/pom.xml index 0afab93..c023010 100644 --- a/pom.xml +++ b/pom.xml @@ -17,9 +17,13 @@ UTF-8 8 8 - 2.7.10 - 2.7.3 + 2.3.12.RELEASE + 2.3.1 5.3.26 + 2.3.12.RELEASE + 5.2.15.RELEASE + Hoxton.SR12 + 2.2.8.RELEASE @@ -32,6 +36,35 @@ pom import + + org.springframework.cloud + spring-cloud-dependencies + ${spring-cloud.version} + pom + import + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + ${nacos.version} + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + ${nacos.version} + + + com.alibaba.nacos + nacos-common + 2.1.0 + + + org.slf4j + slf4j-api + + + + mysql mysql-connector-java diff --git a/sql-parser/parser-starrocks/src/main/java/cn/cloudcharts/sql/parser/starrocks/parser/antlr4/StarRocksVisitor.java b/sql-parser/parser-starrocks/src/main/java/cn/cloudcharts/sql/parser/starrocks/parser/antlr4/StarRocksVisitor.java index d14cb7a..b4b421f 100644 --- a/sql-parser/parser-starrocks/src/main/java/cn/cloudcharts/sql/parser/starrocks/parser/antlr4/StarRocksVisitor.java +++ b/sql-parser/parser-starrocks/src/main/java/cn/cloudcharts/sql/parser/starrocks/parser/antlr4/StarRocksVisitor.java @@ -3,6 +3,7 @@ import org.antlr.v4.runtime.tree.ParseTreeVisitor; + /** * This interface defines a complete generic visitor for a parse tree produced * by {@link StarRocksParser}. diff --git a/xingyun-app/pom.xml b/xingyun-app/pom.xml index 8c91eac..8c61e32 100644 --- a/xingyun-app/pom.xml +++ b/xingyun-app/pom.xml @@ -39,6 +39,27 @@ spring-boot-starter-undertow + + org.springframework.cloud + spring-cloud-starter-loadbalancer + + + org.springframework.cloud + spring-cloud-starter-openfeign + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + com.alibaba.nacos + nacos-common + + cn.cloudcharts xingyun-core diff --git a/xingyun-app/src/main/resources/application.yml b/xingyun-app/src/main/resources/application.yml index 3de6f94..1073afd 100644 --- a/xingyun-app/src/main/resources/application.yml +++ b/xingyun-app/src/main/resources/application.yml @@ -17,8 +17,8 @@ server: # max-http-post-size: 4MB spring: - application: - name: xingyun + profiles: + active: test datasource: type: com.zaxxer.hikari.HikariDataSource driver-class-name: com.mysql.cj.jdbc.Driver @@ -52,29 +52,6 @@ spring: # enable: true # required: true -# mybatis-plus 配置 -mybatis-plus: - configuration: - map-underscore-to-camel-case: true - auto-mapping-behavior: full - log-impl: org.apache.ibatis.logging.stdout.StdOutImpl - use-generated-keys: true - mapper-locations: classpath*:mapper/**/*Mapper.xml - -# PageHelper插件的配置 -pagehelper: -# helper-dialect: mysql #指定数据库类型。不配置的话pageHelper也会自动检测 - # 分页合理化参数配置 - reasonable: true - # 支持通过 Mapper 接口参数来传递分页参数 - support-methods-arguments: true - # 默认每页条数 - default-page-size: 10 - # 默认第一页 - default-page-num: 1 - params: #默认值为pageNum=pageNum;pageSize=pageSize;count=countSql;reasonable=reasonable;pageSizeZero=pageSizeZero。 - - # DFS config type: hdfs、s3、local dfs: @@ -83,7 +60,6 @@ dfs: namespace: /xingyun path.separator: / - # springdoc-openapi项目配置 springdoc: swagger-ui: @@ -105,7 +81,6 @@ knife4j: enable-footer-custom: true footer-custom-content: Apache License 2.0 | Copyright 2023-[星云](https://github.com/haibao2015/xingyun) - management: endpoints: web: diff --git a/xingyun-app/src/main/resources/bootstrap-dev.yml b/xingyun-app/src/main/resources/bootstrap-dev.yml new file mode 100644 index 0000000..90d159d --- /dev/null +++ b/xingyun-app/src/main/resources/bootstrap-dev.yml @@ -0,0 +1,19 @@ +spring: + profiles: dev + cloud: + nacos: + config: + enabled: false + server-addr: 192.168.201.54:8848 + username: nacos + password: nacos + namespace: 256cb68f-b3db-4346-a149-af0a9b749222 + refresh-enabled: true + fileExtension: yaml + # extension-configs[0]: + # dataId: xx-xx.yaml + discovery: + server-addr: 192.168.201.54:8848 + namespace: 256cb68f-b3db-4346-a149-af0a9b749222 + username: nacos + password: nacos diff --git a/xingyun-app/src/main/resources/bootstrap-prod.yml b/xingyun-app/src/main/resources/bootstrap-prod.yml new file mode 100644 index 0000000..650e660 --- /dev/null +++ b/xingyun-app/src/main/resources/bootstrap-prod.yml @@ -0,0 +1,17 @@ +spring: + profiles: prod + cloud: + nacos: + config: + enabled: false + server-addr: 192.168.110.40:8848 + username: nacos + password: nacos + namespace: 256cb68f-b3db-4346-a149-af0a9b749222 + refresh-enabled: true + fileExtension: yaml + discovery: + server-addr: 192.168.201.66:8848 + namespace: 256cb68f-b3db-4346-a149-af0a9b749222 + username: nacos + password: nacos diff --git a/xingyun-app/src/main/resources/bootstrap-test.yml b/xingyun-app/src/main/resources/bootstrap-test.yml new file mode 100644 index 0000000..20419af --- /dev/null +++ b/xingyun-app/src/main/resources/bootstrap-test.yml @@ -0,0 +1,17 @@ +spring: + profiles: test + cloud: + nacos: + config: + enabled: false + server-addr: 192.168.110.40:8848 + username: nacos + password: nacos + namespace: 256cb68f-b3db-4346-a149-af0a9b749222 + refresh-enabled: true + fileExtension: yaml + discovery: + server-addr: 192.168.110.40:8848 + namespace: 256cb68f-b3db-4346-a149-af0a9b749222 + username: nacos + password: nacos diff --git a/xingyun-app/src/main/resources/bootstrap.yml b/xingyun-app/src/main/resources/bootstrap.yml new file mode 100644 index 0000000..2bfacb6 --- /dev/null +++ b/xingyun-app/src/main/resources/bootstrap.yml @@ -0,0 +1,31 @@ +spring: + profiles: + active: dev + application: + name: xingyun + cloud: + discovery: + enabled: true + +# mybatis-plus 配置 +mybatis-plus: + configuration: + map-underscore-to-camel-case: true + auto-mapping-behavior: full + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl + use-generated-keys: true + mapper-locations: classpath*:mapper/**/*Mapper.xml + +# PageHelper插件的配置 +pagehelper: + # helper-dialect: mysql #指定数据库类型。不配置的话pageHelper也会自动检测 + # 分页合理化参数配置 + reasonable: true + # 支持通过 Mapper 接口参数来传递分页参数 + support-methods-arguments: true + # 默认每页条数 + default-page-size: 10 + # 默认第一页 + default-page-num: 1 + params: #默认值为pageNum=pageNum;pageSize=pageSize;count=countSql;reasonable=reasonable;pageSizeZero=pageSizeZero。 + diff --git a/xingyun-metadata/src/main/java/cn/cloudcharts/metadata/task/StarrocksTaskOpertion.java b/xingyun-metadata/src/main/java/cn/cloudcharts/metadata/task/StarrocksTaskOpertion.java index 2b12fc6..604edf4 100644 --- a/xingyun-metadata/src/main/java/cn/cloudcharts/metadata/task/StarrocksTaskOpertion.java +++ b/xingyun-metadata/src/main/java/cn/cloudcharts/metadata/task/StarrocksTaskOpertion.java @@ -56,6 +56,22 @@ public boolean submitSyncTask(Connection conn, SyncTaskGenInfo taskGenInfo) { } }); // } + log.info("result:{},submit task:{}",res,taskSql); + +// if(res > 0){ + ThreadUtil.execAsync(() -> { + Map resMap = new HashMap(); + resMap.put("taskName",taskGenInfo.getTaskName()); + String taskResultSql = CustomSQL.getInstance().get("task.sr.sync.insert.async.result",resMap).toLowerCase(); + try { + QueryRunner queryRunner = new QueryRunner(); + TaskRunsResult taskRunsResult = queryRunner.query(conn,taskResultSql,new BeanHandler(TaskRunsResult.class, new BasicRowProcessor(new GenerousBeanProcessor()))); + log.info("task:{},result:{}",taskGenInfo.getTaskName(), GsonUtils.gsonString(taskRunsResult)); + } catch (SQLException e) { + throw new RuntimeException(e); + } + }); +// } return res > 0; }