Skip to content

Commit 8a5ea43

Browse files
Merge branch 'branch_wlh' of https://github.com/AllDataDC/alldata into branch_wlh
2 parents 7d65991 + c3b289c commit 8a5ea43

File tree

494 files changed

+54093
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

494 files changed

+54093
-1
lines changed

dataHub/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
# DATA MIDDLE OFFICE BUSINESS FOR ALL DATA PLATFORM 业务
22

3-
数据中台业务
3+
服务与数据中台frontend的多租户运维平台
44

55
1、数据中台前端 dataHub/frontend
66

77
2、数据中台Django后端 dataHub/backend
88

99
3、数据中台Java后端 dataHub/backend-java
1010

11+
4、多租户运维平台前端 dataHub/tenant
12+
13+
5、多租户运维平台前端 dataHub/tenant-java
14+
1115
```

dataHub/tenant-java/.gitkeep

Whitespace-only changes.

dataHub/tenant-java/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# TENANT JAVA FOR ALL DATA PLATFORM
2+
3+
> 多租户运维平台Java后端
4+
> 服务于frontend数据中台项目
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# AMBARI Manage LIFECYCLE
2+
3+
Ambari纳管组件生命周期
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!--
2+
~ Licensed to the Apache Software Foundation (ASF) under one or more
3+
~ contributor license agreements. See the NOTICE file distributed with
4+
~ this work for additional information regarding copyright ownership.
5+
~ The ASF licenses this file to You under the Apache License, Version 2.0
6+
~ (the "License"); you may not use this file except in compliance with
7+
~ the License. You may obtain a copy of the License at
8+
~
9+
~ http://www.apache.org/licenses/LICENSE-2.0
10+
~
11+
~ Unless required by applicable law or agreed to in writing, software
12+
~ distributed under the License is distributed on an "AS IS" BASIS,
13+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
~ See the License for the specific language governing permissions and
15+
~ limitations under the License.
16+
-->
17+
<configuration>
18+
19+
</configuration>
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
Licensed to the Apache Software Foundation (ASF) under one or more
4+
contributor license agreements. See the NOTICE file distributed with
5+
this work for additional information regarding copyright ownership.
6+
The ASF licenses this file to You under the Apache License, Version 2.0
7+
(the "License"); you may not use this file except in compliance with
8+
the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
-->
18+
<metainfo>
19+
<schemaVersion>2.0</schemaVersion>
20+
<services>
21+
<service>
22+
<name>Component</name>
23+
<displayName>Component Service</displayName>
24+
<comment>Component DESC</comment>
25+
<version>1.0</version>
26+
<components>
27+
<component>
28+
<name>COMPONENT_MASTER</name>
29+
<displayName>Component Master</displayName>
30+
<category>MASTER</category>
31+
<cardinality>1+</cardinality>
32+
<commandScript>
33+
<script>scripts/component_service.py</script>
34+
<scriptType>PYTHON</scriptType>
35+
<timeout>600</timeout>
36+
</commandScript>
37+
</component>
38+
</components>
39+
40+
<requiredServices>
41+
<service>otherComponant</service>
42+
</requiredServices>
43+
44+
<configuration-dependencies>
45+
<config-type>configuration</config-type>
46+
</configuration-dependencies>
47+
48+
</service>
49+
</services>
50+
</metainfo>
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
"""
2+
Licensed to the Apache Software Foundation (ASF) under one
3+
or more contributor license agreements. See the NOTICE file
4+
distributed with this work for additional information
5+
regarding copyright ownership. The ASF licenses this file
6+
to you under the Apache License, Version 2.0 (the
7+
"License"); you may not use this file except in compliance
8+
with the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
"""
18+
import time
19+
from resource_management import *
20+
21+
22+
class ComponentService(Script):
23+
def install(self, env):
24+
import params
25+
env.set_params(params)
26+
Execute(('chmod', '-R', '777', params.testDir))
27+
28+
def configure(self, env):
29+
import params
30+
env.set_params(params)
31+
32+
def start(self, env):
33+
import params
34+
env.set_params(params)
35+
self.configure(env)
36+
Execute(('chmod', '-R', '777', params.testDir))
37+
38+
39+
def stop(self, env):
40+
import params
41+
env.set_params(params)
42+
Execute(('chmod', '-R', '777', params.testDir))
43+
44+
def status(self, env):
45+
import params
46+
env.set_params(params)
47+
check_process_status("/usr/run/test.pid")
48+
49+
50+
if __name__ == "__main__":
51+
ComponentService().execute()
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
"""
2+
Licensed to the Apache Software Foundation (ASF) under one
3+
or more contributor license agreements. See the NOTICE file
4+
distributed with this work for additional information
5+
regarding copyright ownership. The ASF licenses this file
6+
to you under the Apache License, Version 2.0 (the
7+
"License"); you may not use this file except in compliance
8+
with the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
"""
18+
19+
20+
import sys
21+
from resource_management import *
22+
from resource_management.core.logger import Logger
23+
from resource_management.libraries.functions import default
24+
25+
Logger.initialize_logger()
26+
reload(sys)
27+
sys.setdefaultencoding('utf-8')
28+
29+
# server configurations
30+
config = Script.get_config()
31+
32+
# conf_dir = "/etc/"
33+
testDir = "/opt/soft/installDir"
34+
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/bash
2+
echo "manage component lifecycle by ambari"

dataHub/tenant-java/pom.xml

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<groupId>com.platform</groupId>
6+
<version>1.0</version>
7+
<modelVersion>4.0.0</modelVersion>
8+
<artifactId>tenant-java</artifactId>
9+
10+
<properties>
11+
<maven.compiler.source>8</maven.compiler.source>
12+
<maven.compiler.target>8</maven.compiler.target>
13+
<backend.java.version>4.0.0-SNAPSHOT</backend.java.version>
14+
</properties>
15+
<dependencies>
16+
<dependency>
17+
<groupId>org.apache.flink</groupId>
18+
<artifactId>flink-sql-parser</artifactId>
19+
<version>1.12.0</version>
20+
</dependency>
21+
<dependency>
22+
<groupId>org.apache.calcite</groupId>
23+
<artifactId>calcite-linq4j</artifactId>
24+
<version>1.26.0</version>
25+
</dependency>
26+
27+
<dependency>
28+
<groupId>org.apache.kylin</groupId>
29+
<artifactId>kylin-core-metadata</artifactId>
30+
<version>${backend.java.version}</version>
31+
</dependency>
32+
33+
<dependency>
34+
<groupId>com.fasterxml.jackson.dataformat</groupId>
35+
<artifactId>jackson-dataformat-xml</artifactId>
36+
<version>2.10.0</version>
37+
</dependency>
38+
<!-- https://mvnrepository.com/artifact/commons-dbcp/commons-dbcp -->
39+
<dependency>
40+
<groupId>commons-dbcp</groupId>
41+
<artifactId>commons-dbcp</artifactId>
42+
<version>1.4</version>
43+
</dependency>
44+
<dependency>
45+
<groupId>org.apache.kylin</groupId>
46+
<artifactId>kylin-shaded-guava</artifactId>
47+
<version>3.1.0</version>
48+
</dependency>
49+
50+
51+
</dependencies>
52+
53+
<build>
54+
<plugins>
55+
<plugin>
56+
<groupId>org.apache.maven.plugins</groupId>
57+
<artifactId>maven-shade-plugin</artifactId>
58+
<executions>
59+
<execution>
60+
<id>0</id>
61+
<phase>package</phase>
62+
<goals>
63+
<goal>shade</goal>
64+
</goals>
65+
<configuration>
66+
<minimizeJar>false</minimizeJar>
67+
<shadedArtifactAttached>true</shadedArtifactAttached>
68+
<shadedClassifierName>lib</shadedClassifierName>
69+
<filters>
70+
<filter>
71+
<artifact>*:*</artifact>
72+
<includes>
73+
<include>org/apache/kylin/sdk/datasource/adaptor/**</include>
74+
<include>datasource/**</include>
75+
</includes>
76+
</filter>
77+
</filters>
78+
</configuration>
79+
</execution>
80+
<execution>
81+
<id>1</id>
82+
<phase>package</phase>
83+
<goals>
84+
<goal>shade</goal>
85+
</goals>
86+
<configuration>
87+
<minimizeJar>false</minimizeJar>
88+
<shadedArtifactAttached>true</shadedArtifactAttached>
89+
<shadedClassifierName>framework</shadedClassifierName>
90+
<filters>
91+
<filter>
92+
<artifact>*:*</artifact>
93+
<includes>
94+
<include>org/apache/kylin/sdk/datasource/framework/**</include>
95+
</includes>
96+
</filter>
97+
</filters>
98+
</configuration>
99+
</execution>
100+
<execution>
101+
<id>2</id>
102+
<phase>package</phase>
103+
<goals>
104+
<goal>shade</goal>
105+
</goals>
106+
<configuration>
107+
<minimizeJar>false</minimizeJar>
108+
<shadedArtifactAttached>true</shadedArtifactAttached>
109+
<shadedClassifierName>testsuite</shadedClassifierName>
110+
<filters>
111+
<filter>
112+
<artifact>*:*</artifact>
113+
<includes>
114+
<include>org/apache/kylin/sdk/datasource/framework/**</include>
115+
<include>org/apache/kylin/sdk/datasource/adaptor/**</include>
116+
</includes>
117+
</filter>
118+
</filters>
119+
</configuration>
120+
</execution>
121+
</executions>
122+
</plugin>
123+
</plugins>
124+
</build>
125+
</project>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package com.platform.controller.task;
2+
3+
public class Mysql2IcebergController {
4+
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
package com.platform.olap;
2+
3+
import org.apache.calcite.avatica.util.Casing;
4+
import org.apache.calcite.sql.SqlNode;
5+
import org.apache.calcite.sql.parser.SqlParser;
6+
import org.apache.flink.sql.parser.impl.FlinkSqlParserImpl;
7+
import org.apache.flink.sql.parser.validate.FlinkSqlConformance;
8+
9+
import java.util.ArrayList;
10+
import java.util.List;
11+
12+
import static org.apache.calcite.avatica.util.Quoting.BACK_TICK;
13+
14+
/**
15+
* Function: Flink SQL Parse
16+
*/
17+
public class CalciteParser {
18+
/**
19+
* 解析&校验 Flink SQL语句
20+
*
21+
* @param sql 一整段字符串sql
22+
* @return sql语句list
23+
*/
24+
public static List<String> parseFlinkSql(String sql) {
25+
List<String> sqlList = new ArrayList<>();
26+
if (sql != null && !sql.isEmpty()) {
27+
try {
28+
SqlParser parser = SqlParser.create(sql, SqlParser.configBuilder()
29+
.setParserFactory(FlinkSqlParserImpl.FACTORY)
30+
.setQuoting(BACK_TICK)
31+
.setUnquotedCasing(Casing.TO_LOWER) //字段名统一转化为小写
32+
.setQuotedCasing(Casing.UNCHANGED)
33+
.setConformance(FlinkSqlConformance.DEFAULT)
34+
.build()
35+
);
36+
List<SqlNode> sqlNodeList = parser.parseStmtList().getList();
37+
if (sqlNodeList != null && !sqlNodeList.isEmpty()) {
38+
for (SqlNode sqlNode : sqlNodeList) {
39+
sqlList.add(sqlNode.toString());
40+
}
41+
}
42+
} catch (Exception e) {
43+
e.printStackTrace();
44+
}
45+
}
46+
47+
return sqlList;
48+
}
49+
50+
public static void main(String[] args) {
51+
String sql = "select * from `A`.`test`";
52+
System.out.println(parseFlinkSql(sql));
53+
String errorSql = "select * fxxm `A`.`test`";
54+
System.out.println(parseFlinkSql(errorSql));
55+
}
56+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package com.platform.service.base;
2+
3+
public interface BaseBackendService {
4+
default void build(){}
5+
}

0 commit comments

Comments
 (0)