-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #58 from chaogefeng/master
Added JDBC engine support and updated JDBC installation scripts
- Loading branch information
Showing
23 changed files
with
1,710 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
ujes/definedEngines/jdbc/entrance/bin/start-jdbcentrance.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
|
||
cd `dirname $0` | ||
cd .. | ||
HOME=`pwd` | ||
export DWS_ENGINE_MANAGER_HOME=$HOME | ||
|
||
export DWS_ENGINE_MANAGER_PID=$HOME/bin/linkis.pid | ||
|
||
if [[ -f "${DWS_ENGINE_MANAGER_PID}" ]]; then | ||
pid=$(cat ${DWS_ENGINE_MANAGER_PID}) | ||
if kill -0 ${pid} >/dev/null 2>&1; then | ||
echo "JDBC Entrance is already running." | ||
return 0; | ||
fi | ||
fi | ||
|
||
export DWS_ENGINE_MANAGER_LOG_PATH=$HOME/logs | ||
export DWS_ENGINE_MANAGER_HEAP_SIZE="1G" | ||
export DWS_ENGINE_MANAGER_JAVA_OPTS="-Xms$DWS_ENGINE_MANAGER_HEAP_SIZE -Xmx$DWS_ENGINE_MANAGER_HEAP_SIZE -XX:+UseG1GC -XX:MaxPermSize=500m -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=11716" | ||
|
||
nohup java $DWS_ENGINE_MANAGER_JAVA_OPTS -cp $HOME/conf:$HOME/lib/* com.webank.wedatasphere.linkis.DataWorkCloudApplication 2>&1 > $DWS_ENGINE_MANAGER_LOG_PATH/linkis.out & | ||
pid=$! | ||
if [[ -z "${pid}" ]]; then | ||
echo "JDBC Entrance start failed!" | ||
exit 1 | ||
else | ||
echo "JDBC Entrance start succeeded!" | ||
echo $pid > $DWS_ENGINE_MANAGER_PID | ||
sleep 1 | ||
fi |
47 changes: 47 additions & 0 deletions
47
ujes/definedEngines/jdbc/entrance/bin/stop-jdbcentrance.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/bin/bash | ||
|
||
cd `dirname $0` | ||
cd .. | ||
HOME=`pwd` | ||
|
||
export DWS_ENGINE_MANAGER_PID=$HOME/bin/linkis.pid | ||
|
||
function wait_for_DWS_ENGINE_MANAGER_to_die() { | ||
local pid | ||
local count | ||
pid=$1 | ||
timeout=$2 | ||
count=0 | ||
timeoutTime=$(date "+%s") | ||
let "timeoutTime+=$timeout" | ||
currentTime=$(date "+%s") | ||
forceKill=1 | ||
|
||
while [[ $currentTime -lt $timeoutTime ]]; do | ||
$(kill ${pid} > /dev/null 2> /dev/null) | ||
if kill -0 ${pid} > /dev/null 2>&1; then | ||
sleep 3 | ||
else | ||
forceKill=0 | ||
break | ||
fi | ||
currentTime=$(date "+%s") | ||
done | ||
|
||
if [[ forceKill -ne 0 ]]; then | ||
$(kill -9 ${pid} > /dev/null 2> /dev/null) | ||
fi | ||
} | ||
|
||
if [[ ! -f "${DWS_ENGINE_MANAGER_PID}" ]]; then | ||
echo "JDBC Entrance is not running" | ||
else | ||
pid=$(cat ${DWS_ENGINE_MANAGER_PID}) | ||
if [[ -z "${pid}" ]]; then | ||
echo "JDBC Entrance is not running" | ||
else | ||
wait_for_DWS_ENGINE_MANAGER_to_die $pid 40 | ||
$(rm -f ${DWS_ENGINE_MANAGER_PID}) | ||
echo "JDBC Entrance is stopped." | ||
fi | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
~ Copyright 2019 WeBank | ||
~ | ||
~ Licensed 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. | ||
--> | ||
|
||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
|
||
<parent> | ||
<artifactId>linkis</artifactId> | ||
<groupId>com.webank.wedatasphere.linkis</groupId> | ||
<version>0.9.0</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>linkis-jdbc-entrance</artifactId> | ||
|
||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>com.webank.wedatasphere.linkis</groupId> | ||
<artifactId>linkis-ujes-entrance</artifactId> | ||
<version>${linkis.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.typesafe</groupId> | ||
<artifactId>config</artifactId> | ||
<version>1.2.1</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.postgresql</groupId> | ||
<artifactId>postgresql</artifactId> | ||
<version>42.2.6</version> | ||
</dependency> | ||
<!-- <dependency> | ||
<groupId>com.oracle.jdbc</groupId> | ||
<artifactId>ojdbc6</artifactId> | ||
<version>11.1.0.6.0</version> | ||
<scope>runtime</scope> | ||
</dependency>--> | ||
<dependency> | ||
<groupId>org.apache.hive</groupId> | ||
<artifactId>hive-jdbc</artifactId> | ||
<version>1.2.1</version> | ||
<exclusions> | ||
<exclusion> | ||
<groupId>org.apache.hive</groupId> | ||
<artifactId>hive-shims</artifactId> | ||
</exclusion> | ||
<exclusion> | ||
<groupId>org.eclipse.jetty.aggregate</groupId> | ||
<artifactId>jetty-all</artifactId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
|
||
|
||
<dependency> | ||
<groupId>org.apache.thrift</groupId> | ||
<artifactId>libthrift</artifactId> | ||
<version>0.9.2</version> | ||
<type>pom</type> | ||
</dependency> | ||
</dependencies> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-deploy-plugin</artifactId> | ||
</plugin> | ||
|
||
<plugin> | ||
<groupId>net.alchim31.maven</groupId> | ||
<artifactId>scala-maven-plugin</artifactId> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-jar-plugin</artifactId> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-assembly-plugin</artifactId> | ||
<version>2.3</version> | ||
<inherited>false</inherited> | ||
<executions> | ||
<execution> | ||
<id>make-assembly</id> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>single</goal> | ||
</goals> | ||
<configuration> | ||
<descriptors> | ||
<descriptor>src/main/assembly/distribution.xml</descriptor> | ||
</descriptors> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<skipAssembly>false</skipAssembly> | ||
<finalName>linkis-ujes-jdbc-entrance</finalName> | ||
<appendAssemblyId>false</appendAssemblyId> | ||
<attach>false</attach> | ||
<descriptors> | ||
<descriptor>src/main/assembly/distribution.xml</descriptor> | ||
</descriptors> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
<resources> | ||
<resource> | ||
<directory>${basedir}/src/main/resources</directory> | ||
<includes> | ||
<include>**/*.properties</include> | ||
<include>**/*.xml</include> | ||
<include>**/*.yml</include> | ||
</includes> | ||
</resource> | ||
</resources> | ||
<finalName>${project.artifactId}-${project.version}</finalName> | ||
</build> | ||
|
||
</project> |
Oops, something went wrong.