qiaozhanwei
5 years ago
258 changed files with 10928 additions and 5462 deletions
@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!-- |
||||
~ 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. |
||||
--> |
||||
|
||||
<!-- Logback configuration. See http://logback.qos.ch/manual/index.html --> |
||||
<configuration scan="true" scanPeriod="120 seconds"> <!--debug="true" --> |
||||
|
||||
<property name="log.base" value="logs"/> |
||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> |
||||
<encoder> |
||||
<pattern> |
||||
[%level] %date{yyyy-MM-dd HH:mm:ss.SSS} %logger{96}:[%line] - %msg%n |
||||
</pattern> |
||||
<charset>UTF-8</charset> |
||||
</encoder> |
||||
</appender> |
||||
|
||||
<appender name="ALERTLOGFILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
||||
<file>${log.base}/dolphinscheduler-alert.log</file> |
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> |
||||
<fileNamePattern>${log.base}/dolphinscheduler-alert.%d{yyyy-MM-dd_HH}.%i.log</fileNamePattern> |
||||
<maxHistory>20</maxHistory> |
||||
<maxFileSize>64MB</maxFileSize> |
||||
</rollingPolicy> |
||||
<encoder> |
||||
<pattern> |
||||
[%level] %date{yyyy-MM-dd HH:mm:ss.SSS} %logger{96}:[%line] - %msg%n |
||||
</pattern> |
||||
<charset>UTF-8</charset> |
||||
</encoder> |
||||
</appender> |
||||
|
||||
<root level="INFO"> |
||||
<appender-ref ref="STDOUT"/> |
||||
<appender-ref ref="APILOGFILE"/> |
||||
</root> |
||||
|
||||
</configuration> |
@ -0,0 +1,62 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!-- |
||||
~ 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. |
||||
--> |
||||
|
||||
<!-- Logback configuration. See http://logback.qos.ch/manual/index.html --> |
||||
<configuration scan="true" scanPeriod="120 seconds"> <!--debug="true" --> |
||||
|
||||
<property name="log.base" value="logs"/> |
||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> |
||||
<encoder> |
||||
<pattern> |
||||
[%level] %date{yyyy-MM-dd HH:mm:ss.SSS} %logger{96}:[%line] - %msg%n |
||||
</pattern> |
||||
<charset>UTF-8</charset> |
||||
</encoder> |
||||
</appender> |
||||
|
||||
<!-- api server logback config start --> |
||||
<appender name="APILOGFILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
||||
<file>${log.base}/dolphinscheduler-api-server.log</file> |
||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter"> |
||||
<level>INFO</level> |
||||
</filter> |
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> |
||||
<fileNamePattern>${log.base}/dolphinscheduler-api-server.%d{yyyy-MM-dd_HH}.%i.log</fileNamePattern> |
||||
<maxHistory>168</maxHistory> |
||||
<maxFileSize>64MB</maxFileSize> |
||||
</rollingPolicy> |
||||
<encoder> |
||||
<pattern> |
||||
[%level] %date{yyyy-MM-dd HH:mm:ss.SSS} %logger{96}:[%line] - %msg%n |
||||
</pattern> |
||||
<charset>UTF-8</charset> |
||||
</encoder> |
||||
</appender> |
||||
<!-- api server logback config end --> |
||||
|
||||
<logger name="org.apache.zookeeper" level="WARN"/> |
||||
<logger name="org.apache.hbase" level="WARN"/> |
||||
<logger name="org.apache.hadoop" level="WARN"/> |
||||
|
||||
|
||||
<root level="INFO"> |
||||
<appender-ref ref="STDOUT"/> |
||||
<appender-ref ref="APILOGFILE"/> |
||||
</root> |
||||
|
||||
</configuration> |
File diff suppressed because one or more lines are too long
@ -1,169 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!-- |
||||
~ 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. |
||||
--> |
||||
|
||||
<!-- Logback configuration. See http://logback.qos.ch/manual/index.html --> |
||||
<configuration scan="true" scanPeriod="120 seconds"> <!--debug="true" --> |
||||
|
||||
<property name="log.base" value="logs"/> |
||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> |
||||
<encoder> |
||||
<pattern> |
||||
[%level] %date{yyyy-MM-dd HH:mm:ss.SSS} %logger{96}:[%line] - %msg%n |
||||
</pattern> |
||||
<charset>UTF-8</charset> |
||||
</encoder> |
||||
</appender> |
||||
|
||||
|
||||
<!-- master server logback config start --> |
||||
<appender name="MASTERLOGFILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
||||
<file>${log.base}/dolphinscheduler-master.log</file> |
||||
<!--<filter class="org.apache.dolphinscheduler.common.log.MasterLogFilter"> |
||||
<level>INFO</level> |
||||
</filter>--> |
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> |
||||
<fileNamePattern>${log.base}/dolphinscheduler-master.%d{yyyy-MM-dd_HH}.%i.log</fileNamePattern> |
||||
<maxHistory>168</maxHistory> |
||||
<maxFileSize>200MB</maxFileSize> |
||||
</rollingPolicy> |
||||
<encoder> |
||||
<pattern> |
||||
[%level] %date{yyyy-MM-dd HH:mm:ss.SSS} %logger{96}:[%line] - %msg%n |
||||
</pattern> |
||||
<charset>UTF-8</charset> |
||||
</encoder> |
||||
</appender> |
||||
<!-- master server logback config end --> |
||||
|
||||
|
||||
<!-- worker server logback config start --> |
||||
<conversionRule conversionWord="messsage" |
||||
converterClass="org.apache.dolphinscheduler.common.log.SensitiveDataConverter"/> |
||||
<appender name="TASKLOGFILE" class="ch.qos.logback.classic.sift.SiftingAppender"> |
||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter"> |
||||
<level>INFO</level> |
||||
</filter> |
||||
<filter class="org.apache.dolphinscheduler.common.log.TaskLogFilter"/> |
||||
<Discriminator class="org.apache.dolphinscheduler.common.log.TaskLogDiscriminator"> |
||||
<key>taskAppId</key> |
||||
<logBase>${log.base}</logBase> |
||||
</Discriminator> |
||||
<sift> |
||||
<appender name="FILE-${taskAppId}" class="ch.qos.logback.core.FileAppender"> |
||||
<file>${log.base}/${taskAppId}.log</file> |
||||
<encoder> |
||||
<pattern> |
||||
[%level] %date{yyyy-MM-dd HH:mm:ss.SSS} %logger{96}:[%line] - %messsage%n |
||||
</pattern> |
||||
<charset>UTF-8</charset> |
||||
</encoder> |
||||
<append>true</append> |
||||
</appender> |
||||
</sift> |
||||
</appender> |
||||
<appender name="WORKERLOGFILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
||||
<file>${log.base}/dolphinscheduler-worker.log</file> |
||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter"> |
||||
<level>INFO</level> |
||||
</filter> |
||||
<filter class="org.apache.dolphinscheduler.common.log.WorkerLogFilter"/> |
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> |
||||
<fileNamePattern>${log.base}/dolphinscheduler-worker.%d{yyyy-MM-dd_HH}.%i.log</fileNamePattern> |
||||
<maxHistory>168</maxHistory> |
||||
<maxFileSize>200MB</maxFileSize> |
||||
</rollingPolicy> |
||||
<encoder> |
||||
<pattern> |
||||
[%level] %date{yyyy-MM-dd HH:mm:ss.SSS} %logger{96}:[%line] - %messsage%n |
||||
</pattern> |
||||
<charset>UTF-8</charset> |
||||
</encoder> |
||||
</appender> |
||||
<!-- worker server logback config end --> |
||||
|
||||
|
||||
<!-- alert server logback config start --> |
||||
<appender name="ALERTLOGFILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
||||
<file>${log.base}/dolphinscheduler-alert.log</file> |
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> |
||||
<fileNamePattern>${log.base}/dolphinscheduler-alert.%d{yyyy-MM-dd_HH}.%i.log</fileNamePattern> |
||||
<maxHistory>20</maxHistory> |
||||
<maxFileSize>64MB</maxFileSize> |
||||
</rollingPolicy> |
||||
<encoder> |
||||
<pattern> |
||||
[%level] %date{yyyy-MM-dd HH:mm:ss.SSS} %logger{96}:[%line] - %msg%n |
||||
</pattern> |
||||
<charset>UTF-8</charset> |
||||
</encoder> |
||||
</appender> |
||||
<!-- alert server logback config end --> |
||||
|
||||
|
||||
<!-- api server logback config start --> |
||||
<appender name="APILOGFILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
||||
<file>${log.base}/dolphinscheduler-api-server.log</file> |
||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter"> |
||||
<level>INFO</level> |
||||
</filter> |
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> |
||||
<fileNamePattern>${log.base}/dolphinscheduler-api-server.%d{yyyy-MM-dd_HH}.%i.log</fileNamePattern> |
||||
<maxHistory>168</maxHistory> |
||||
<maxFileSize>64MB</maxFileSize> |
||||
</rollingPolicy> |
||||
<encoder> |
||||
<pattern> |
||||
[%level] %date{yyyy-MM-dd HH:mm:ss.SSS} %logger{96}:[%line] - %msg%n |
||||
</pattern> |
||||
<charset>UTF-8</charset> |
||||
</encoder> |
||||
</appender> |
||||
<!-- api server logback config end --> |
||||
|
||||
<logger name="org.apache.zookeeper" level="WARN"/> |
||||
<logger name="org.apache.hbase" level="WARN"/> |
||||
<logger name="org.apache.hadoop" level="WARN"/> |
||||
|
||||
|
||||
<root level="INFO"> |
||||
<appender-ref ref="STDOUT"/> |
||||
|
||||
<if condition='p("server").contains("master-server")'> |
||||
<then> |
||||
<appender-ref ref="MASTERLOGFILE"/> |
||||
</then> |
||||
</if> |
||||
<if condition='p("server").contains("worker-server")'> |
||||
<then> |
||||
<appender-ref ref="TASKLOGFILE"/> |
||||
<appender-ref ref="WORKERLOGFILE"/> |
||||
</then> |
||||
</if> |
||||
<if condition='p("server").contains("alert-server")'> |
||||
<then> |
||||
<appender-ref ref="ALERTLOGFILE"/> |
||||
</then> |
||||
</if> |
||||
<if condition='p("server").contains("api-server")'> |
||||
<then> |
||||
<appender-ref ref="APILOGFILE"/> |
||||
</then> |
||||
</if> |
||||
</root> |
||||
|
||||
</configuration> |
@ -1,145 +0,0 @@
|
||||
# |
||||
# 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. |
||||
# |
||||
|
||||
# base spring data source configuration |
||||
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource |
||||
# postgre |
||||
spring.datasource.driver-class-name=org.postgresql.Driver |
||||
spring.datasource.url=jdbc:postgresql://localhost:5432/dolphinscheduler |
||||
# mysql |
||||
#spring.datasource.driver-class-name=com.mysql.jdbc.Driver |
||||
#spring.datasource.url=jdbc:mysql://192.168.xx.xx:3306/dolphinscheduler?useUnicode=true&characterEncoding=UTF-8 |
||||
spring.datasource.username=test |
||||
spring.datasource.password=test |
||||
|
||||
# connection configuration |
||||
spring.datasource.initialSize=5 |
||||
# min connection number |
||||
spring.datasource.minIdle=5 |
||||
# max connection number |
||||
spring.datasource.maxActive=50 |
||||
|
||||
# max wait time for get a connection in milliseconds. if configuring maxWait, fair locks are enabled by default and concurrency efficiency decreases. |
||||
# If necessary, unfair locks can be used by configuring the useUnfairLock attribute to true. |
||||
spring.datasource.maxWait=60000 |
||||
|
||||
# milliseconds for check to close free connections |
||||
spring.datasource.timeBetweenEvictionRunsMillis=60000 |
||||
|
||||
# the Destroy thread detects the connection interval and closes the physical connection in milliseconds if the connection idle time is greater than or equal to minEvictableIdleTimeMillis. |
||||
spring.datasource.timeBetweenConnectErrorMillis=60000 |
||||
|
||||
# the longest time a connection remains idle without being evicted, in milliseconds |
||||
spring.datasource.minEvictableIdleTimeMillis=300000 |
||||
|
||||
#the SQL used to check whether the connection is valid requires a query statement. If validation Query is null, testOnBorrow, testOnReturn, and testWhileIdle will not work. |
||||
spring.datasource.validationQuery=SELECT 1 |
||||
|
||||
#check whether the connection is valid for timeout, in seconds |
||||
spring.datasource.validationQueryTimeout=3 |
||||
|
||||
# when applying for a connection, if it is detected that the connection is idle longer than time Between Eviction Runs Millis, |
||||
# validation Query is performed to check whether the connection is valid |
||||
spring.datasource.testWhileIdle=true |
||||
|
||||
#execute validation to check if the connection is valid when applying for a connection |
||||
spring.datasource.testOnBorrow=true |
||||
#execute validation to check if the connection is valid when the connection is returned |
||||
spring.datasource.testOnReturn=false |
||||
spring.datasource.defaultAutoCommit=true |
||||
spring.datasource.keepAlive=true |
||||
|
||||
# open PSCache, specify count PSCache for every connection |
||||
spring.datasource.poolPreparedStatements=true |
||||
spring.datasource.maxPoolPreparedStatementPerConnectionSize=20 |
||||
|
||||
spring.datasource.spring.datasource.filters=stat,wall,log4j |
||||
spring.datasource.connectionProperties=druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000 |
||||
|
||||
#mybatis |
||||
mybatis-plus.mapper-locations=classpath*:/org.apache.dolphinscheduler.dao.mapper/*.xml |
||||
|
||||
mybatis-plus.typeEnumsPackage=org.apache.dolphinscheduler.*.enums |
||||
|
||||
#Entity scan, where multiple packages are separated by a comma or semicolon |
||||
mybatis-plus.typeAliasesPackage=org.apache.dolphinscheduler.dao.entity |
||||
|
||||
#Primary key type AUTO:" database ID AUTO ", INPUT:" user INPUT ID", ID_WORKER:" global unique ID (numeric type unique ID)", UUID:" global unique ID UUID"; |
||||
mybatis-plus.global-config.db-config.id-type=AUTO |
||||
|
||||
#Field policy IGNORED:" ignore judgment ",NOT_NULL:" not NULL judgment "),NOT_EMPTY:" not NULL judgment" |
||||
mybatis-plus.global-config.db-config.field-strategy=NOT_NULL |
||||
|
||||
#The hump underline is converted |
||||
mybatis-plus.global-config.db-config.column-underline=true |
||||
mybatis-plus.global-config.db-config.logic-delete-value=-1 |
||||
mybatis-plus.global-config.db-config.logic-not-delete-value=0 |
||||
mybatis-plus.global-config.db-config.banner=false |
||||
#The original configuration |
||||
mybatis-plus.configuration.map-underscore-to-camel-case=true |
||||
mybatis-plus.configuration.cache-enabled=false |
||||
mybatis-plus.configuration.call-setters-on-nulls=true |
||||
mybatis-plus.configuration.jdbc-type-for-null=null |
||||
|
||||
# master settings |
||||
# master execute thread num |
||||
master.exec.threads=100 |
||||
|
||||
# master execute task number in parallel |
||||
master.exec.task.num=20 |
||||
|
||||
# master heartbeat interval |
||||
master.heartbeat.interval=10 |
||||
|
||||
# master commit task retry times |
||||
master.task.commit.retryTimes=5 |
||||
|
||||
# master commit task interval |
||||
master.task.commit.interval=1000 |
||||
|
||||
|
||||
# only less than cpu avg load, master server can work. default value : the number of cpu cores * 2 |
||||
master.max.cpuload.avg=100 |
||||
|
||||
# only larger than reserved memory, master server can work. default value : physical memory * 1/10, unit is G. |
||||
master.reserved.memory=0.1 |
||||
|
||||
# worker settings |
||||
# worker execute thread num |
||||
worker.exec.threads=100 |
||||
|
||||
# worker heartbeat interval |
||||
worker.heartbeat.interval=10 |
||||
|
||||
# submit the number of tasks at a time |
||||
worker.fetch.task.num = 3 |
||||
|
||||
# only less than cpu avg load, worker server can work. default value : the number of cpu cores * 2 |
||||
worker.max.cpuload.avg=100 |
||||
|
||||
# only larger than reserved memory, worker server can work. default value : physical memory * 1/6, unit is G. |
||||
worker.reserved.memory=0.1 |
||||
|
||||
# data quality analysis is not currently in use. please ignore the following configuration |
||||
# task record |
||||
task.record.flag=false |
||||
task.record.datasource.url=jdbc:mysql://192.168.xx.xx:3306/etl?characterEncoding=UTF-8 |
||||
task.record.datasource.username=xx |
||||
task.record.datasource.password=xx |
||||
|
||||
# Logger Config |
||||
#logging.level.org.apache.dolphinscheduler.dao=debug |
@ -0,0 +1,75 @@
|
||||
# |
||||
# 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. |
||||
# |
||||
|
||||
|
||||
# postgre |
||||
#spring.datasource.driver-class-name=org.postgresql.Driver |
||||
#spring.datasource.url=jdbc:postgresql://localhost:5432/dolphinscheduler |
||||
# mysql |
||||
spring.datasource.driver-class-name=com.mysql.jdbc.Driver |
||||
spring.datasource.url=jdbc:mysql://localhost:3306/dolphinscheduler?useUnicode=true&characterEncoding=UTF-8 |
||||
spring.datasource.username=root |
||||
spring.datasource.password=root@123 |
||||
|
||||
## base spring data source configuration todo need to remove |
||||
#spring.datasource.type=com.alibaba.druid.pool.DruidDataSource |
||||
|
||||
# connection configuration |
||||
#spring.datasource.initialSize=5 |
||||
# min connection number |
||||
#spring.datasource.minIdle=5 |
||||
# max connection number |
||||
#spring.datasource.maxActive=50 |
||||
|
||||
# max wait time for get a connection in milliseconds. if configuring maxWait, fair locks are enabled by default and concurrency efficiency decreases. |
||||
# If necessary, unfair locks can be used by configuring the useUnfairLock attribute to true. |
||||
#spring.datasource.maxWait=60000 |
||||
|
||||
# milliseconds for check to close free connections |
||||
#spring.datasource.timeBetweenEvictionRunsMillis=60000 |
||||
|
||||
# the Destroy thread detects the connection interval and closes the physical connection in milliseconds if the connection idle time is greater than or equal to minEvictableIdleTimeMillis. |
||||
#spring.datasource.timeBetweenConnectErrorMillis=60000 |
||||
|
||||
# the longest time a connection remains idle without being evicted, in milliseconds |
||||
#spring.datasource.minEvictableIdleTimeMillis=300000 |
||||
|
||||
#the SQL used to check whether the connection is valid requires a query statement. If validation Query is null, testOnBorrow, testOnReturn, and testWhileIdle will not work. |
||||
#spring.datasource.validationQuery=SELECT 1 |
||||
|
||||
#check whether the connection is valid for timeout, in seconds |
||||
#spring.datasource.validationQueryTimeout=3 |
||||
|
||||
# when applying for a connection, if it is detected that the connection is idle longer than time Between Eviction Runs Millis, |
||||
# validation Query is performed to check whether the connection is valid |
||||
#spring.datasource.testWhileIdle=true |
||||
|
||||
#execute validation to check if the connection is valid when applying for a connection |
||||
#spring.datasource.testOnBorrow=true |
||||
#execute validation to check if the connection is valid when the connection is returned |
||||
#spring.datasource.testOnReturn=false |
||||
#spring.datasource.defaultAutoCommit=true |
||||
#spring.datasource.keepAlive=true |
||||
|
||||
# open PSCache, specify count PSCache for every connection |
||||
#spring.datasource.poolPreparedStatements=true |
||||
#spring.datasource.maxPoolPreparedStatementPerConnectionSize=20 |
||||
|
||||
#spring.datasource.filters=stat,wall,log4j |
||||
#spring.datasource.connectionProperties=druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000 |
||||
|
||||
|
@ -1 +1 @@
|
||||
/*
* 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.
*/
package org.apache.dolphinscheduler.remote.command;
public enum CommandType {
/**
* roll view log request
*/
ROLL_VIEW_LOG_REQUEST,
/**
* roll view log response
*/
ROLL_VIEW_LOG_RESPONSE,
/**
* view whole log request
*/
VIEW_WHOLE_LOG_REQUEST,
/**
* view whole log response
*/
VIEW_WHOLE_LOG_RESPONSE,
/**
* get log bytes request
*/
GET_LOG_BYTES_REQUEST,
/**
* get log bytes response
*/
GET_LOG_BYTES_RESPONSE,
WORKER_REQUEST,
MASTER_RESPONSE,
/**
* execute task request
*/
EXECUTE_TASK_REQUEST,
/**
* execute task response
*/
EXECUTE_TASK_RESPONSE,
/**
* ping
*/
PING,
/**
* pong
*/
PONG;
} |
||||
/*
* 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.
*/
package org.apache.dolphinscheduler.remote.command;
public enum CommandType {
/**
* roll view log request
*/
ROLL_VIEW_LOG_REQUEST,
/**
* roll view log response
*/
ROLL_VIEW_LOG_RESPONSE,
/**
* view whole log request
*/
VIEW_WHOLE_LOG_REQUEST,
/**
* view whole log response
*/
VIEW_WHOLE_LOG_RESPONSE,
/**
* get log bytes request
*/
GET_LOG_BYTES_REQUEST,
/**
* get log bytes response
*/
GET_LOG_BYTES_RESPONSE,
WORKER_REQUEST,
MASTER_RESPONSE,
/**
* execute task request
*/
TASK_EXECUTE_REQUEST,
/**
* execute task ack
EXECUTE_TASK_REQUEST,
EXECUTE_TASK_REQUEST,
EXECUTE_TASK_REQUEST,
/**
EXECUTE_TASK_REQUEST,
/**
*/
EXECUTE_TASK_REQUEST,
* execute task response
/**
EXECUTE_TASK_REQUEST,
*/
*/
EXECUTE_TASK_REQUEST,
EXECUTE_TASK
/**
* kill task response
*/
TASK_KILL_RESPONSE,
/**
* ping
*/
PING,
/**
* pong
*/
PONG;
} |
@ -1 +0,0 @@
|
||||
/*
* 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.
*/
package org.apache.dolphinscheduler.remote.command;
import org.apache.dolphinscheduler.remote.utils.FastJsonSerializer;
import java.io.Serializable;
import java.util.List;
import java.util.concurrent.atomic.AtomicLong;
/**
* execute task request command
*/
public class ExecuteTaskRequestCommand implements Serializable {
/**
* task id
*/
private String taskId;
/**
* attempt id
*/
private String attemptId;
/**
* application name
*/
private String applicationName;
/**
* group name
*/
private String groupName;
/**
* task name
*/
private String taskName;
/**
* connector port
*/
private int connectorPort;
/**
* description info
*/
private String description;
/**
* class name
*/
private String className;
/**
* method name
*/
private String methodName;
/**
* parameters
*/
private String params;
/**
* shard itemds
*/
private List<Integer> shardItems;
public List<Integer> getShardItems() {
return shardItems;
}
public void setShardItems(List<Integer> shardItems) {
this.shardItems = shardItems;
}
public String getParams() {
return params;
}
public void setParams(String params) {
this.params = params;
}
public String getTaskId() {
return taskId;
}
public void setTaskId(String taskId) {
this.taskId = taskId;
}
public String getApplicationName() {
return applicationName;
}
public void setApplicationName(String applicationName) {
this.applicationName = applicationName;
}
public String getGroupName() {
return groupName;
}
public void setGroupName(String groupName) {
this.groupName = groupName;
}
public String getTaskName() {
return taskName;
}
public void setTaskName(String taskName) {
this.taskName = taskName;
}
public int getConnectorPort() {
return connectorPort;
}
public void setConnectorPort(int connectorPort) {
this.connectorPort = connectorPort;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getClassName() {
return className;
}
public void setClassName(String className) {
this.className = className;
}
public String getMethodName() {
return methodName;
}
public void setMethodName(String methodName) {
this.methodName = methodName;
}
/**
* package request command
*
* @return command
*/
public Command convert2Command(){
Command command = new Command();
command.setType(CommandType.EXECUTE_TASK_REQUEST);
byte[] body = FastJsonSerializer.serialize(this);
command.setBody(body);
return command;
}
} |
@ -1 +0,0 @@
|
||||
/*
* 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.
*/
package org.apache.dolphinscheduler.remote.command;
import org.apache.dolphinscheduler.remote.utils.FastJsonSerializer;
import java.io.Serializable;
import java.util.concurrent.atomic.AtomicLong;
/**
* execute task response command
*/
public class ExecuteTaskResponseCommand implements Serializable {
/**
* task id
*/
private String taskId;
/**
* attempt id
*/
private String attemptId;
/**
* return result
*/
private Object result;
/**
* received time
*/
private long receivedTime;
/**
* execute count
*/
private int executeCount;
/**
* execute time
*/
private long executeTime;
public String getAttemptId() {
return attemptId;
}
public void setAttemptId(String attemptId) {
this.attemptId = attemptId;
}
public String getTaskId() {
return taskId;
}
public void setTaskId(String taskId) {
this.taskId = taskId;
}
public Object getResult() {
return result;
}
public void setResult(Object result) {
this.result = result;
}
public long getReceivedTime() {
return receivedTime;
}
public void setReceivedTime(long receivedTime) {
this.receivedTime = receivedTime;
}
public int getExecuteCount() {
return executeCount;
}
public void setExecuteCount(int executeCount) {
this.executeCount = executeCount;
}
public long getExecuteTime() {
return executeTime;
}
public void setExecuteTime(long executeTime) {
this.executeTime = executeTime;
}
public Command convert2Command(long opaque){
Command command = new Command();
command.setType(CommandType.EXECUTE_TASK_RESPONSE);
byte[] body = FastJsonSerializer.serialize(this);
command.setBody(body);
return command;
}
} |
@ -0,0 +1 @@
|
||||
/*
* 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.
*/
package org.apache.dolphinscheduler.remote.command;
import org.apache.dolphinscheduler.remote.utils.FastJsonSerializer;
import java.io.Serializable;
import java.util.Date;
/**
* execute task request command
*/
public class TaskExecuteAckCommand implements Serializable {
/**
* taskInstanceId
*/
private int taskInstanceId;
/**
* startTime
*/
private Date startTime;
/**
* host
*/
private String host;
/**
* status
*/
private int status;
/**
* logPath
*/
private String logPath;
/**
* executePath
*/
private String executePath;
public Date getStartTime() {
return startTime;
}
public void setStartTime(Date startTime) {
this.startTime = startTime;
}
public String getHost() {
return host;
}
public void setHost(String host) {
this.host = host;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public int getTaskInstanceId() {
return taskInstanceId;
}
public void setTaskInstanceId(int taskInstanceId) {
this.taskInstanceId = taskInstanceId;
}
public String getLogPath() {
return logPath;
}
public void setLogPath(String logPath) {
this.logPath = logPath;
}
public String getExecutePath() {
return executePath;
}
public void setExecutePath(String executePath) {
this.executePath = executePath;
}
/**
* package request command
*
* @return command
*/
public Command convert2Command(){
Command command = new Command();
command.setType(CommandType.TASK_EXECUTE_ACK);
byte[] body = FastJsonSerializer.serialize(this);
command.setBody(body);
return command;
}
@Override
public String toString() {
return "TaskExecuteAckCommand{" +
"taskInstanceId=" + taskInstanceId +
", startTime=" + startTime +
", host='" + host + '\'' +
", status=" + status +
", logPath='" + logPath + '\'' +
", executePath='" + executePath + '\'' +
'}';
}
} |
@ -0,0 +1 @@
|
||||
/*
* 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.
*/
package org.apache.dolphinscheduler.remote.command;
import org.apache.dolphinscheduler.remote.utils.FastJsonSerializer;
import java.io.Serializable;
/**
* execute task request command
*/
public class TaskExecuteRequestCommand implements Serializable {
/**
* task execution context
*/
private String taskExecutionContext;
public String getTaskExecutionContext() {
return taskExecutionContext;
}
public void setTaskExecutionContext(String taskExecutionContext) {
this.taskExecutionContext = taskExecutionContext;
}
public TaskExecuteRequestCommand() {
}
public TaskExecuteRequestCommand(String taskExecutionContext) {
this.taskExecutionContext = taskExecutionContext;
}
/**
* package request command
*
* @return command
*/
public Command convert2Command(){
Command command = new Command();
command.setType(CommandType.TASK_EXECUTE_REQUEST);
byte[] body = FastJsonSerializer.serialize(this);
command.setBody(body);
return command;
}
@Override
public String toString() {
return "TaskExecuteRequestCommand{" +
"taskExecutionContext='" + taskExecutionContext + '\'' +
'}';
}
} |
@ -0,0 +1 @@
|
||||
/*
* 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.
*/
package org.apache.dolphinscheduler.remote.command;
import org.apache.dolphinscheduler.remote.utils.FastJsonSerializer;
import java.io.Serializable;
import java.util.Date;
/**
* execute task response command
*/
public class TaskExecuteResponseCommand implements Serializable {
public TaskExecuteResponseCommand() {
}
public TaskExecuteResponseCommand(int taskInstanceId) {
this.taskInstanceId = taskInstanceId;
}
/**
* task instance id
*/
private int taskInstanceId;
/**
* status
*/
private int status;
/**
* end time
*/
private Date endTime;
/**
* processId
*/
private int processId;
/**
* appIds
*/
private String appIds;
public int getTaskInstanceId() {
return taskInstanceId;
}
public void setTaskInstanceId(int taskInstanceId) {
this.taskInstanceId = taskInstanceId;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public Date getEndTime() {
return endTime;
}
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
public int getProcessId() {
return processId;
}
public void setProcessId(int processId) {
this.processId = processId;
}
public String getAppIds() {
return appIds;
}
public void setAppIds(String appIds) {
this.appIds = appIds;
}
/**
* package response command
* @return command
*/
public Command convert2Command(){
Command command = new Command();
command.setType(CommandType.TASK_EXECUTE_RESPONSE);
byte[] body = FastJsonSerializer.serialize(this);
command.setBody(body);
return command;
}
@Override
public String toString() {
return "TaskExecuteResponseCommand{" +
"taskInstanceId=" + taskInstanceId +
", status=" + status +
", endTime=" + endTime +
", processId=" + processId +
", appIds='" + appIds + '\'' +
'}';
}
} |
@ -0,0 +1,250 @@
|
||||
/* |
||||
* 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. |
||||
*/ |
||||
|
||||
package org.apache.dolphinscheduler.remote.command; |
||||
|
||||
import java.io.Serializable; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* master/worker task transport |
||||
*/ |
||||
public class TaskInfo implements Serializable{ |
||||
|
||||
/** |
||||
* task instance id |
||||
*/ |
||||
private Integer taskId; |
||||
|
||||
|
||||
/** |
||||
* taks name |
||||
*/ |
||||
private String taskName; |
||||
|
||||
/** |
||||
* task start time |
||||
*/ |
||||
private Date startTime; |
||||
|
||||
/** |
||||
* task type |
||||
*/ |
||||
private String taskType; |
||||
|
||||
/** |
||||
* task execute path |
||||
*/ |
||||
private String executePath; |
||||
|
||||
/** |
||||
* task json |
||||
*/ |
||||
private String taskJson; |
||||
|
||||
|
||||
/** |
||||
* process instance id |
||||
*/ |
||||
private Integer processInstanceId; |
||||
|
||||
|
||||
/** |
||||
* process instance schedule time |
||||
*/ |
||||
private Date scheduleTime; |
||||
|
||||
/** |
||||
* process instance global parameters |
||||
*/ |
||||
private String globalParams; |
||||
|
||||
|
||||
/** |
||||
* execute user id |
||||
*/ |
||||
private Integer executorId; |
||||
|
||||
|
||||
/** |
||||
* command type if complement |
||||
*/ |
||||
private Integer cmdTypeIfComplement; |
||||
|
||||
|
||||
/** |
||||
* tenant code |
||||
*/ |
||||
private String tenantCode; |
||||
|
||||
/** |
||||
* task queue |
||||
*/ |
||||
private String queue; |
||||
|
||||
|
||||
/** |
||||
* process define id |
||||
*/ |
||||
private Integer processDefineId; |
||||
|
||||
/** |
||||
* project id |
||||
*/ |
||||
private Integer projectId; |
||||
|
||||
public Integer getTaskId() { |
||||
return taskId; |
||||
} |
||||
|
||||
public void setTaskId(Integer taskId) { |
||||
this.taskId = taskId; |
||||
} |
||||
|
||||
public String getTaskName() { |
||||
return taskName; |
||||
} |
||||
|
||||
public void setTaskName(String taskName) { |
||||
this.taskName = taskName; |
||||
} |
||||
|
||||
public Date getStartTime() { |
||||
return startTime; |
||||
} |
||||
|
||||
public void setStartTime(Date startTime) { |
||||
this.startTime = startTime; |
||||
} |
||||
|
||||
public String getTaskType() { |
||||
return taskType; |
||||
} |
||||
|
||||
public void setTaskType(String taskType) { |
||||
this.taskType = taskType; |
||||
} |
||||
|
||||
public String getExecutePath() { |
||||
return executePath; |
||||
} |
||||
|
||||
public void setExecutePath(String executePath) { |
||||
this.executePath = executePath; |
||||
} |
||||
|
||||
public String getTaskJson() { |
||||
return taskJson; |
||||
} |
||||
|
||||
public void setTaskJson(String taskJson) { |
||||
this.taskJson = taskJson; |
||||
} |
||||
|
||||
public Integer getProcessInstanceId() { |
||||
return processInstanceId; |
||||
} |
||||
|
||||
public void setProcessInstanceId(Integer processInstanceId) { |
||||
this.processInstanceId = processInstanceId; |
||||
} |
||||
|
||||
public Date getScheduleTime() { |
||||
return scheduleTime; |
||||
} |
||||
|
||||
public void setScheduleTime(Date scheduleTime) { |
||||
this.scheduleTime = scheduleTime; |
||||
} |
||||
|
||||
public String getGlobalParams() { |
||||
return globalParams; |
||||
} |
||||
|
||||
public void setGlobalParams(String globalParams) { |
||||
this.globalParams = globalParams; |
||||
} |
||||
|
||||
public String getTenantCode() { |
||||
return tenantCode; |
||||
} |
||||
|
||||
public void setTenantCode(String tenantCode) { |
||||
this.tenantCode = tenantCode; |
||||
} |
||||
|
||||
public String getQueue() { |
||||
return queue; |
||||
} |
||||
|
||||
public void setQueue(String queue) { |
||||
this.queue = queue; |
||||
} |
||||
|
||||
public Integer getProcessDefineId() { |
||||
return processDefineId; |
||||
} |
||||
|
||||
public void setProcessDefineId(Integer processDefineId) { |
||||
this.processDefineId = processDefineId; |
||||
} |
||||
|
||||
public Integer getProjectId() { |
||||
return projectId; |
||||
} |
||||
|
||||
public void setProjectId(Integer projectId) { |
||||
this.projectId = projectId; |
||||
} |
||||
|
||||
public Integer getExecutorId() { |
||||
return executorId; |
||||
} |
||||
|
||||
public void setExecutorId(Integer executorId) { |
||||
this.executorId = executorId; |
||||
} |
||||
|
||||
public Integer getCmdTypeIfComplement() { |
||||
return cmdTypeIfComplement; |
||||
} |
||||
|
||||
public void setCmdTypeIfComplement(Integer cmdTypeIfComplement) { |
||||
this.cmdTypeIfComplement = cmdTypeIfComplement; |
||||
} |
||||
|
||||
@Override |
||||
public String toString() { |
||||
return "TaskInfo{" + |
||||
"taskId=" + taskId + |
||||
", taskName='" + taskName + '\'' + |
||||
", startTime=" + startTime + |
||||
", taskType='" + taskType + '\'' + |
||||
", executePath='" + executePath + '\'' + |
||||
", taskJson='" + taskJson + '\'' + |
||||
", processInstanceId=" + processInstanceId + |
||||
", scheduleTime=" + scheduleTime + |
||||
", globalParams='" + globalParams + '\'' + |
||||
", executorId=" + executorId + |
||||
", cmdTypeIfComplement=" + cmdTypeIfComplement + |
||||
", tenantCode='" + tenantCode + '\'' + |
||||
", queue='" + queue + '\'' + |
||||
", processDefineId=" + processDefineId + |
||||
", projectId=" + projectId + |
||||
'}'; |
||||
} |
||||
} |
@ -0,0 +1 @@
|
||||
/*
* 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.
*/
package org.apache.dolphinscheduler.remote.command;
import org.apache.dolphinscheduler.remote.utils.FastJsonSerializer;
import java.io.Serializable;
/**
* kill task request command
*/
public class TaskKillRequestCommand implements Serializable {
/**
* task id
*/
private int taskInstanceId;
public int getTaskInstanceId() {
return taskInstanceId;
}
public void setTaskInstanceId(int taskInstanceId) {
this.taskInstanceId = taskInstanceId;
}
/**
* package request command
*
* @return command
*/
public Command convert2Command(){
Command command = new Command();
command.setType(CommandType.TASK_KILL_REQUEST);
byte[] body = FastJsonSerializer.serialize(this);
command.setBody(body);
return command;
}
@Override
public String toString() {
return "TaskKillRequestCommand{" +
"taskInstanceId=" + taskInstanceId +
'}';
}
} |
@ -0,0 +1 @@
|
||||
/*
* 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.
*/
package org.apache.dolphinscheduler.remote.command;
import org.apache.dolphinscheduler.remote.utils.FastJsonSerializer;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* kill task response command
*/
public class TaskKillResponseCommand implements Serializable {
/**
* taskInstanceId
*/
private int taskInstanceId;
/**
* host
*/
private String host;
/**
* status
*/
private int status;
/**
* processId
*/
private int processId;
/**
* other resource manager appId , for example : YARN etc
*/
protected List<String> appIds;
public int getTaskInstanceId() {
return taskInstanceId;
}
public void setTaskInstanceId(int taskInstanceId) {
this.taskInstanceId = taskInstanceId;
}
public String getHost() {
return host;
}
public void setHost(String host) {
this.host = host;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public int getProcessId() {
return processId;
}
public void setProcessId(int processId) {
this.processId = processId;
}
public List<String> getAppIds() {
return appIds;
}
public void setAppIds(List<String> appIds) {
this.appIds = appIds;
}
/**
* package request command
*
* @return command
*/
public Command convert2Command(){
Command command = new Command();
command.setType(CommandType.TASK_KILL_RESPONSE);
byte[] body = FastJsonSerializer.serialize(this);
command.setBody(body);
return command;
}
@Override
public String toString() {
return "TaskKillResponseCommand{" +
"taskInstanceId=" + taskInstanceId +
", host='" + host + '\'' +
", status=" + status +
", processId=" + processId +
", appIds=" + appIds +
'}';
}
} |
@ -1,96 +0,0 @@
|
||||
/* |
||||
* 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. |
||||
*/ |
||||
package org.apache.dolphinscheduler.remote.utils; |
||||
|
||||
import java.io.Serializable; |
||||
|
||||
/** |
||||
* server address |
||||
*/ |
||||
public class Address implements Serializable { |
||||
|
||||
/** |
||||
* host |
||||
*/ |
||||
private String host; |
||||
|
||||
/** |
||||
* port |
||||
*/ |
||||
private int port; |
||||
|
||||
public Address(){ |
||||
//NOP
|
||||
} |
||||
|
||||
public Address(String host, int port){ |
||||
this.host = host; |
||||
this.port = port; |
||||
} |
||||
|
||||
public String getHost() { |
||||
return host; |
||||
} |
||||
|
||||
public void setHost(String host) { |
||||
this.host = host; |
||||
} |
||||
|
||||
public int getPort() { |
||||
return port; |
||||
} |
||||
|
||||
public void setPort(int port) { |
||||
this.port = port; |
||||
} |
||||
|
||||
@Override |
||||
public int hashCode() { |
||||
final int prime = 31; |
||||
int result = 1; |
||||
result = prime * result + ((host == null) ? 0 : host.hashCode()); |
||||
result = prime * result + port; |
||||
return result; |
||||
} |
||||
|
||||
@Override |
||||
public boolean equals(Object obj) { |
||||
if (this == obj) { |
||||
return true; |
||||
} |
||||
if (obj == null) { |
||||
return false; |
||||
} |
||||
if (getClass() != obj.getClass()) { |
||||
return false; |
||||
} |
||||
Address other = (Address) obj; |
||||
if (host == null) { |
||||
if (other.host != null) { |
||||
return false; |
||||
} |
||||
} else if (!host.equals(other.host)) { |
||||
return false; |
||||
} |
||||
return port == other.port; |
||||
} |
||||
|
||||
@Override |
||||
public String toString() { |
||||
return "Address [host=" + host + ", port=" + port + "]"; |
||||
} |
||||
} |
@ -0,0 +1,117 @@
|
||||
/* |
||||
* 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. |
||||
*/ |
||||
package org.apache.dolphinscheduler.remote.utils; |
||||
|
||||
import java.io.Serializable; |
||||
import java.util.Objects; |
||||
|
||||
/** |
||||
* server address |
||||
*/ |
||||
public class Host implements Serializable { |
||||
|
||||
/** |
||||
* address |
||||
*/ |
||||
private String address; |
||||
|
||||
/** |
||||
* ip |
||||
*/ |
||||
private String ip; |
||||
|
||||
/** |
||||
* port |
||||
*/ |
||||
private int port; |
||||
|
||||
public Host() { |
||||
} |
||||
|
||||
public Host(String ip, int port) { |
||||
this.ip = ip; |
||||
this.port = port; |
||||
this.address = ip + ":" + port; |
||||
} |
||||
|
||||
public String getAddress() { |
||||
return address; |
||||
} |
||||
|
||||
public void setAddress(String address) { |
||||
this.address = address; |
||||
} |
||||
|
||||
public String getIp() { |
||||
return ip; |
||||
} |
||||
|
||||
public void setIp(String ip) { |
||||
this.ip = ip; |
||||
this.address = ip + ":" + port; |
||||
} |
||||
|
||||
public int getPort() { |
||||
return port; |
||||
} |
||||
|
||||
public void setPort(int port) { |
||||
this.port = port; |
||||
this.address = ip + ":" + port; |
||||
} |
||||
|
||||
/** |
||||
* address convert host |
||||
* @param address address |
||||
* @return host |
||||
*/ |
||||
public static Host of(String address){ |
||||
if(address == null) { |
||||
throw new IllegalArgumentException("Host : address is null."); |
||||
} |
||||
String[] parts = address.split(":"); |
||||
if (parts.length != 2) { |
||||
throw new IllegalArgumentException(String.format("Host : %s illegal.", address)); |
||||
} |
||||
Host host = new Host(parts[0], Integer.parseInt(parts[1])); |
||||
return host; |
||||
} |
||||
|
||||
@Override |
||||
public boolean equals(Object o) { |
||||
if (this == o) { |
||||
return true; |
||||
} |
||||
if (o == null || getClass() != o.getClass()) { |
||||
return false; |
||||
} |
||||
Host host = (Host) o; |
||||
return Objects.equals(getAddress(), host.getAddress()); |
||||
} |
||||
|
||||
@Override |
||||
public int hashCode() { |
||||
return Objects.hash(getAddress()); |
||||
} |
||||
|
||||
@Override |
||||
public String toString() { |
||||
return "Host{" + |
||||
"address='" + address + '\'' + |
||||
'}'; |
||||
} |
||||
} |
@ -0,0 +1,142 @@
|
||||
/* |
||||
* 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. |
||||
*/ |
||||
package org.apache.dolphinscheduler.remote.utils; |
||||
|
||||
import org.slf4j.Logger; |
||||
import org.slf4j.LoggerFactory; |
||||
|
||||
import java.net.*; |
||||
import java.util.ArrayList; |
||||
import java.util.Collection; |
||||
import java.util.Enumeration; |
||||
import java.util.regex.Matcher; |
||||
import java.util.regex.Pattern; |
||||
|
||||
public class IPUtils { |
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(IPUtils.class); |
||||
|
||||
private static String IP_REGEX = "([1-9]|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3}"; |
||||
|
||||
private static String LOCAL_HOST = "unknown"; |
||||
|
||||
static { |
||||
String host = System.getenv("HOSTNAME"); |
||||
if (isNotEmpty(host)) { |
||||
LOCAL_HOST = host; |
||||
} else { |
||||
|
||||
try { |
||||
String hostName = InetAddress.getLocalHost().getHostName(); |
||||
if (isNotEmpty(hostName)) { |
||||
LOCAL_HOST = hostName; |
||||
} |
||||
} catch (UnknownHostException e) { |
||||
logger.error("get hostName error!", e); |
||||
} |
||||
} |
||||
} |
||||
|
||||
public static String getLocalHost() { |
||||
return LOCAL_HOST; |
||||
} |
||||
|
||||
|
||||
public static String getFirstNoLoopbackIP4Address() { |
||||
Collection<String> allNoLoopbackIP4Addresses = getNoLoopbackIP4Addresses(); |
||||
if (allNoLoopbackIP4Addresses.isEmpty()) { |
||||
return null; |
||||
} |
||||
return allNoLoopbackIP4Addresses.iterator().next(); |
||||
} |
||||
|
||||
public static Collection<String> getNoLoopbackIP4Addresses() { |
||||
Collection<String> noLoopbackIP4Addresses = new ArrayList<>(); |
||||
Collection<InetAddress> allInetAddresses = getAllHostAddress(); |
||||
|
||||
for (InetAddress address : allInetAddresses) { |
||||
if (!address.isLoopbackAddress() && !address.isSiteLocalAddress() |
||||
&& !Inet6Address.class.isInstance(address)) { |
||||
noLoopbackIP4Addresses.add(address.getHostAddress()); |
||||
} |
||||
} |
||||
if (noLoopbackIP4Addresses.isEmpty()) { |
||||
for (InetAddress address : allInetAddresses) { |
||||
if (!address.isLoopbackAddress() && !Inet6Address.class.isInstance(address)) { |
||||
noLoopbackIP4Addresses.add(address.getHostAddress()); |
||||
} |
||||
} |
||||
} |
||||
return noLoopbackIP4Addresses; |
||||
} |
||||
|
||||
public static Collection<InetAddress> getAllHostAddress() { |
||||
try { |
||||
Enumeration<NetworkInterface> networkInterfaces = NetworkInterface.getNetworkInterfaces(); |
||||
Collection<InetAddress> addresses = new ArrayList<>(); |
||||
|
||||
while (networkInterfaces.hasMoreElements()) { |
||||
NetworkInterface networkInterface = networkInterfaces.nextElement(); |
||||
Enumeration<InetAddress> inetAddresses = networkInterface.getInetAddresses(); |
||||
while (inetAddresses.hasMoreElements()) { |
||||
InetAddress inetAddress = inetAddresses.nextElement(); |
||||
addresses.add(inetAddress); |
||||
} |
||||
} |
||||
|
||||
return addresses; |
||||
} catch (SocketException e) { |
||||
throw new RuntimeException(e.getMessage(), e); |
||||
} |
||||
} |
||||
|
||||
public static String getIpByHostName(String host) { |
||||
InetAddress address = null; |
||||
try { |
||||
address = InetAddress.getByName(host); |
||||
} catch (UnknownHostException e) { |
||||
logger.error("get IP error", e); |
||||
} |
||||
if (address == null) { |
||||
return ""; |
||||
} |
||||
return address.getHostAddress(); |
||||
|
||||
} |
||||
|
||||
private static boolean isEmpty(final CharSequence cs) { |
||||
return cs == null || cs.length() == 0; |
||||
} |
||||
|
||||
private static boolean isNotEmpty(final CharSequence cs) { |
||||
return !isEmpty(cs); |
||||
} |
||||
|
||||
public static boolean isIp(String addr) { |
||||
if (addr.length() < 7 || addr.length() > 15 || "".equals(addr)) { |
||||
return false; |
||||
} |
||||
|
||||
Pattern pat = Pattern.compile(IP_REGEX); |
||||
|
||||
Matcher mat = pat.matcher(addr); |
||||
|
||||
boolean ipAddress = mat.find(); |
||||
|
||||
return ipAddress; |
||||
} |
||||
} |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue