status
stringclasses
1 value
repo_name
stringclasses
31 values
repo_url
stringclasses
31 values
issue_id
int64
1
104k
title
stringlengths
4
233
body
stringlengths
0
186k
issue_url
stringlengths
38
56
pull_url
stringlengths
37
54
before_fix_sha
stringlengths
40
40
after_fix_sha
stringlengths
40
40
report_datetime
unknown
language
stringclasses
5 values
commit_datetime
unknown
updated_file
stringlengths
7
188
chunk_content
stringlengths
1
1.03M
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
public static final String FS_DEFAULTFS = "fs.defaultFS"; /** * fs s3a endpoint */ public static final String FS_S3A_ENDPOINT = "fs.s3a.endpoint"; /** * fs s3a access key */ public static final String FS_S3A_ACCESS_KEY = "fs.s3a.access.key"; /** * fs s3a secret key */ public static final String FS_S3A_SECRET_KEY = "fs.s3a.secret.key"; /** * yarn.resourcemanager.ha.rm.ids */ public static final String YARN_RESOURCEMANAGER_HA_RM_IDS = "yarn.resourcemanager.ha.rm.ids"; public static final String YARN_RESOURCEMANAGER_HA_XX = "xx"; /** * yarn.application.status.address */ public static final String YARN_APPLICATION_STATUS_ADDRESS = "yarn.application.status.address"; /** * yarn.job.history.status.address */ public static final String YARN_JOB_HISTORY_STATUS_ADDRESS = "yarn.job.history.status.address"; /** * hdfs configuration * hdfs.root.user */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
public static final String HDFS_ROOT_USER = "hdfs.root.user"; /** * hdfs/s3 configuration * resource.upload.path */ public static final String RESOURCE_UPLOAD_PATH = "resource.upload.path"; /** * data basedir path */ public static final String DATA_BASEDIR_PATH = "data.basedir.path"; /** * dolphinscheduler.env.path */ public static final String DOLPHINSCHEDULER_ENV_PATH = "dolphinscheduler.env.path"; /** * environment properties default path */ public static final String ENV_PATH = "env/dolphinscheduler_env.sh"; /** * python home */ public static final String PYTHON_HOME = "PYTHON_HOME"; /** * resource.view.suffixs */ public static final String RESOURCE_VIEW_SUFFIXS = "resource.view.suffixs"; public static final String RESOURCE_VIEW_SUFFIXS_DEFAULT_VALUE = "txt,log,sh,bat,conf,cfg,py,java,sql,xml,hql,properties,json,yml,yaml,ini,js"; /** * development.state */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
public static final String DEVELOPMENT_STATE = "development.state"; public static final String DEVELOPMENT_STATE_DEFAULT_VALUE = "true"; /** * string true */ public static final String STRING_TRUE = "true"; /** * string false */ public static final String STRING_FALSE = "false"; /** * resource storage type */ public static final String RESOURCE_STORAGE_TYPE = "resource.storage.type"; /** * MasterServer directory registered in zookeeper */ public static final String ZOOKEEPER_DOLPHINSCHEDULER_MASTERS = "/nodes/master"; /** * WorkerServer directory registered in zookeeper */ public static final String ZOOKEEPER_DOLPHINSCHEDULER_WORKERS = "/nodes/worker"; /** * all servers directory registered in zookeeper */ public static final String ZOOKEEPER_DOLPHINSCHEDULER_DEAD_SERVERS = "/dead-servers"; /** * MasterServer lock directory registered in zookeeper */ public static final String ZOOKEEPER_DOLPHINSCHEDULER_LOCK_MASTERS = "/lock/masters";
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
/** * MasterServer failover directory registered in zookeeper */ public static final String ZOOKEEPER_DOLPHINSCHEDULER_LOCK_FAILOVER_MASTERS = "/lock/failover/masters"; /** * WorkerServer failover directory registered in zookeeper */ public static final String ZOOKEEPER_DOLPHINSCHEDULER_LOCK_FAILOVER_WORKERS = "/lock/failover/workers"; /** * MasterServer startup failover runing and fault tolerance process */ public static final String ZOOKEEPER_DOLPHINSCHEDULER_LOCK_FAILOVER_STARTUP_MASTERS = "/lock/failover/startup-masters"; /** * comma , */ public static final String COMMA = ","; /** * slash / */ public static final String SLASH = "/"; /** * COLON : */ public static final String COLON = ":"; /** * SPACE " " */ public static final String SPACE = " "; /** * SINGLE_SLASH /
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
*/ public static final String SINGLE_SLASH = "/"; /** * DOUBLE_SLASH // */ public static final String DOUBLE_SLASH = "//"; /** * SINGLE_QUOTES "'" */ public static final String SINGLE_QUOTES = "'"; /** * DOUBLE_QUOTES "\"" */ public static final String DOUBLE_QUOTES = "\""; /** * SEMICOLON ; */ public static final String SEMICOLON = ";"; /** * EQUAL SIGN */ public static final String EQUAL_SIGN = "="; /** * AT SIGN */ public static final String AT_SIGN = "@"; public static final String WORKER_MAX_CPULOAD_AVG = "worker.max.cpuload.avg"; public static final String WORKER_RESERVED_MEMORY = "worker.reserved.memory"; public static final String MASTER_MAX_CPULOAD_AVG = "master.max.cpuload.avg"; public static final String MASTER_RESERVED_MEMORY = "master.reserved.memory";
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
/** * date format of yyyy-MM-dd HH:mm:ss */ public static final String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss"; /** * date format of yyyyMMddHHmmss */ public static final String YYYYMMDDHHMMSS = "yyyyMMddHHmmss"; /** * date format of yyyyMMddHHmmssSSS */ public static final String YYYYMMDDHHMMSSSSS = "yyyyMMddHHmmssSSS"; /** * http connect time out */ public static final int HTTP_CONNECT_TIMEOUT = 60 * 1000; /** * http connect request time out */ public static final int HTTP_CONNECTION_REQUEST_TIMEOUT = 60 * 1000; /** * httpclient soceket time out */ public static final int SOCKET_TIMEOUT = 60 * 1000; /** * http header */ public static final String HTTP_HEADER_UNKNOWN = "unKnown"; /** * http X-Forwarded-For
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
*/ public static final String HTTP_X_FORWARDED_FOR = "X-Forwarded-For"; /** * http X-Real-IP */ public static final String HTTP_X_REAL_IP = "X-Real-IP"; /** * UTF-8 */ public static final String UTF_8 = "UTF-8"; /** * user name regex */ public static final Pattern REGEX_USER_NAME = Pattern.compile("^[a-zA-Z0-9._-]{3,39}$"); /** * email regex */ public static final Pattern REGEX_MAIL_NAME = Pattern.compile("^([a-z0-9A-Z]+[_|\\-|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$"); /** * read permission */ public static final int READ_PERMISSION = 2 * 1; /** * write permission */ public static final int WRITE_PERMISSION = 2 * 2; /** * execute permission */ public static final int EXECUTE_PERMISSION = 1;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
/** * default admin permission */ public static final int DEFAULT_ADMIN_PERMISSION = 7; /** * all permissions */ public static final int ALL_PERMISSIONS = READ_PERMISSION | WRITE_PERMISSION | EXECUTE_PERMISSION; /** * max task timeout */ public static final int MAX_TASK_TIMEOUT = 24 * 3600; /** * master cpu load */ public static final int DEFAULT_MASTER_CPU_LOAD = Runtime.getRuntime().availableProcessors() * 2; /** * master reserved memory */ public static final double DEFAULT_MASTER_RESERVED_MEMORY = OSUtils.totalMemorySize() / 10; /** * worker cpu load */ public static final int DEFAULT_WORKER_CPU_LOAD = Runtime.getRuntime().availableProcessors() * 2; /** * worker reserved memory */ public static final double DEFAULT_WORKER_RESERVED_MEMORY = OSUtils.totalMemorySize() / 10; /** * default log cache rows num,output when reach the number
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
*/ public static final int DEFAULT_LOG_ROWS_NUM = 4 * 16; /** * log flush interval?output when reach the interval */ public static final int DEFAULT_LOG_FLUSH_INTERVAL = 1000; /** * time unit secong to minutes */ public static final int SEC_2_MINUTES_TIME_UNIT = 60; /*** * * rpc port */ public static final int RPC_PORT = 50051; /*** * alert rpc port */ public static final int ALERT_RPC_PORT = 50052; /** * forbid running task */ public static final String FLOWNODE_RUN_FLAG_FORBIDDEN = "FORBIDDEN"; /** * datasource configuration path */ public static final String DATASOURCE_PROPERTIES = "/datasource.properties"; public static final String TASK_RECORD_URL = "task.record.datasource.url"; public static final String TASK_RECORD_FLAG = "task.record.flag"; public static final String TASK_RECORD_USER = "task.record.datasource.username";
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
public static final String TASK_RECORD_PWD = "task.record.datasource.password"; public static final String DEFAULT = "Default"; public static final String USER = "user"; public static final String PASSWORD = "password"; public static final String XXXXXX = "******"; public static final String NULL = "NULL"; public static final String THREAD_NAME_MASTER_SERVER = "Master-Server"; public static final String THREAD_NAME_WORKER_SERVER = "Worker-Server"; public static final String TASK_RECORD_TABLE_HIVE_LOG = "eamp_hive_log_hd"; public static final String TASK_RECORD_TABLE_HISTORY_HIVE_LOG = "eamp_hive_hist_log_hd"; /** * command parameter keys */ public static final String CMD_PARAM_RECOVER_PROCESS_ID_STRING = "ProcessInstanceId"; public static final String CMD_PARAM_RECOVERY_START_NODE_STRING = "StartNodeIdList"; public static final String CMD_PARAM_RECOVERY_WAITING_THREAD = "WaitingThreadInstanceId"; public static final String CMD_PARAM_SUB_PROCESS = "processInstanceId"; public static final String CMD_PARAM_EMPTY_SUB_PROCESS = "0"; public static final String CMD_PARAM_SUB_PROCESS_PARENT_INSTANCE_ID = "parentProcessInstanceId"; public static final String CMD_PARAM_SUB_PROCESS_DEFINE_ID = "processDefinitionId"; public static final String CMD_PARAM_START_NODE_NAMES = "StartNodeNameList"; public static final String CMD_PARAM_START_PARAMS = "StartParams"; /** * complement data start date */ public static final String CMDPARAM_COMPLEMENT_DATA_START_DATE = "complementStartDate"; /** * complement data end date */ public static final String CMDPARAM_COMPLEMENT_DATA_END_DATE = "complementEndDate";
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
/** * hadoop configuration */ public static final String HADOOP_RM_STATE_ACTIVE = "ACTIVE"; public static final String HADOOP_RM_STATE_STANDBY = "STANDBY"; public static final String HADOOP_RESOURCE_MANAGER_HTTPADDRESS_PORT = "resource.manager.httpaddress.port"; /** * data source config */ public static final String SPRING_DATASOURCE_DRIVER_CLASS_NAME = "spring.datasource.driver-class-name"; public static final String SPRING_DATASOURCE_URL = "spring.datasource.url"; public static final String SPRING_DATASOURCE_USERNAME = "spring.datasource.username"; public static final String SPRING_DATASOURCE_PASSWORD = "spring.datasource.password"; public static final String SPRING_DATASOURCE_VALIDATION_QUERY_TIMEOUT = "spring.datasource.validationQueryTimeout"; public static final String SPRING_DATASOURCE_INITIAL_SIZE = "spring.datasource.initialSize"; public static final String SPRING_DATASOURCE_MIN_IDLE = "spring.datasource.minIdle"; public static final String SPRING_DATASOURCE_MAX_ACTIVE = "spring.datasource.maxActive"; public static final String SPRING_DATASOURCE_MAX_WAIT = "spring.datasource.maxWait"; public static final String SPRING_DATASOURCE_TIME_BETWEEN_EVICTION_RUNS_MILLIS = "spring.datasource.timeBetweenEvictionRunsMillis"; public static final String SPRING_DATASOURCE_TIME_BETWEEN_CONNECT_ERROR_MILLIS = "spring.datasource.timeBetweenConnectErrorMillis"; public static final String SPRING_DATASOURCE_MIN_EVICTABLE_IDLE_TIME_MILLIS = "spring.datasource.minEvictableIdleTimeMillis"; public static final String SPRING_DATASOURCE_VALIDATION_QUERY = "spring.datasource.validationQuery"; public static final String SPRING_DATASOURCE_TEST_WHILE_IDLE = "spring.datasource.testWhileIdle"; public static final String SPRING_DATASOURCE_TEST_ON_BORROW = "spring.datasource.testOnBorrow"; public static final String SPRING_DATASOURCE_TEST_ON_RETURN = "spring.datasource.testOnReturn"; public static final String SPRING_DATASOURCE_POOL_PREPARED_STATEMENTS = "spring.datasource.poolPreparedStatements"; public static final String SPRING_DATASOURCE_DEFAULT_AUTO_COMMIT = "spring.datasource.defaultAutoCommit"; public static final String SPRING_DATASOURCE_KEEP_ALIVE = "spring.datasource.keepAlive"; public static final String SPRING_DATASOURCE_MAX_POOL_PREPARED_STATEMENT_PER_CONNECTION_SIZE = "spring.datasource.maxPoolPreparedStatementPerConnectionSize"; public static final String DEVELOPMENT = "development";
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
public static final String QUARTZ_PROPERTIES_PATH = "quartz.properties"; /** * sleep time */ public static final int SLEEP_TIME_MILLIS = 1000; /** * heartbeat for zk info length */ public static final int HEARTBEAT_FOR_ZOOKEEPER_INFO_LENGTH = 10; /** * hadoop params * jar */ public static final String JAR = "jar"; /** * hadoop */ public static final String HADOOP = "hadoop"; /** * -D parameter */ public static final String D = "-D"; /** * -D mapreduce.job.queuename=ququename */ public static final String MR_QUEUE = "mapreduce.job.queuename"; /** * spark params constant */ public static final String MASTER = "--master";
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
public static final String DEPLOY_MODE = "--deploy-mode"; /** * --class CLASS_NAME */ public static final String MAIN_CLASS = "--class"; /** * --driver-cores NUM */ public static final String DRIVER_CORES = "--driver-cores"; /** * --driver-memory MEM */ public static final String DRIVER_MEMORY = "--driver-memory"; /** * --num-executors NUM */ public static final String NUM_EXECUTORS = "--num-executors"; /** * --executor-cores NUM */ public static final String EXECUTOR_CORES = "--executor-cores"; /** * --executor-memory MEM */ public static final String EXECUTOR_MEMORY = "--executor-memory"; /** * --queue QUEUE */ public static final String SPARK_QUEUE = "--queue"; /**
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
* exit code success */ public static final int EXIT_CODE_SUCCESS = 0; /** * exit code kill */ public static final int EXIT_CODE_KILL = 137; /** * exit code failure */ public static final int EXIT_CODE_FAILURE = -1; /** * date format of yyyyMMdd */ public static final String PARAMETER_FORMAT_DATE = "yyyyMMdd"; /** * date format of yyyyMMddHHmmss */ public static final String PARAMETER_FORMAT_TIME = "yyyyMMddHHmmss"; /** * system date(yyyyMMddHHmmss) */ public static final String PARAMETER_DATETIME = "system.datetime"; /** * system date(yyyymmdd) today */ public static final String PARAMETER_CURRENT_DATE = "system.biz.curdate"; /** * system date(yyyymmdd) yesterday */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
public static final String PARAMETER_BUSINESS_DATE = "system.biz.date"; /** * ACCEPTED */ public static final String ACCEPTED = "ACCEPTED"; /** * SUCCEEDED */ public static final String SUCCEEDED = "SUCCEEDED"; /** * NEW */ public static final String NEW = "NEW"; /** * NEW_SAVING */ public static final String NEW_SAVING = "NEW_SAVING"; /** * SUBMITTED */ public static final String SUBMITTED = "SUBMITTED"; /** * FAILED */ public static final String FAILED = "FAILED"; /** * KILLED */ public static final String KILLED = "KILLED"; /**
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
* RUNNING */ public static final String RUNNING = "RUNNING"; /** * underline "_" */ public static final String UNDERLINE = "_"; /** * quartz job prifix */ public static final String QUARTZ_JOB_PRIFIX = "job"; /** * quartz job group prifix */ public static final String QUARTZ_JOB_GROUP_PRIFIX = "jobgroup"; /** * projectId */ public static final String PROJECT_ID = "projectId"; /** * processId */ public static final String SCHEDULE_ID = "scheduleId"; /** * schedule */ public static final String SCHEDULE = "schedule"; /** * application regex */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
public static final String APPLICATION_REGEX = "application_\\d+_\\d+"; public static final String PID = OSUtils.isWindows() ? "handle" : "pid"; /** * month_begin */ public static final String MONTH_BEGIN = "month_begin"; /** * add_months */ public static final String ADD_MONTHS = "add_months"; /** * month_end */ public static final String MONTH_END = "month_end"; /** * week_begin */ public static final String WEEK_BEGIN = "week_begin"; /** * week_end */ public static final String WEEK_END = "week_end"; /** * timestamp */ public static final String TIMESTAMP = "timestamp"; public static final char SUBTRACT_CHAR = '-'; public static final char ADD_CHAR = '+'; public static final char MULTIPLY_CHAR = '*'; public static final char DIVISION_CHAR = '/';
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
public static final char LEFT_BRACE_CHAR = '('; public static final char RIGHT_BRACE_CHAR = ')'; public static final String ADD_STRING = "+"; public static final String MULTIPLY_STRING = "*"; public static final String DIVISION_STRING = "/"; public static final String LEFT_BRACE_STRING = "("; public static final char P = 'P'; public static final char N = 'N'; public static final String SUBTRACT_STRING = "-"; public static final String GLOBAL_PARAMS = "globalParams"; public static final String LOCAL_PARAMS = "localParams"; public static final String LOCAL_PARAMS_LIST = "localParamsList"; public static final String SUBPROCESS_INSTANCE_ID = "subProcessInstanceId"; public static final String PROCESS_INSTANCE_STATE = "processInstanceState"; public static final String PARENT_WORKFLOW_INSTANCE = "parentWorkflowInstance"; public static final String TASK_TYPE = "taskType"; public static final String TASK_LIST = "taskList"; public static final String RWXR_XR_X = "rwxr-xr-x"; public static final String QUEUE = "queue"; public static final String QUEUE_NAME = "queueName"; public static final int LOG_QUERY_SKIP_LINE_NUMBER = 0; public static final int LOG_QUERY_LIMIT = 4096; /** * master/worker server use for zk */ public static final String MASTER_PREFIX = "master"; public static final String WORKER_PREFIX = "worker"; public static final String DELETE_ZK_OP = "delete"; public static final String ADD_ZK_OP = "add"; public static final String ALIAS = "alias";
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
public static final String CONTENT = "content"; public static final String DEPENDENT_SPLIT = ":||"; public static final String DEPENDENT_ALL = "ALL"; /** * preview schedule execute count */ public static final int PREVIEW_SCHEDULE_EXECUTE_COUNT = 5; /** * kerberos */ public static final String KERBEROS = "kerberos"; /** * kerberos expire time */ public static final String KERBEROS_EXPIRE_TIME = "kerberos.expire.time"; /** * java.security.krb5.conf */ public static final String JAVA_SECURITY_KRB5_CONF = "java.security.krb5.conf"; /** * java.security.krb5.conf.path */ public static final String JAVA_SECURITY_KRB5_CONF_PATH = "java.security.krb5.conf.path"; /** * hadoop.security.authentication */ public static final String HADOOP_SECURITY_AUTHENTICATION = "hadoop.security.authentication"; /** * hadoop.security.authentication */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
public static final String HADOOP_SECURITY_AUTHENTICATION_STARTUP_STATE = "hadoop.security.authentication.startup.state"; /** * com.amazonaws.services.s3.enableV4 */ public static final String AWS_S3_V4 = "com.amazonaws.services.s3.enableV4"; /** * loginUserFromKeytab user */ public static final String LOGIN_USER_KEY_TAB_USERNAME = "login.user.keytab.username"; /** * default worker group id */ public static final int DEFAULT_WORKER_ID = -1; /** * loginUserFromKeytab path */ public static final String LOGIN_USER_KEY_TAB_PATH = "login.user.keytab.path"; /** * task log info format */ public static final String TASK_LOG_INFO_FORMAT = "TaskLogInfo-%s"; /** * hive conf */ public static final String HIVE_CONF = "hiveconf:"; /** * flink */ public static final String FLINK_YARN_CLUSTER = "yarn-cluster"; public static final String FLINK_RUN_MODE = "-m";
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
public static final String FLINK_YARN_SLOT = "-ys"; public static final String FLINK_APP_NAME = "-ynm"; public static final String FLINK_QUEUE = "-yqu"; public static final String FLINK_TASK_MANAGE = "-yn"; public static final String FLINK_JOB_MANAGE_MEM = "-yjm"; public static final String FLINK_TASK_MANAGE_MEM = "-ytm"; public static final String FLINK_MAIN_CLASS = "-c"; public static final String FLINK_PARALLELISM = "-p"; public static final String FLINK_SHUTDOWN_ON_ATTACHED_EXIT = "-sae"; public static final int[] NOT_TERMINATED_STATES = new int[] { ExecutionStatus.SUBMITTED_SUCCESS.ordinal(), ExecutionStatus.RUNNING_EXECUTION.ordinal(), ExecutionStatus.DELAY_EXECUTION.ordinal(), ExecutionStatus.READY_PAUSE.ordinal(), ExecutionStatus.READY_STOP.ordinal(), ExecutionStatus.NEED_FAULT_TOLERANCE.ordinal(), ExecutionStatus.WAITTING_THREAD.ordinal(), ExecutionStatus.WAITTING_DEPEND.ordinal() }; /** * status */ public static final String STATUS = "status"; /** * message */ public static final String MSG = "msg"; /** * data total */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
public static final String COUNT = "count"; /** * page size */ public static final String PAGE_SIZE = "pageSize"; /** * current page no */ public static final String PAGE_NUMBER = "pageNo"; /** * */ public static final String DATA_LIST = "data"; public static final String TOTAL_LIST = "totalList"; public static final String CURRENT_PAGE = "currentPage"; public static final String TOTAL_PAGE = "totalPage"; public static final String TOTAL = "total"; /** * workflow */ public static final String WORKFLOW_LIST = "workFlowList"; public static final String WORKFLOW_RELATION_LIST = "workFlowRelationList"; /** * session user */ public static final String SESSION_USER = "session.user"; public static final String SESSION_ID = "sessionId"; public static final String PASSWORD_DEFAULT = "******"; /** * locale
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
*/ public static final String LOCALE_LANGUAGE = "language"; /** * driver */ public static final String ORG_POSTGRESQL_DRIVER = "org.postgresql.Driver"; public static final String COM_MYSQL_JDBC_DRIVER = "com.mysql.jdbc.Driver"; public static final String ORG_APACHE_HIVE_JDBC_HIVE_DRIVER = "org.apache.hive.jdbc.HiveDriver"; public static final String COM_CLICKHOUSE_JDBC_DRIVER = "ru.yandex.clickhouse.ClickHouseDriver"; public static final String COM_ORACLE_JDBC_DRIVER = "oracle.jdbc.driver.OracleDriver"; public static final String COM_SQLSERVER_JDBC_DRIVER = "com.microsoft.sqlserver.jdbc.SQLServerDriver"; public static final String COM_DB2_JDBC_DRIVER = "com.ibm.db2.jcc.DB2Driver"; public static final String COM_PRESTO_JDBC_DRIVER = "com.facebook.presto.jdbc.PrestoDriver"; /** * database type */ public static final String MYSQL = "MYSQL"; public static final String POSTGRESQL = "POSTGRESQL"; public static final String HIVE = "HIVE"; public static final String SPARK = "SPARK"; public static final String CLICKHOUSE = "CLICKHOUSE"; public static final String ORACLE = "ORACLE"; public static final String SQLSERVER = "SQLSERVER"; public static final String DB2 = "DB2"; public static final String PRESTO = "PRESTO"; /** * jdbc url */ public static final String JDBC_MYSQL = "jdbc:mysql://"; public static final String JDBC_POSTGRESQL = "jdbc:postgresql://";
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
public static final String JDBC_HIVE_2 = "jdbc:hive2://"; public static final String JDBC_CLICKHOUSE = "jdbc:clickhouse://"; public static final String JDBC_ORACLE_SID = "jdbc:oracle:thin:@"; public static final String JDBC_ORACLE_SERVICE_NAME = "jdbc:oracle:thin:@//"; public static final String JDBC_SQLSERVER = "jdbc:sqlserver://"; public static final String JDBC_DB2 = "jdbc:db2://"; public static final String JDBC_PRESTO = "jdbc:presto://"; public static final String ADDRESS = "address"; public static final String DATABASE = "database"; public static final String JDBC_URL = "jdbcUrl"; public static final String PRINCIPAL = "principal"; public static final String OTHER = "other"; public static final String ORACLE_DB_CONNECT_TYPE = "connectType"; public static final String KERBEROS_KRB5_CONF_PATH = "javaSecurityKrb5Conf"; public static final String KERBEROS_KEY_TAB_USERNAME = "loginUserKeytabUsername"; public static final String KERBEROS_KEY_TAB_PATH = "loginUserKeytabPath"; /** * session timeout */ public static final int SESSION_TIME_OUT = 7200; public static final int MAX_FILE_SIZE = 1024 * 1024 * 1024; public static final String UDF = "UDF"; public static final String CLASS = "class"; public static final String RECEIVERS = "receivers"; public static final String RECEIVERS_CC = "receiversCc"; /** * dataSource sensitive param */ public static final String DATASOURCE_PASSWORD_REGEX = "(?<=(\"password\":\")).*?(?=(\"))"; /**
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
* default worker group */ public static final String DEFAULT_WORKER_GROUP = "default"; public static final Integer TASK_INFO_LENGTH = 5; /** * new * schedule time */ public static final String PARAMETER_SHECDULE_TIME = "schedule.time"; /** * authorize writable perm */ public static final int AUTHORIZE_WRITABLE_PERM = 7; /** * authorize readable perm */ public static final int AUTHORIZE_READABLE_PERM = 4; /** * plugin configurations */ public static final String PLUGIN_JAR_SUFFIX = ".jar"; public static final int NORMAL_NODE_STATUS = 0; public static final int ABNORMAL_NODE_STATUS = 1; public static final String START_TIME = "start time"; public static final String END_TIME = "end time"; public static final String START_END_DATE = "startDate,endDate"; /** * system line separator */ public static final String SYSTEM_LINE_SEPARATOR = System.getProperty("line.separator");
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java
/** * net system properties */ public static final String DOLPHIN_SCHEDULER_PREFERRED_NETWORK_INTERFACE = "dolphin.scheduler.network.interface.preferred"; public static final String EXCEL_SUFFIX_XLS = ".xls"; /** * datasource encryption salt */ public static final String DATASOURCE_ENCRYPTION_SALT_DEFAULT = "!@#$%^&*"; public static final String DATASOURCE_ENCRYPTION_ENABLE = "datasource.encryption.enable"; public static final String DATASOURCE_ENCRYPTION_SALT = "datasource.encryption.salt"; /** * Network IP gets priority, default inner outer */ public static final String NETWORK_PRIORITY_STRATEGY = "dolphin.scheduler.network.priority.strategy"; /** * exec shell scripts */ public static final String SH = "sh"; /** * pstree, get pud and sub pid */ public static final String PSTREE = "pstree"; /** * docker & kubernetes */ public static final boolean DOCKER_MODE = StringUtils.isNotEmpty(System.getenv("DOCKER")); public static final boolean KUBERNETES_MODE = StringUtils.isNotEmpty(System.getenv("KUBERNETES_SERVICE_HOST")) && StringUtils.isNotEmpty(System.getenv("KUBERNETES_SERVICE_PORT")); }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/spark/SparkParameters.java
/* * 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.common.task.spark; import org.apache.dolphinscheduler.common.enums.ProgramType; import org.apache.dolphinscheduler.common.process.ResourceInfo; import org.apache.dolphinscheduler.common.task.AbstractParameters; import org.apache.dolphinscheduler.common.utils.CollectionUtils; import java.util.ArrayList; import java.util.List; /** * spark parameters */ public class SparkParameters extends AbstractParameters {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/spark/SparkParameters.java
/** * major jar */ private ResourceInfo mainJar;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/spark/SparkParameters.java
/** * major class */ private String mainClass; /** * deploy mode */ private String deployMode; /** * arguments */ private String mainArgs; /** * driver-cores Number of cores used by the driver, only in cluster mode */ private int driverCores; /** * driver-memory Memory for driver */ private String driverMemory; /** * num-executors Number of executors to launch */ private int numExecutors; /** * executor-cores Number of cores per executor */ private int executorCores; /** * Memory per executor
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/spark/SparkParameters.java
*/ private String executorMemory; /** * resource list */ private List<ResourceInfo> resourceList = new ArrayList<>(); /** * The YARN queue to submit to */ private String queue; /** * other arguments */ private String others; /** * program type * 0 JAVA,1 SCALA,2 PYTHON */ private ProgramType programType; /** * spark version */ private String sparkVersion; public ResourceInfo getMainJar() { return mainJar; } public void setMainJar(ResourceInfo mainJar) { this.mainJar = mainJar; } public String getMainClass() {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/spark/SparkParameters.java
return mainClass; } public void setMainClass(String mainClass) { this.mainClass = mainClass; } public String getDeployMode() { return deployMode; } public void setDeployMode(String deployMode) { this.deployMode = deployMode; } public String getMainArgs() { return mainArgs; } public void setMainArgs(String mainArgs) { this.mainArgs = mainArgs; } public int getDriverCores() { return driverCores; } public void setDriverCores(int driverCores) { this.driverCores = driverCores; } public String getDriverMemory() { return driverMemory; } public void setDriverMemory(String driverMemory) { this.driverMemory = driverMemory; } public int getNumExecutors() {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/spark/SparkParameters.java
return numExecutors; } public void setNumExecutors(int numExecutors) { this.numExecutors = numExecutors; } public int getExecutorCores() { return executorCores; } public void setExecutorCores(int executorCores) { this.executorCores = executorCores; } public String getExecutorMemory() { return executorMemory; } public void setExecutorMemory(String executorMemory) { this.executorMemory = executorMemory; } public String getQueue() { return queue; } public void setQueue(String queue) { this.queue = queue; } public List<ResourceInfo> getResourceList() { return resourceList; } public void setResourceList(List<ResourceInfo> resourceList) { this.resourceList = resourceList; } public String getOthers() {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/spark/SparkParameters.java
return others; } public void setOthers(String others) { this.others = others; } public ProgramType getProgramType() { return programType; } public void setProgramType(ProgramType programType) { this.programType = programType; } public String getSparkVersion() { return sparkVersion; } public void setSparkVersion(String sparkVersion) { this.sparkVersion = sparkVersion; } @Override public boolean checkParameters() { return mainJar != null && programType != null; } @Override public List<ResourceInfo> getResourceFilesList() { if (mainJar != null && !resourceList.contains(mainJar)) { resourceList.add(mainJar); } return resourceList; } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/FlinkArgsUtils.java
/* * 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.server.utils; import org.apache.dolphinscheduler.common.Constants; import org.apache.dolphinscheduler.common.enums.ProgramType; import org.apache.dolphinscheduler.common.process.ResourceInfo; import org.apache.dolphinscheduler.common.task.flink.FlinkParameters; import org.apache.dolphinscheduler.common.utils.StringUtils; import java.util.ArrayList; import java.util.List; /** * flink args utils */ public class FlinkArgsUtils {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/FlinkArgsUtils.java
private static final String LOCAL_DEPLOY_MODE = "local"; private static final String FLINK_VERSION_BEFORE_1_10 = "<1.10"; /** * build args * @param param flink parameters * @return argument list */ public static List<String> buildArgs(FlinkParameters param) { List<String> args = new ArrayList<>(); String deployMode = "cluster"; String tmpDeployMode = param.getDeployMode(); if (StringUtils.isNotEmpty(tmpDeployMode)) { deployMode = tmpDeployMode; } String others = param.getOthers(); if (!LOCAL_DEPLOY_MODE.equals(deployMode)) { args.add(Constants.FLINK_RUN_MODE); args.add(Constants.FLINK_YARN_CLUSTER); int slot = param.getSlot(); if (slot > 0) { args.add(Constants.FLINK_YARN_SLOT); args.add(String.format("%d", slot)); } String appName = param.getAppName(); if (StringUtils.isNotEmpty(appName)) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/FlinkArgsUtils.java
args.add(Constants.FLINK_APP_NAME); args.add(ArgsUtils.escape(appName)); } String flinkVersion = param.getFlinkVersion(); if (flinkVersion == null || FLINK_VERSION_BEFORE_1_10.equals(flinkVersion)) { int taskManager = param.getTaskManager(); if (taskManager > 0) { args.add(Constants.FLINK_TASK_MANAGE); args.add(String.format("%d", taskManager)); } } String jobManagerMemory = param.getJobManagerMemory(); if (StringUtils.isNotEmpty(jobManagerMemory)) { args.add(Constants.FLINK_JOB_MANAGE_MEM); args.add(jobManagerMemory); } String taskManagerMemory = param.getTaskManagerMemory(); if (StringUtils.isNotEmpty(taskManagerMemory)) { args.add(Constants.FLINK_TASK_MANAGE_MEM); args.add(taskManagerMemory); } if (StringUtils.isEmpty(others) || !others.contains(Constants.FLINK_QUEUE)) { String queue = param.getQueue(); if (StringUtils.isNotEmpty(queue)) { args.add(Constants.FLINK_QUEUE); args.add(queue); } } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/FlinkArgsUtils.java
int parallelism = param.getParallelism(); if (parallelism > 0) { args.add(Constants.FLINK_PARALLELISM); args.add(String.format("%d", parallelism)); } args.add(Constants.FLINK_SHUTDOWN_ON_ATTACHED_EXIT); if (StringUtils.isNotEmpty(others)) { args.add(others); } ProgramType programType = param.getProgramType(); String mainClass = param.getMainClass(); if (programType != null && programType != ProgramType.PYTHON && StringUtils.isNotEmpty(mainClass)) { args.add(Constants.FLINK_MAIN_CLASS); args.add(param.getMainClass()); } ResourceInfo mainJar = param.getMainJar(); if (mainJar != null) { args.add(mainJar.getRes()); } String mainArgs = param.getMainArgs(); if (StringUtils.isNotEmpty(mainArgs)) { args.add(mainArgs); } return args; } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/SparkArgsUtils.java
/* * 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.server.utils; import org.apache.dolphinscheduler.common.Constants; import org.apache.dolphinscheduler.common.enums.ProgramType; import org.apache.dolphinscheduler.common.process.ResourceInfo; import org.apache.dolphinscheduler.common.task.spark.SparkParameters; import org.apache.dolphinscheduler.common.utils.StringUtils; import java.util.ArrayList; import java.util.List; /** * spark args utils */ public class SparkArgsUtils {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/SparkArgsUtils.java
private static final String SPARK_CLUSTER = "cluster"; private static final String SPARK_LOCAL = "local"; private static final String SPARK_ON_YARN = "yarn"; /** * build args * * @param param param * @return argument list */ public static List<String> buildArgs(SparkParameters param) { List<String> args = new ArrayList<>(); String deployMode = SPARK_CLUSTER; args.add(Constants.MASTER); if (StringUtils.isNotEmpty(param.getDeployMode())) { deployMode = param.getDeployMode(); }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/SparkArgsUtils.java
if (!SPARK_LOCAL.equals(deployMode)) { args.add(SPARK_ON_YARN); args.add(Constants.DEPLOY_MODE); } args.add(param.getDeployMode()); ProgramType type = param.getProgramType(); String mainClass = param.getMainClass(); if (type != null && type != ProgramType.PYTHON && StringUtils.isNotEmpty(mainClass)) { args.add(Constants.MAIN_CLASS); args.add(mainClass); } int driverCores = param.getDriverCores(); if (driverCores != 0) { args.add(Constants.DRIVER_CORES); args.add(String.format("%d", driverCores)); } String driverMemory = param.getDriverMemory(); if (StringUtils.isNotEmpty(driverMemory)) { args.add(Constants.DRIVER_MEMORY); args.add(driverMemory); } int numExecutors = param.getNumExecutors(); if (numExecutors != 0) { args.add(Constants.NUM_EXECUTORS); args.add(String.format("%d", numExecutors)); } int executorCores = param.getExecutorCores(); if (executorCores != 0) { args.add(Constants.EXECUTOR_CORES); args.add(String.format("%d", executorCores));
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/SparkArgsUtils.java
} String executorMemory = param.getExecutorMemory(); if (StringUtils.isNotEmpty(executorMemory)) { args.add(Constants.EXECUTOR_MEMORY); args.add(executorMemory); } String others = param.getOthers(); String queue = param.getQueue(); if (StringUtils.isNotEmpty(others)) { if (!others.contains(Constants.SPARK_QUEUE) && StringUtils.isNotEmpty(queue)) { args.add(Constants.SPARK_QUEUE); args.add(queue); } args.add(others); } else if (StringUtils.isNotEmpty(queue)) { args.add(Constants.SPARK_QUEUE); args.add(queue); } ResourceInfo mainJar = param.getMainJar(); if (mainJar != null) { args.add(mainJar.getRes()); } String mainArgs = param.getMainArgs(); if (StringUtils.isNotEmpty(mainArgs)) { args.add(mainArgs); } return args; } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/mr/MapReduceTask.java
/* * 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
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/mr/MapReduceTask.java
* * 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.server.worker.task.mr; import org.apache.dolphinscheduler.common.Constants; import org.apache.dolphinscheduler.common.enums.CommandType; import org.apache.dolphinscheduler.common.enums.ProgramType; import org.apache.dolphinscheduler.common.process.Property; import org.apache.dolphinscheduler.common.process.ResourceInfo; import org.apache.dolphinscheduler.common.task.AbstractParameters; import org.apache.dolphinscheduler.common.task.mr.MapreduceParameters; import org.apache.dolphinscheduler.common.utils.*; import org.apache.dolphinscheduler.common.utils.ParameterUtils; import org.apache.dolphinscheduler.common.utils.StringUtils; import org.apache.dolphinscheduler.server.entity.TaskExecutionContext; import org.apache.dolphinscheduler.dao.entity.Resource; import org.apache.dolphinscheduler.server.utils.ParamUtils; import org.apache.dolphinscheduler.server.worker.task.AbstractYarnTask; import org.slf4j.Logger; import java.util.ArrayList; import java.util.List; import java.util.Map; /** * mapreduce task */ public class MapReduceTask extends AbstractYarnTask {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/mr/MapReduceTask.java
/** * mapreduce parameters */ private MapreduceParameters mapreduceParameters; /** * taskExecutionContext */ private TaskExecutionContext taskExecutionContext; /** * constructor * @param taskExecutionContext taskExecutionContext * @param logger logger */ public MapReduceTask(TaskExecutionContext taskExecutionContext, Logger logger) { super(taskExecutionContext, logger); this.taskExecutionContext = taskExecutionContext; } @Override public void init() { logger.info("mapreduce task params {}", taskExecutionContext.getTaskParams()); this.mapreduceParameters = JSONUtils.parseObject(taskExecutionContext.getTaskParams(), MapreduceParameters.class); if (!mapreduceParameters.checkParameters()) { throw new RuntimeException("mapreduce task params is not valid"); } mapreduceParameters.setQueue(taskExecutionContext.getQueue()); setMainJarName();
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/mr/MapReduceTask.java
Map<String, Property> paramsMap = ParamUtils.convert(ParamUtils.getUserDefParamsMap(taskExecutionContext.getDefinedParams()), taskExecutionContext.getDefinedParams(), mapreduceParameters.getLocalParametersMap(), CommandType.of(taskExecutionContext.getCmdTypeIfComplement()), taskExecutionContext.getScheduleTime()); if (paramsMap != null){ String args = ParameterUtils.convertParameterPlaceholders(mapreduceParameters.getMainArgs(), ParamUtils.convert(paramsMap)); mapreduceParameters.setMainArgs(args); if(mapreduceParameters.getProgramType() != null && mapreduceParameters.getProgramType() == ProgramType.PYTHON){ String others = ParameterUtils.convertParameterPlaceholders(mapreduceParameters.getOthers(), ParamUtils.convert(paramsMap)); mapreduceParameters.setOthers(others); } } } /** * build command * @return command * @throws Exception exception */ @Override protected String buildCommand() throws Exception { List<String> parameterList = buildParameters(mapreduceParameters); String command = ParameterUtils.convertParameterPlaceholders(String.join(" ", parameterList), taskExecutionContext.getDefinedParams()); logger.info("mapreduce task command: {}", command); return command; } @Override protected void setMainJarName() {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/mr/MapReduceTask.java
ResourceInfo mainJar = mapreduceParameters.getMainJar(); if (mainJar != null) { int resourceId = mainJar.getId(); String resourceName; if (resourceId == 0) { resourceName = mainJar.getRes(); } else { Resource resource = processService.getResourceById(mapreduceParameters.getMainJar().getId()); if (resource == null) { logger.error("resource id: {} not exist", resourceId); throw new RuntimeException(String.format("resource id: %d not exist", resourceId)); } resourceName = resource.getFullName().replaceFirst("/", ""); } mainJar.setRes(resourceName); mapreduceParameters.setMainJar(mainJar); } } @Override public AbstractParameters getParameters() { return mapreduceParameters; } /** * build parameters * @param mapreduceParameters mapreduce parameters * @return parameter list */ private List<String> buildParameters(MapreduceParameters mapreduceParameters){ List<String> result = new ArrayList<>();
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/mr/MapReduceTask.java
result.add(Constants.HADOOP); if(mapreduceParameters.getMainJar()!= null){ result.add(Constants.JAR); result.add(mapreduceParameters.getMainJar().getRes()); } if(!ProgramType.PYTHON.equals(mapreduceParameters.getProgramType()) && StringUtils.isNotEmpty(mapreduceParameters.getMainClass())){ result.add(mapreduceParameters.getMainClass()); } if (StringUtils.isNotEmpty(mapreduceParameters.getOthers())) { String others = mapreduceParameters.getOthers(); if (!others.contains(Constants.MR_QUEUE) && StringUtils.isNotEmpty(mapreduceParameters.getQueue())) { result.add(String.format("%s %s=%s", Constants.D, Constants.MR_QUEUE, mapreduceParameters.getQueue())); } result.add(mapreduceParameters.getOthers()); }else if (StringUtils.isNotEmpty(mapreduceParameters.getQueue())) { result.add(String.format("%s %s=%s", Constants.D, Constants.MR_QUEUE, mapreduceParameters.getQueue())); } if(StringUtils.isNotEmpty(mapreduceParameters.getMainArgs())){ result.add(mapreduceParameters.getMainArgs()); } return result; } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/spark/SparkTask.java
/* * 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
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/spark/SparkTask.java
* * 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.server.worker.task.spark; import org.apache.dolphinscheduler.common.enums.CommandType; import org.apache.dolphinscheduler.common.enums.SparkVersion; import org.apache.dolphinscheduler.common.process.Property; import org.apache.dolphinscheduler.common.process.ResourceInfo; import org.apache.dolphinscheduler.common.task.AbstractParameters; import org.apache.dolphinscheduler.common.task.spark.SparkParameters; import org.apache.dolphinscheduler.common.utils.JSONUtils; import org.apache.dolphinscheduler.common.utils.ParameterUtils; import org.apache.dolphinscheduler.dao.entity.Resource; import org.apache.dolphinscheduler.server.entity.TaskExecutionContext; import org.apache.dolphinscheduler.server.utils.ParamUtils; import org.apache.dolphinscheduler.server.utils.SparkArgsUtils; import org.apache.dolphinscheduler.server.worker.task.AbstractYarnTask; import java.util.ArrayList; import java.util.List; import java.util.Map; import org.slf4j.Logger; /** * spark task */ public class SparkTask extends AbstractYarnTask { /**
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/spark/SparkTask.java
* spark1 command */ private static final String SPARK1_COMMAND = "${SPARK_HOME1}/bin/spark-submit"; /** * spark2 command */ private static final String SPARK2_COMMAND = "${SPARK_HOME2}/bin/spark-submit"; /** * spark parameters */ private SparkParameters sparkParameters; /** * taskExecutionContext */ private final TaskExecutionContext sparkTaskExecutionContext; public SparkTask(TaskExecutionContext taskExecutionContext, Logger logger) { super(taskExecutionContext, logger); this.sparkTaskExecutionContext = taskExecutionContext; } @Override public void init() { logger.info("spark task params {}", sparkTaskExecutionContext.getTaskParams()); sparkParameters = JSONUtils.parseObject(sparkTaskExecutionContext.getTaskParams(), SparkParameters.class); if (null == sparkParameters) { logger.error("Spark params is null"); return; } if (!sparkParameters.checkParameters()) { throw new RuntimeException("spark task params is not valid"); }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/spark/SparkTask.java
sparkParameters.setQueue(sparkTaskExecutionContext.getQueue()); setMainJarName(); } /** * create command * * @return command */ @Override protected String buildCommand() { List<String> args = new ArrayList<>(); String sparkCommand = SPARK2_COMMAND; if (SparkVersion.SPARK1.name().equals(sparkParameters.getSparkVersion())) { sparkCommand = SPARK1_COMMAND; } args.add(sparkCommand); args.addAll(SparkArgsUtils.buildArgs(sparkParameters)); Map<String, Property> paramsMap = ParamUtils.convert(ParamUtils.getUserDefParamsMap(sparkTaskExecutionContext.getDefinedParams()), sparkTaskExecutionContext.getDefinedParams(), sparkParameters.getLocalParametersMap(), CommandType.of(sparkTaskExecutionContext.getCmdTypeIfComplement()), sparkTaskExecutionContext.getScheduleTime()); String command = null; if (null != paramsMap) { command = ParameterUtils.convertParameterPlaceholders(String.join(" ", args), ParamUtils.convert(paramsMap)); } logger.info("spark task command: {}", command);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/spark/SparkTask.java
return command; } @Override protected void setMainJarName() { ResourceInfo mainJar = sparkParameters.getMainJar(); if (null == mainJar) { throw new RuntimeException("Spark task jar params is null"); } int resourceId = mainJar.getId(); String resourceName; if (resourceId == 0) { resourceName = mainJar.getRes(); } else { Resource resource = processService.getResourceById(sparkParameters.getMainJar().getId()); if (resource == null) { logger.error("resource id: {} not exist", resourceId); throw new RuntimeException(String.format("resource id: %d not exist", resourceId)); } resourceName = resource.getFullName().replaceFirst("/", ""); } mainJar.setRes(resourceName); sparkParameters.setMainJar(mainJar); } @Override public AbstractParameters getParameters() { return sparkParameters; } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/utils/FlinkArgsUtilsTest.java
/* * 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.server.utils; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertSame; import org.apache.dolphinscheduler.common.enums.ProgramType; import org.apache.dolphinscheduler.common.process.ResourceInfo;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/utils/FlinkArgsUtilsTest.java
import org.apache.dolphinscheduler.common.task.flink.FlinkParameters; import java.util.List; import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Test FlinkArgsUtils */ public class FlinkArgsUtilsTest { private static final Logger logger = LoggerFactory.getLogger(FlinkArgsUtilsTest.class); public String mode = "cluster"; public int slot = 2; public int parallelism = 3; public String appName = "testFlink"; public int taskManager = 4; public String taskManagerMemory = "2G"; public String jobManagerMemory = "4G"; public ProgramType programType = ProgramType.JAVA; public String mainClass = "com.test"; public ResourceInfo mainJar = null; public String mainArgs = "testArgs --input file:///home"; public String queue = "queue1"; public String others = "-s hdfs:///flink/savepoint-1537"; public String flinkVersion = "<1.10"; @Before public void setUp() throws Exception { ResourceInfo main = new ResourceInfo(); main.setRes("testflink-1.0.0-SNAPSHOT.jar"); mainJar = main;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/utils/FlinkArgsUtilsTest.java
} /** * Test buildArgs */ @Test public void testBuildArgs() { FlinkParameters param = new FlinkParameters(); param.setDeployMode(mode); param.setMainClass(mainClass); param.setAppName(appName); param.setSlot(slot); param.setParallelism(parallelism); param.setTaskManager(taskManager); param.setJobManagerMemory(jobManagerMemory); param.setTaskManagerMemory(taskManagerMemory); param.setMainJar(mainJar); param.setProgramType(programType); param.setMainArgs(mainArgs); param.setQueue(queue); param.setOthers(others); param.setFlinkVersion(flinkVersion); List<String> result = FlinkArgsUtils.buildArgs(param); for (String s : result) { logger.info(s); } assertEquals(22, result.size()); assertEquals("-m", result.get(0));
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/utils/FlinkArgsUtilsTest.java
assertEquals("yarn-cluster", result.get(1)); assertEquals("-ys", result.get(2)); assertSame(Integer.valueOf(result.get(3)),slot); assertEquals("-ynm",result.get(4)); assertEquals(result.get(5),appName); assertEquals("-yn", result.get(6)); assertSame(Integer.valueOf(result.get(7)),taskManager); assertEquals("-yjm", result.get(8)); assertEquals(result.get(9),jobManagerMemory); assertEquals("-ytm", result.get(10)); assertEquals(result.get(11),taskManagerMemory); assertEquals("-yqu", result.get(12)); assertEquals(result.get(13),queue); assertEquals("-p", result.get(14)); assertSame(Integer.valueOf(result.get(15)),parallelism); assertEquals("-sae", result.get(16)); assertEquals(result.get(17),others); assertEquals("-c", result.get(18)); assertEquals(result.get(19),mainClass); assertEquals(result.get(20),mainJar.getRes()); assertEquals(result.get(21),mainArgs); FlinkParameters param1 = new FlinkParameters(); param1.setQueue(queue); param1.setDeployMode(mode); result = FlinkArgsUtils.buildArgs(param1); assertEquals(5, result.size()); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/utils/SparkArgsUtilsTest.java
/* * 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
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/utils/SparkArgsUtilsTest.java
* limitations under the License. */ package org.apache.dolphinscheduler.server.utils; import org.apache.dolphinscheduler.common.enums.ProgramType; import org.apache.dolphinscheduler.common.process.ResourceInfo; import org.apache.dolphinscheduler.common.task.spark.SparkParameters; import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.List; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertSame; /** * Test SparkArgsUtils */ public class SparkArgsUtilsTest { private static final Logger logger = LoggerFactory.getLogger(SparkArgsUtilsTest.class); public String mode = "cluster"; public String mainClass = "com.test"; public ResourceInfo mainJar = null; public String mainArgs = "partitions=2"; public String driverMemory = "2G"; public String executorMemory = "4G"; public ProgramType programType = ProgramType.JAVA; public int driverCores = 2; public int executorCores = 6; public String sparkVersion = "SPARK1"; public int numExecutors = 4; public String queue = "queue1";
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/utils/SparkArgsUtilsTest.java
@Before public void setUp() throws Exception { ResourceInfo main = new ResourceInfo(); main.setRes("testspark-1.0.0-SNAPSHOT.jar"); mainJar = main; } /** * Test buildArgs */ @Test public void testBuildArgs() { SparkParameters param = new SparkParameters(); param.setDeployMode(mode); param.setMainClass(mainClass); param.setDriverCores(driverCores); param.setDriverMemory(driverMemory); param.setExecutorCores(executorCores); param.setExecutorMemory(executorMemory); param.setMainJar(mainJar); param.setNumExecutors(numExecutors); param.setProgramType(programType); param.setSparkVersion(sparkVersion); param.setMainArgs(mainArgs); param.setQueue(queue); List<String> result = SparkArgsUtils.buildArgs(param); for (String s : result) { logger.info(s); }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,960
[Feature][Spark] Support spark name
**Describe the feature** Support spark name, which is common option **Is your feature request related to a problem? Please describe.** No. **Describe the solution you'd like** I will implement this feature
https://github.com/apache/dolphinscheduler/issues/4960
https://github.com/apache/dolphinscheduler/pull/4959
0ac0f31548ef8bfe9a968663db11fd3e09d0bf2d
e74932cfc21c95d7824cd55dd3cb6e441e2b8305
"2021-03-04T17:04:42Z"
java
"2021-03-09T04:51:35Z"
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/utils/SparkArgsUtilsTest.java
assertEquals(result.size(),20); assertEquals(result.get(0),"--master"); assertEquals(result.get(1),"yarn"); assertEquals(result.get(2),"--deploy-mode"); assertEquals(result.get(3),mode); assertEquals(result.get(4),"--class"); assertEquals(result.get(5),mainClass); assertEquals(result.get(6),"--driver-cores"); assertSame(Integer.valueOf(result.get(7)),driverCores); assertEquals(result.get(8),"--driver-memory"); assertEquals(result.get(9),driverMemory); assertEquals(result.get(10),"--num-executors"); assertSame(Integer.valueOf(result.get(11)),numExecutors); assertEquals(result.get(12),"--executor-cores"); assertSame(Integer.valueOf(result.get(13)),executorCores); assertEquals(result.get(14),"--executor-memory"); assertEquals(result.get(15),executorMemory); assertEquals(result.get(16),"--queue"); assertEquals(result.get(17),queue); assertEquals(result.get(18),mainJar.getRes()); assertEquals(result.get(19),mainArgs); SparkParameters param1 = new SparkParameters(); param1.setOthers("--files xxx/hive-site.xml"); param1.setQueue(queue); result = SparkArgsUtils.buildArgs(param1); assertEquals(result.size(),7); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,032
[Improvement][Alert] Support send emial attachment
*For better global communication, please give priority to using English description, thx! * *Please review https://dolphinscheduler.apache.org/en-us/community/development/issue.html when describe an issue.* **Describe the question** When send a email attachment,I got this exception as following: javax.mail.MessagingException: IOException while sending message at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1365) at javax.mail.Transport.send0(Transport.java:255) at javax.mail.Transport.send(Transport.java:124) at org.apache.dolphinscheduler.plugin.alert.email.MailSender.attachContent(MailSender.java:345) at org.apache.dolphinscheduler.plugin.alert.email.MailSender.attachment(MailSender.java:257) at org.apache.dolphinscheduler.plugin.alert.email.MailSender.sendMails(MailSender.java:207) at org.apache.dolphinscheduler.plugin.alert.email.MailSender.sendMails(MailSender.java:143) at org.apache.dolphinscheduler.plugin.alert.email.EmailAlertChannel.process(EmailAlertChannel.java:45) at org.apache.dolphinscheduler.alert.runner.AlertSender.alertResultHandler(AlertSender.java:162) at org.apache.dolphinscheduler.alert.runner.AlertSender.run(AlertSender.java:87) at org.apache.dolphinscheduler.alert.AlertServer.runSender(AlertServer.java:134) at org.apache.dolphinscheduler.alert.AlertServer.start(AlertServer.java:146) at org.apache.dolphinscheduler.alert.AlertServer.main(AlertServer.java:159) Caused by: javax.activation.UnsupportedDataTypeException: no object DCH for MIME type multipart/mixed; boundary="----=_Part_0_1231696346.1615378906068" at javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:896) at javax.activation.DataHandler.writeTo(DataHandler.java:317) at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1694) at javax.mail.internet.MimeMessage.writeTo(MimeMessage.java:1913) at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1315) ... 12 common frames omitted **What are the current deficiencies and the benefits of improvement** - The dev current only support table and text format email content,but not attachment format **Which version of DolphinScheduler:** -[dev] **Describe alternatives you've considered** A clear and concise description of any alternative improvement solutions you've considered.
https://github.com/apache/dolphinscheduler/issues/5032
https://github.com/apache/dolphinscheduler/pull/5033
9a3ae4839641d23f32057715ab1e88619d8dfdf8
3769066803803e7f97b1083eff12b1d6f8486771
"2021-03-11T03:13:48Z"
java
"2021-03-11T03:35:25Z"
dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/main/java/org/apache/dolphinscheduler/plugin/alert/email/MailSender.java
/* * 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.plugin.alert.email; import static java.util.Objects.requireNonNull; import org.apache.dolphinscheduler.plugin.alert.email.exception.AlertEmailException; import org.apache.dolphinscheduler.plugin.alert.email.template.AlertTemplate; import org.apache.dolphinscheduler.plugin.alert.email.template.DefaultHTMLTemplate; import org.apache.dolphinscheduler.spi.alert.AlertConstants; import org.apache.dolphinscheduler.spi.alert.AlertResult;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,032
[Improvement][Alert] Support send emial attachment
*For better global communication, please give priority to using English description, thx! * *Please review https://dolphinscheduler.apache.org/en-us/community/development/issue.html when describe an issue.* **Describe the question** When send a email attachment,I got this exception as following: javax.mail.MessagingException: IOException while sending message at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1365) at javax.mail.Transport.send0(Transport.java:255) at javax.mail.Transport.send(Transport.java:124) at org.apache.dolphinscheduler.plugin.alert.email.MailSender.attachContent(MailSender.java:345) at org.apache.dolphinscheduler.plugin.alert.email.MailSender.attachment(MailSender.java:257) at org.apache.dolphinscheduler.plugin.alert.email.MailSender.sendMails(MailSender.java:207) at org.apache.dolphinscheduler.plugin.alert.email.MailSender.sendMails(MailSender.java:143) at org.apache.dolphinscheduler.plugin.alert.email.EmailAlertChannel.process(EmailAlertChannel.java:45) at org.apache.dolphinscheduler.alert.runner.AlertSender.alertResultHandler(AlertSender.java:162) at org.apache.dolphinscheduler.alert.runner.AlertSender.run(AlertSender.java:87) at org.apache.dolphinscheduler.alert.AlertServer.runSender(AlertServer.java:134) at org.apache.dolphinscheduler.alert.AlertServer.start(AlertServer.java:146) at org.apache.dolphinscheduler.alert.AlertServer.main(AlertServer.java:159) Caused by: javax.activation.UnsupportedDataTypeException: no object DCH for MIME type multipart/mixed; boundary="----=_Part_0_1231696346.1615378906068" at javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:896) at javax.activation.DataHandler.writeTo(DataHandler.java:317) at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1694) at javax.mail.internet.MimeMessage.writeTo(MimeMessage.java:1913) at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1315) ... 12 common frames omitted **What are the current deficiencies and the benefits of improvement** - The dev current only support table and text format email content,but not attachment format **Which version of DolphinScheduler:** -[dev] **Describe alternatives you've considered** A clear and concise description of any alternative improvement solutions you've considered.
https://github.com/apache/dolphinscheduler/issues/5032
https://github.com/apache/dolphinscheduler/pull/5033
9a3ae4839641d23f32057715ab1e88619d8dfdf8
3769066803803e7f97b1083eff12b1d6f8486771
"2021-03-11T03:13:48Z"
java
"2021-03-11T03:35:25Z"
dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/main/java/org/apache/dolphinscheduler/plugin/alert/email/MailSender.java
import org.apache.dolphinscheduler.spi.alert.ShowType; import org.apache.dolphinscheduler.spi.utils.StringUtils; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.mail.EmailException; import org.apache.commons.mail.HtmlEmail; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.Properties; import javax.mail.Authenticator; import javax.mail.Message; import javax.mail.MessagingException; import javax.mail.PasswordAuthentication; import javax.mail.Session; import javax.mail.Transport; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeBodyPart; import javax.mail.internet.MimeMessage; import javax.mail.internet.MimeMultipart; import javax.mail.internet.MimeUtility; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.sun.mail.smtp.SMTPProvider; /** * mail utils */ public class MailSender {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,032
[Improvement][Alert] Support send emial attachment
*For better global communication, please give priority to using English description, thx! * *Please review https://dolphinscheduler.apache.org/en-us/community/development/issue.html when describe an issue.* **Describe the question** When send a email attachment,I got this exception as following: javax.mail.MessagingException: IOException while sending message at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1365) at javax.mail.Transport.send0(Transport.java:255) at javax.mail.Transport.send(Transport.java:124) at org.apache.dolphinscheduler.plugin.alert.email.MailSender.attachContent(MailSender.java:345) at org.apache.dolphinscheduler.plugin.alert.email.MailSender.attachment(MailSender.java:257) at org.apache.dolphinscheduler.plugin.alert.email.MailSender.sendMails(MailSender.java:207) at org.apache.dolphinscheduler.plugin.alert.email.MailSender.sendMails(MailSender.java:143) at org.apache.dolphinscheduler.plugin.alert.email.EmailAlertChannel.process(EmailAlertChannel.java:45) at org.apache.dolphinscheduler.alert.runner.AlertSender.alertResultHandler(AlertSender.java:162) at org.apache.dolphinscheduler.alert.runner.AlertSender.run(AlertSender.java:87) at org.apache.dolphinscheduler.alert.AlertServer.runSender(AlertServer.java:134) at org.apache.dolphinscheduler.alert.AlertServer.start(AlertServer.java:146) at org.apache.dolphinscheduler.alert.AlertServer.main(AlertServer.java:159) Caused by: javax.activation.UnsupportedDataTypeException: no object DCH for MIME type multipart/mixed; boundary="----=_Part_0_1231696346.1615378906068" at javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:896) at javax.activation.DataHandler.writeTo(DataHandler.java:317) at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1694) at javax.mail.internet.MimeMessage.writeTo(MimeMessage.java:1913) at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1315) ... 12 common frames omitted **What are the current deficiencies and the benefits of improvement** - The dev current only support table and text format email content,but not attachment format **Which version of DolphinScheduler:** -[dev] **Describe alternatives you've considered** A clear and concise description of any alternative improvement solutions you've considered.
https://github.com/apache/dolphinscheduler/issues/5032
https://github.com/apache/dolphinscheduler/pull/5033
9a3ae4839641d23f32057715ab1e88619d8dfdf8
3769066803803e7f97b1083eff12b1d6f8486771
"2021-03-11T03:13:48Z"
java
"2021-03-11T03:35:25Z"
dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/main/java/org/apache/dolphinscheduler/plugin/alert/email/MailSender.java
public static final Logger logger = LoggerFactory.getLogger(MailSender.class); private List<String> receivers; private List<String> receiverCcs; private String mailProtocol = "SMTP"; private String mailSmtpHost; private String mailSmtpPort; private String mailSenderEmail; private String enableSmtpAuth; private String mailUser; private String mailPasswd; private String mailUseStartTLS; private String mailUseSSL; private String xlsFilePath; private String sslTrust; private String showType; private AlertTemplate alertTemplate; private String mustNotNull = "must not be null"; public MailSender(Map<String, String> config) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,032
[Improvement][Alert] Support send emial attachment
*For better global communication, please give priority to using English description, thx! * *Please review https://dolphinscheduler.apache.org/en-us/community/development/issue.html when describe an issue.* **Describe the question** When send a email attachment,I got this exception as following: javax.mail.MessagingException: IOException while sending message at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1365) at javax.mail.Transport.send0(Transport.java:255) at javax.mail.Transport.send(Transport.java:124) at org.apache.dolphinscheduler.plugin.alert.email.MailSender.attachContent(MailSender.java:345) at org.apache.dolphinscheduler.plugin.alert.email.MailSender.attachment(MailSender.java:257) at org.apache.dolphinscheduler.plugin.alert.email.MailSender.sendMails(MailSender.java:207) at org.apache.dolphinscheduler.plugin.alert.email.MailSender.sendMails(MailSender.java:143) at org.apache.dolphinscheduler.plugin.alert.email.EmailAlertChannel.process(EmailAlertChannel.java:45) at org.apache.dolphinscheduler.alert.runner.AlertSender.alertResultHandler(AlertSender.java:162) at org.apache.dolphinscheduler.alert.runner.AlertSender.run(AlertSender.java:87) at org.apache.dolphinscheduler.alert.AlertServer.runSender(AlertServer.java:134) at org.apache.dolphinscheduler.alert.AlertServer.start(AlertServer.java:146) at org.apache.dolphinscheduler.alert.AlertServer.main(AlertServer.java:159) Caused by: javax.activation.UnsupportedDataTypeException: no object DCH for MIME type multipart/mixed; boundary="----=_Part_0_1231696346.1615378906068" at javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:896) at javax.activation.DataHandler.writeTo(DataHandler.java:317) at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1694) at javax.mail.internet.MimeMessage.writeTo(MimeMessage.java:1913) at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1315) ... 12 common frames omitted **What are the current deficiencies and the benefits of improvement** - The dev current only support table and text format email content,but not attachment format **Which version of DolphinScheduler:** -[dev] **Describe alternatives you've considered** A clear and concise description of any alternative improvement solutions you've considered.
https://github.com/apache/dolphinscheduler/issues/5032
https://github.com/apache/dolphinscheduler/pull/5033
9a3ae4839641d23f32057715ab1e88619d8dfdf8
3769066803803e7f97b1083eff12b1d6f8486771
"2021-03-11T03:13:48Z"
java
"2021-03-11T03:35:25Z"
dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/main/java/org/apache/dolphinscheduler/plugin/alert/email/MailSender.java
String receiversConfig = config.get(MailParamsConstants.NAME_PLUGIN_DEFAULT_EMAIL_RECEIVERS); if (receiversConfig == null || "".equals(receiversConfig)) { throw new AlertEmailException(MailParamsConstants.PLUGIN_DEFAULT_EMAIL_RECEIVERS + mustNotNull); } receivers = Arrays.asList(receiversConfig.split(",")); String receiverCcsConfig = config.get(MailParamsConstants.NAME_PLUGIN_DEFAULT_EMAIL_RECEIVERCCS); receiverCcs = new ArrayList<>(); if (receiverCcsConfig != null && !"".equals(receiverCcsConfig)) { receiverCcs = Arrays.asList(receiverCcsConfig.split(",")); } mailSmtpHost = config.get(MailParamsConstants.NAME_MAIL_SMTP_HOST); requireNonNull(mailSmtpHost, MailParamsConstants.MAIL_SMTP_HOST + mustNotNull); mailSmtpPort = config.get(MailParamsConstants.NAME_MAIL_SMTP_PORT); requireNonNull(mailSmtpPort, MailParamsConstants.MAIL_SMTP_PORT + mustNotNull); mailSenderEmail = config.get(MailParamsConstants.NAME_MAIL_SENDER); requireNonNull(mailSenderEmail, MailParamsConstants.MAIL_SENDER + mustNotNull); enableSmtpAuth = config.get(MailParamsConstants.NAME_MAIL_SMTP_AUTH); mailUser = config.get(MailParamsConstants.NAME_MAIL_USER); requireNonNull(mailUser, MailParamsConstants.MAIL_USER + mustNotNull); mailPasswd = config.get(MailParamsConstants.NAME_MAIL_PASSWD); requireNonNull(mailPasswd, MailParamsConstants.MAIL_PASSWD + mustNotNull); mailUseStartTLS = config.get(MailParamsConstants.NAME_MAIL_SMTP_STARTTLS_ENABLE); requireNonNull(mailUseStartTLS, MailParamsConstants.MAIL_SMTP_STARTTLS_ENABLE + mustNotNull); mailUseSSL = config.get(MailParamsConstants.NAME_MAIL_SMTP_SSL_ENABLE); requireNonNull(mailUseSSL, MailParamsConstants.MAIL_SMTP_SSL_ENABLE + mustNotNull); sslTrust = config.get(MailParamsConstants.NAME_MAIL_SMTP_SSL_TRUST); requireNonNull(sslTrust, MailParamsConstants.MAIL_SMTP_SSL_TRUST + mustNotNull); showType = config.get(AlertConstants.SHOW_TYPE); requireNonNull(showType, AlertConstants.SHOW_TYPE + mustNotNull); xlsFilePath = config.get(EmailConstants.XLS_FILE_PATH);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,032
[Improvement][Alert] Support send emial attachment
*For better global communication, please give priority to using English description, thx! * *Please review https://dolphinscheduler.apache.org/en-us/community/development/issue.html when describe an issue.* **Describe the question** When send a email attachment,I got this exception as following: javax.mail.MessagingException: IOException while sending message at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1365) at javax.mail.Transport.send0(Transport.java:255) at javax.mail.Transport.send(Transport.java:124) at org.apache.dolphinscheduler.plugin.alert.email.MailSender.attachContent(MailSender.java:345) at org.apache.dolphinscheduler.plugin.alert.email.MailSender.attachment(MailSender.java:257) at org.apache.dolphinscheduler.plugin.alert.email.MailSender.sendMails(MailSender.java:207) at org.apache.dolphinscheduler.plugin.alert.email.MailSender.sendMails(MailSender.java:143) at org.apache.dolphinscheduler.plugin.alert.email.EmailAlertChannel.process(EmailAlertChannel.java:45) at org.apache.dolphinscheduler.alert.runner.AlertSender.alertResultHandler(AlertSender.java:162) at org.apache.dolphinscheduler.alert.runner.AlertSender.run(AlertSender.java:87) at org.apache.dolphinscheduler.alert.AlertServer.runSender(AlertServer.java:134) at org.apache.dolphinscheduler.alert.AlertServer.start(AlertServer.java:146) at org.apache.dolphinscheduler.alert.AlertServer.main(AlertServer.java:159) Caused by: javax.activation.UnsupportedDataTypeException: no object DCH for MIME type multipart/mixed; boundary="----=_Part_0_1231696346.1615378906068" at javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:896) at javax.activation.DataHandler.writeTo(DataHandler.java:317) at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1694) at javax.mail.internet.MimeMessage.writeTo(MimeMessage.java:1913) at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1315) ... 12 common frames omitted **What are the current deficiencies and the benefits of improvement** - The dev current only support table and text format email content,but not attachment format **Which version of DolphinScheduler:** -[dev] **Describe alternatives you've considered** A clear and concise description of any alternative improvement solutions you've considered.
https://github.com/apache/dolphinscheduler/issues/5032
https://github.com/apache/dolphinscheduler/pull/5033
9a3ae4839641d23f32057715ab1e88619d8dfdf8
3769066803803e7f97b1083eff12b1d6f8486771
"2021-03-11T03:13:48Z"
java
"2021-03-11T03:35:25Z"
dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/main/java/org/apache/dolphinscheduler/plugin/alert/email/MailSender.java
if (StringUtils.isBlank(xlsFilePath)) { xlsFilePath = "/tmp/xls"; } alertTemplate = new DefaultHTMLTemplate(); } /** * send mail to receivers * * @param title title * @param content content */ public AlertResult sendMails(String title, String content) { return sendMails(this.receivers, this.receiverCcs, title, content); } /** * send mail to receivers * * @param title email title * @param content email content */ public AlertResult sendMailsToReceiverOnly(String title, String content) { return sendMails(this.receivers, null, title, content); } /** * send mail * * @param receivers receivers * @param receiverCcs receiverCcs * @param title title * @param content content
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,032
[Improvement][Alert] Support send emial attachment
*For better global communication, please give priority to using English description, thx! * *Please review https://dolphinscheduler.apache.org/en-us/community/development/issue.html when describe an issue.* **Describe the question** When send a email attachment,I got this exception as following: javax.mail.MessagingException: IOException while sending message at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1365) at javax.mail.Transport.send0(Transport.java:255) at javax.mail.Transport.send(Transport.java:124) at org.apache.dolphinscheduler.plugin.alert.email.MailSender.attachContent(MailSender.java:345) at org.apache.dolphinscheduler.plugin.alert.email.MailSender.attachment(MailSender.java:257) at org.apache.dolphinscheduler.plugin.alert.email.MailSender.sendMails(MailSender.java:207) at org.apache.dolphinscheduler.plugin.alert.email.MailSender.sendMails(MailSender.java:143) at org.apache.dolphinscheduler.plugin.alert.email.EmailAlertChannel.process(EmailAlertChannel.java:45) at org.apache.dolphinscheduler.alert.runner.AlertSender.alertResultHandler(AlertSender.java:162) at org.apache.dolphinscheduler.alert.runner.AlertSender.run(AlertSender.java:87) at org.apache.dolphinscheduler.alert.AlertServer.runSender(AlertServer.java:134) at org.apache.dolphinscheduler.alert.AlertServer.start(AlertServer.java:146) at org.apache.dolphinscheduler.alert.AlertServer.main(AlertServer.java:159) Caused by: javax.activation.UnsupportedDataTypeException: no object DCH for MIME type multipart/mixed; boundary="----=_Part_0_1231696346.1615378906068" at javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:896) at javax.activation.DataHandler.writeTo(DataHandler.java:317) at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1694) at javax.mail.internet.MimeMessage.writeTo(MimeMessage.java:1913) at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1315) ... 12 common frames omitted **What are the current deficiencies and the benefits of improvement** - The dev current only support table and text format email content,but not attachment format **Which version of DolphinScheduler:** -[dev] **Describe alternatives you've considered** A clear and concise description of any alternative improvement solutions you've considered.
https://github.com/apache/dolphinscheduler/issues/5032
https://github.com/apache/dolphinscheduler/pull/5033
9a3ae4839641d23f32057715ab1e88619d8dfdf8
3769066803803e7f97b1083eff12b1d6f8486771
"2021-03-11T03:13:48Z"
java
"2021-03-11T03:35:25Z"
dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/main/java/org/apache/dolphinscheduler/plugin/alert/email/MailSender.java
*/ public AlertResult sendMails(List<String> receivers, List<String> receiverCcs, String title, String content) { AlertResult alertResult = new AlertResult(); alertResult.setStatus("false"); if (CollectionUtils.isEmpty(receivers) && CollectionUtils.isEmpty(receiverCcs)) { return alertResult; } receivers.removeIf(StringUtils::isEmpty); if (showType.equals(ShowType.TABLE.getDescp()) || showType.equals(ShowType.TEXT.getDescp())) { HtmlEmail email = new HtmlEmail(); try { Session session = getSession(); email.setMailSession(session); email.setFrom(mailSenderEmail); email.setCharset(EmailConstants.UTF_8); if (CollectionUtils.isNotEmpty(receivers)) { for (String receiver : receivers) { email.addTo(receiver); } } if (CollectionUtils.isNotEmpty(receiverCcs)) { for (String receiverCc : receiverCcs) { email.addCc(receiverCc); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,032
[Improvement][Alert] Support send emial attachment
*For better global communication, please give priority to using English description, thx! * *Please review https://dolphinscheduler.apache.org/en-us/community/development/issue.html when describe an issue.* **Describe the question** When send a email attachment,I got this exception as following: javax.mail.MessagingException: IOException while sending message at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1365) at javax.mail.Transport.send0(Transport.java:255) at javax.mail.Transport.send(Transport.java:124) at org.apache.dolphinscheduler.plugin.alert.email.MailSender.attachContent(MailSender.java:345) at org.apache.dolphinscheduler.plugin.alert.email.MailSender.attachment(MailSender.java:257) at org.apache.dolphinscheduler.plugin.alert.email.MailSender.sendMails(MailSender.java:207) at org.apache.dolphinscheduler.plugin.alert.email.MailSender.sendMails(MailSender.java:143) at org.apache.dolphinscheduler.plugin.alert.email.EmailAlertChannel.process(EmailAlertChannel.java:45) at org.apache.dolphinscheduler.alert.runner.AlertSender.alertResultHandler(AlertSender.java:162) at org.apache.dolphinscheduler.alert.runner.AlertSender.run(AlertSender.java:87) at org.apache.dolphinscheduler.alert.AlertServer.runSender(AlertServer.java:134) at org.apache.dolphinscheduler.alert.AlertServer.start(AlertServer.java:146) at org.apache.dolphinscheduler.alert.AlertServer.main(AlertServer.java:159) Caused by: javax.activation.UnsupportedDataTypeException: no object DCH for MIME type multipart/mixed; boundary="----=_Part_0_1231696346.1615378906068" at javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:896) at javax.activation.DataHandler.writeTo(DataHandler.java:317) at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1694) at javax.mail.internet.MimeMessage.writeTo(MimeMessage.java:1913) at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1315) ... 12 common frames omitted **What are the current deficiencies and the benefits of improvement** - The dev current only support table and text format email content,but not attachment format **Which version of DolphinScheduler:** -[dev] **Describe alternatives you've considered** A clear and concise description of any alternative improvement solutions you've considered.
https://github.com/apache/dolphinscheduler/issues/5032
https://github.com/apache/dolphinscheduler/pull/5033
9a3ae4839641d23f32057715ab1e88619d8dfdf8
3769066803803e7f97b1083eff12b1d6f8486771
"2021-03-11T03:13:48Z"
java
"2021-03-11T03:35:25Z"
dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/main/java/org/apache/dolphinscheduler/plugin/alert/email/MailSender.java
return getStringObjectMap(title, content, alertResult, email); } catch (Exception e) { handleException(alertResult, e); } } else if (showType.equals(ShowType.ATTACHMENT.getDescp()) || showType.equals(ShowType.TABLEATTACHMENT.getDescp())) { try { String partContent = (showType.equals(ShowType.ATTACHMENT.getDescp()) ? "Please see the attachment " + title + EmailConstants.EXCEL_SUFFIX_XLS : htmlTable(content, false)); attachment(title, content, partContent); alertResult.setStatus("true"); return alertResult; } catch (Exception e) { handleException(alertResult, e); return alertResult; } } return alertResult; } /** * html table content * * @param content the content * @param showAll if show the whole content * @return the html table form */ private String htmlTable(String content, boolean showAll) { return alertTemplate.getMessageFromTemplate(content, ShowType.TABLE, showAll); } /** * html table content *
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,032
[Improvement][Alert] Support send emial attachment
*For better global communication, please give priority to using English description, thx! * *Please review https://dolphinscheduler.apache.org/en-us/community/development/issue.html when describe an issue.* **Describe the question** When send a email attachment,I got this exception as following: javax.mail.MessagingException: IOException while sending message at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1365) at javax.mail.Transport.send0(Transport.java:255) at javax.mail.Transport.send(Transport.java:124) at org.apache.dolphinscheduler.plugin.alert.email.MailSender.attachContent(MailSender.java:345) at org.apache.dolphinscheduler.plugin.alert.email.MailSender.attachment(MailSender.java:257) at org.apache.dolphinscheduler.plugin.alert.email.MailSender.sendMails(MailSender.java:207) at org.apache.dolphinscheduler.plugin.alert.email.MailSender.sendMails(MailSender.java:143) at org.apache.dolphinscheduler.plugin.alert.email.EmailAlertChannel.process(EmailAlertChannel.java:45) at org.apache.dolphinscheduler.alert.runner.AlertSender.alertResultHandler(AlertSender.java:162) at org.apache.dolphinscheduler.alert.runner.AlertSender.run(AlertSender.java:87) at org.apache.dolphinscheduler.alert.AlertServer.runSender(AlertServer.java:134) at org.apache.dolphinscheduler.alert.AlertServer.start(AlertServer.java:146) at org.apache.dolphinscheduler.alert.AlertServer.main(AlertServer.java:159) Caused by: javax.activation.UnsupportedDataTypeException: no object DCH for MIME type multipart/mixed; boundary="----=_Part_0_1231696346.1615378906068" at javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:896) at javax.activation.DataHandler.writeTo(DataHandler.java:317) at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1694) at javax.mail.internet.MimeMessage.writeTo(MimeMessage.java:1913) at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1315) ... 12 common frames omitted **What are the current deficiencies and the benefits of improvement** - The dev current only support table and text format email content,but not attachment format **Which version of DolphinScheduler:** -[dev] **Describe alternatives you've considered** A clear and concise description of any alternative improvement solutions you've considered.
https://github.com/apache/dolphinscheduler/issues/5032
https://github.com/apache/dolphinscheduler/pull/5033
9a3ae4839641d23f32057715ab1e88619d8dfdf8
3769066803803e7f97b1083eff12b1d6f8486771
"2021-03-11T03:13:48Z"
java
"2021-03-11T03:35:25Z"
dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/main/java/org/apache/dolphinscheduler/plugin/alert/email/MailSender.java
* @param content the content * @return the html table form */ private String htmlTable(String content) { return htmlTable(content, true); } /** * html text content * * @param content the content * @return text in html form */ private String htmlText(String content) { return alertTemplate.getMessageFromTemplate(content, ShowType.TEXT); } /** * send mail as Excel attachment */ private void attachment(String title, String content, String partContent) throws Exception { MimeMessage msg = getMimeMessage(); attachContent(title, content, partContent, msg); } /** * get MimeMessage */ private MimeMessage getMimeMessage() throws MessagingException { Session session = getSession(); session.setDebug(false);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,032
[Improvement][Alert] Support send emial attachment
*For better global communication, please give priority to using English description, thx! * *Please review https://dolphinscheduler.apache.org/en-us/community/development/issue.html when describe an issue.* **Describe the question** When send a email attachment,I got this exception as following: javax.mail.MessagingException: IOException while sending message at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1365) at javax.mail.Transport.send0(Transport.java:255) at javax.mail.Transport.send(Transport.java:124) at org.apache.dolphinscheduler.plugin.alert.email.MailSender.attachContent(MailSender.java:345) at org.apache.dolphinscheduler.plugin.alert.email.MailSender.attachment(MailSender.java:257) at org.apache.dolphinscheduler.plugin.alert.email.MailSender.sendMails(MailSender.java:207) at org.apache.dolphinscheduler.plugin.alert.email.MailSender.sendMails(MailSender.java:143) at org.apache.dolphinscheduler.plugin.alert.email.EmailAlertChannel.process(EmailAlertChannel.java:45) at org.apache.dolphinscheduler.alert.runner.AlertSender.alertResultHandler(AlertSender.java:162) at org.apache.dolphinscheduler.alert.runner.AlertSender.run(AlertSender.java:87) at org.apache.dolphinscheduler.alert.AlertServer.runSender(AlertServer.java:134) at org.apache.dolphinscheduler.alert.AlertServer.start(AlertServer.java:146) at org.apache.dolphinscheduler.alert.AlertServer.main(AlertServer.java:159) Caused by: javax.activation.UnsupportedDataTypeException: no object DCH for MIME type multipart/mixed; boundary="----=_Part_0_1231696346.1615378906068" at javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:896) at javax.activation.DataHandler.writeTo(DataHandler.java:317) at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1694) at javax.mail.internet.MimeMessage.writeTo(MimeMessage.java:1913) at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1315) ... 12 common frames omitted **What are the current deficiencies and the benefits of improvement** - The dev current only support table and text format email content,but not attachment format **Which version of DolphinScheduler:** -[dev] **Describe alternatives you've considered** A clear and concise description of any alternative improvement solutions you've considered.
https://github.com/apache/dolphinscheduler/issues/5032
https://github.com/apache/dolphinscheduler/pull/5033
9a3ae4839641d23f32057715ab1e88619d8dfdf8
3769066803803e7f97b1083eff12b1d6f8486771
"2021-03-11T03:13:48Z"
java
"2021-03-11T03:35:25Z"
dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/main/java/org/apache/dolphinscheduler/plugin/alert/email/MailSender.java
MimeMessage msg = new MimeMessage(session); msg.setFrom(new InternetAddress(mailSenderEmail)); for (String receiver : receivers) { msg.addRecipients(Message.RecipientType.TO, InternetAddress.parse(receiver)); } return msg; } /** * get session * * @return the new Session */ private Session getSession() { Properties props = new Properties(); props.setProperty(MailParamsConstants.MAIL_SMTP_HOST, mailSmtpHost); props.setProperty(MailParamsConstants.MAIL_SMTP_PORT, mailSmtpPort); props.setProperty(MailParamsConstants.MAIL_SMTP_AUTH, enableSmtpAuth); props.setProperty(EmailConstants.MAIL_TRANSPORT_PROTOCOL, mailProtocol); props.setProperty(MailParamsConstants.MAIL_SMTP_STARTTLS_ENABLE, mailUseStartTLS); props.setProperty(MailParamsConstants.MAIL_SMTP_SSL_ENABLE, mailUseSSL); props.setProperty(MailParamsConstants.MAIL_SMTP_SSL_TRUST, sslTrust); Authenticator auth = new Authenticator() { @Override protected PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication(mailUser, mailPasswd); }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,032
[Improvement][Alert] Support send emial attachment
*For better global communication, please give priority to using English description, thx! * *Please review https://dolphinscheduler.apache.org/en-us/community/development/issue.html when describe an issue.* **Describe the question** When send a email attachment,I got this exception as following: javax.mail.MessagingException: IOException while sending message at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1365) at javax.mail.Transport.send0(Transport.java:255) at javax.mail.Transport.send(Transport.java:124) at org.apache.dolphinscheduler.plugin.alert.email.MailSender.attachContent(MailSender.java:345) at org.apache.dolphinscheduler.plugin.alert.email.MailSender.attachment(MailSender.java:257) at org.apache.dolphinscheduler.plugin.alert.email.MailSender.sendMails(MailSender.java:207) at org.apache.dolphinscheduler.plugin.alert.email.MailSender.sendMails(MailSender.java:143) at org.apache.dolphinscheduler.plugin.alert.email.EmailAlertChannel.process(EmailAlertChannel.java:45) at org.apache.dolphinscheduler.alert.runner.AlertSender.alertResultHandler(AlertSender.java:162) at org.apache.dolphinscheduler.alert.runner.AlertSender.run(AlertSender.java:87) at org.apache.dolphinscheduler.alert.AlertServer.runSender(AlertServer.java:134) at org.apache.dolphinscheduler.alert.AlertServer.start(AlertServer.java:146) at org.apache.dolphinscheduler.alert.AlertServer.main(AlertServer.java:159) Caused by: javax.activation.UnsupportedDataTypeException: no object DCH for MIME type multipart/mixed; boundary="----=_Part_0_1231696346.1615378906068" at javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:896) at javax.activation.DataHandler.writeTo(DataHandler.java:317) at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1694) at javax.mail.internet.MimeMessage.writeTo(MimeMessage.java:1913) at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1315) ... 12 common frames omitted **What are the current deficiencies and the benefits of improvement** - The dev current only support table and text format email content,but not attachment format **Which version of DolphinScheduler:** -[dev] **Describe alternatives you've considered** A clear and concise description of any alternative improvement solutions you've considered.
https://github.com/apache/dolphinscheduler/issues/5032
https://github.com/apache/dolphinscheduler/pull/5033
9a3ae4839641d23f32057715ab1e88619d8dfdf8
3769066803803e7f97b1083eff12b1d6f8486771
"2021-03-11T03:13:48Z"
java
"2021-03-11T03:35:25Z"
dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/main/java/org/apache/dolphinscheduler/plugin/alert/email/MailSender.java
}; Session session = Session.getInstance(props, auth); session.addProvider(new SMTPProvider()); return session; } /** * attach content */ private void attachContent(String title, String content, String partContent, MimeMessage msg) throws MessagingException, IOException { /* * set receiverCc */ if (CollectionUtils.isNotEmpty(receiverCcs)) { for (String receiverCc : receiverCcs) { msg.addRecipients(Message.RecipientType.CC, InternetAddress.parse(receiverCc)); } } msg.setSubject(title); MimeMultipart partList = new MimeMultipart(); MimeBodyPart part1 = new MimeBodyPart(); part1.setContent(partContent, EmailConstants.TEXT_HTML_CHARSET_UTF_8); MimeBodyPart part2 = new MimeBodyPart(); File file = new File(xlsFilePath + EmailConstants.SINGLE_SLASH + title + EmailConstants.EXCEL_SUFFIX_XLS); if (!file.getParentFile().exists()) { file.getParentFile().mkdirs(); }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,032
[Improvement][Alert] Support send emial attachment
*For better global communication, please give priority to using English description, thx! * *Please review https://dolphinscheduler.apache.org/en-us/community/development/issue.html when describe an issue.* **Describe the question** When send a email attachment,I got this exception as following: javax.mail.MessagingException: IOException while sending message at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1365) at javax.mail.Transport.send0(Transport.java:255) at javax.mail.Transport.send(Transport.java:124) at org.apache.dolphinscheduler.plugin.alert.email.MailSender.attachContent(MailSender.java:345) at org.apache.dolphinscheduler.plugin.alert.email.MailSender.attachment(MailSender.java:257) at org.apache.dolphinscheduler.plugin.alert.email.MailSender.sendMails(MailSender.java:207) at org.apache.dolphinscheduler.plugin.alert.email.MailSender.sendMails(MailSender.java:143) at org.apache.dolphinscheduler.plugin.alert.email.EmailAlertChannel.process(EmailAlertChannel.java:45) at org.apache.dolphinscheduler.alert.runner.AlertSender.alertResultHandler(AlertSender.java:162) at org.apache.dolphinscheduler.alert.runner.AlertSender.run(AlertSender.java:87) at org.apache.dolphinscheduler.alert.AlertServer.runSender(AlertServer.java:134) at org.apache.dolphinscheduler.alert.AlertServer.start(AlertServer.java:146) at org.apache.dolphinscheduler.alert.AlertServer.main(AlertServer.java:159) Caused by: javax.activation.UnsupportedDataTypeException: no object DCH for MIME type multipart/mixed; boundary="----=_Part_0_1231696346.1615378906068" at javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:896) at javax.activation.DataHandler.writeTo(DataHandler.java:317) at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1694) at javax.mail.internet.MimeMessage.writeTo(MimeMessage.java:1913) at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1315) ... 12 common frames omitted **What are the current deficiencies and the benefits of improvement** - The dev current only support table and text format email content,but not attachment format **Which version of DolphinScheduler:** -[dev] **Describe alternatives you've considered** A clear and concise description of any alternative improvement solutions you've considered.
https://github.com/apache/dolphinscheduler/issues/5032
https://github.com/apache/dolphinscheduler/pull/5033
9a3ae4839641d23f32057715ab1e88619d8dfdf8
3769066803803e7f97b1083eff12b1d6f8486771
"2021-03-11T03:13:48Z"
java
"2021-03-11T03:35:25Z"
dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/main/java/org/apache/dolphinscheduler/plugin/alert/email/MailSender.java
ExcelUtils.genExcelFile(content, title, xlsFilePath); part2.attachFile(file); part2.setFileName(MimeUtility.encodeText(title + EmailConstants.EXCEL_SUFFIX_XLS, EmailConstants.UTF_8, "B")); partList.addBodyPart(part1); partList.addBodyPart(part2); msg.setContent(partList); Transport.send(msg); deleteFile(file); } /** * the string object map */ private AlertResult getStringObjectMap(String title, String content, AlertResult alertResult, HtmlEmail email) throws EmailException { /* * the subject of the message to be sent */ email.setSubject(title); /* * to send information, you can use HTML tags in mail content because of the use of HtmlEmail */ if (showType.equals(ShowType.TABLE.getDescp())) { email.setMsg(htmlTable(content)); } else if (showType.equals(ShowType.TEXT.getDescp())) { email.setMsg(htmlText(content)); } email.setDebug(true);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
5,032
[Improvement][Alert] Support send emial attachment
*For better global communication, please give priority to using English description, thx! * *Please review https://dolphinscheduler.apache.org/en-us/community/development/issue.html when describe an issue.* **Describe the question** When send a email attachment,I got this exception as following: javax.mail.MessagingException: IOException while sending message at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1365) at javax.mail.Transport.send0(Transport.java:255) at javax.mail.Transport.send(Transport.java:124) at org.apache.dolphinscheduler.plugin.alert.email.MailSender.attachContent(MailSender.java:345) at org.apache.dolphinscheduler.plugin.alert.email.MailSender.attachment(MailSender.java:257) at org.apache.dolphinscheduler.plugin.alert.email.MailSender.sendMails(MailSender.java:207) at org.apache.dolphinscheduler.plugin.alert.email.MailSender.sendMails(MailSender.java:143) at org.apache.dolphinscheduler.plugin.alert.email.EmailAlertChannel.process(EmailAlertChannel.java:45) at org.apache.dolphinscheduler.alert.runner.AlertSender.alertResultHandler(AlertSender.java:162) at org.apache.dolphinscheduler.alert.runner.AlertSender.run(AlertSender.java:87) at org.apache.dolphinscheduler.alert.AlertServer.runSender(AlertServer.java:134) at org.apache.dolphinscheduler.alert.AlertServer.start(AlertServer.java:146) at org.apache.dolphinscheduler.alert.AlertServer.main(AlertServer.java:159) Caused by: javax.activation.UnsupportedDataTypeException: no object DCH for MIME type multipart/mixed; boundary="----=_Part_0_1231696346.1615378906068" at javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:896) at javax.activation.DataHandler.writeTo(DataHandler.java:317) at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1694) at javax.mail.internet.MimeMessage.writeTo(MimeMessage.java:1913) at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1315) ... 12 common frames omitted **What are the current deficiencies and the benefits of improvement** - The dev current only support table and text format email content,but not attachment format **Which version of DolphinScheduler:** -[dev] **Describe alternatives you've considered** A clear and concise description of any alternative improvement solutions you've considered.
https://github.com/apache/dolphinscheduler/issues/5032
https://github.com/apache/dolphinscheduler/pull/5033
9a3ae4839641d23f32057715ab1e88619d8dfdf8
3769066803803e7f97b1083eff12b1d6f8486771
"2021-03-11T03:13:48Z"
java
"2021-03-11T03:35:25Z"
dolphinscheduler-alert-plugin/dolphinscheduler-alert-email/src/main/java/org/apache/dolphinscheduler/plugin/alert/email/MailSender.java
Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); email.send(); alertResult.setStatus("true"); return alertResult; } /** * file delete * * @param file the file to delete */ public void deleteFile(File file) { if (file.exists()) { if (file.delete()) { logger.info("delete success: {}", file.getAbsolutePath() + file.getName()); } else { logger.info("delete fail: {}", file.getAbsolutePath() + file.getName()); } } else { logger.info("file not exists: {}", file.getAbsolutePath() + file.getName()); } } /** * handle exception */ private void handleException(AlertResult alertResult, Exception e) { logger.error("Send email to {} failed", receivers, e); alertResult.setMessage("Send email to {" + String.join(",", receivers) + "} failed," + e.toString()); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,939
[Improvement][worker] Optimize KillYarnJob
When KillYarnJob, determine whether the target host is the local machine, if it is, rpc communication is not required org.apache.dolphinscheduler.server.worker.processor.TaskKillProcessor#killYarnJob
https://github.com/apache/dolphinscheduler/issues/4939
https://github.com/apache/dolphinscheduler/pull/4943
beb5adb9855521341e8b88a31440075b9708b852
ea6b1de120cd438b7611b966d396164dec421cbb
"2021-03-03T07:19:13Z"
java
"2021-03-11T14:13:44Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/LoggerUtils.java
/* * 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.common.utils; import org.apache.dolphinscheduler.common.Constants; import java.util.ArrayList; import java.util.List; import java.util.Optional; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.slf4j.Logger; /** * logger utils */ public class LoggerUtils {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,939
[Improvement][worker] Optimize KillYarnJob
When KillYarnJob, determine whether the target host is the local machine, if it is, rpc communication is not required org.apache.dolphinscheduler.server.worker.processor.TaskKillProcessor#killYarnJob
https://github.com/apache/dolphinscheduler/issues/4939
https://github.com/apache/dolphinscheduler/pull/4943
beb5adb9855521341e8b88a31440075b9708b852
ea6b1de120cd438b7611b966d396164dec421cbb
"2021-03-03T07:19:13Z"
java
"2021-03-11T14:13:44Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/LoggerUtils.java
private LoggerUtils() { throw new UnsupportedOperationException("Construct LoggerUtils"); } /** * rules for extracting application ID */ private static final Pattern APPLICATION_REGEX = Pattern.compile(Constants.APPLICATION_REGEX); /** * Task Logger's prefix */ public static final String TASK_LOGGER_INFO_PREFIX = "TASK"; /** * Task Logger Thread's name */ public static final String TASK_LOGGER_THREAD_NAME = "TaskLogInfo"; /**
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,939
[Improvement][worker] Optimize KillYarnJob
When KillYarnJob, determine whether the target host is the local machine, if it is, rpc communication is not required org.apache.dolphinscheduler.server.worker.processor.TaskKillProcessor#killYarnJob
https://github.com/apache/dolphinscheduler/issues/4939
https://github.com/apache/dolphinscheduler/pull/4943
beb5adb9855521341e8b88a31440075b9708b852
ea6b1de120cd438b7611b966d396164dec421cbb
"2021-03-03T07:19:13Z"
java
"2021-03-11T14:13:44Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/LoggerUtils.java
* Task Logger Thread's name */ public static final String TASK_APPID_LOG_FORMAT = "[taskAppId="; /** * build job id * * @param affix Task Logger's prefix * @param processDefId process define id * @param processInstId process instance id * @param taskId task id * @return task id format */ public static String buildTaskId(String affix, int processDefId, int processInstId, int taskId) { return String.format(" - %s%s-%s-%s-%s]", TASK_APPID_LOG_FORMAT, affix, processDefId, processInstId, taskId); } /** * processing log * get yarn application id list * * @param log log content * @param logger logger * @return app id list */
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,939
[Improvement][worker] Optimize KillYarnJob
When KillYarnJob, determine whether the target host is the local machine, if it is, rpc communication is not required org.apache.dolphinscheduler.server.worker.processor.TaskKillProcessor#killYarnJob
https://github.com/apache/dolphinscheduler/issues/4939
https://github.com/apache/dolphinscheduler/pull/4943
beb5adb9855521341e8b88a31440075b9708b852
ea6b1de120cd438b7611b966d396164dec421cbb
"2021-03-03T07:19:13Z"
java
"2021-03-11T14:13:44Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/LoggerUtils.java
public static List<String> getAppIds(String log, Logger logger) { List<String> appIds = new ArrayList<>(); Matcher matcher = APPLICATION_REGEX.matcher(log); while (matcher.find()) { String appId = matcher.group(); if (!appIds.contains(appId)) { logger.info("find app id: {}", appId); appIds.add(appId); } } return appIds; } public static void logError(Optional<Logger> optionalLogger , String error) { optionalLogger.ifPresent((Logger logger) -> logger.error(error)); } public static void logError(Optional<Logger> optionalLogger , Throwable e) { optionalLogger.ifPresent((Logger logger) -> logger.error(e.getMessage(), e)); } public static void logError(Optional<Logger> optionalLogger , String error, Throwable e) { optionalLogger.ifPresent((Logger logger) -> logger.error(error, e)); } public static void logInfo(Optional<Logger> optionalLogger , String info) { optionalLogger.ifPresent((Logger logger) -> logger.info(info)); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,939
[Improvement][worker] Optimize KillYarnJob
When KillYarnJob, determine whether the target host is the local machine, if it is, rpc communication is not required org.apache.dolphinscheduler.server.worker.processor.TaskKillProcessor#killYarnJob
https://github.com/apache/dolphinscheduler/issues/4939
https://github.com/apache/dolphinscheduler/pull/4943
beb5adb9855521341e8b88a31440075b9708b852
ea6b1de120cd438b7611b966d396164dec421cbb
"2021-03-03T07:19:13Z"
java
"2021-03-11T14:13:44Z"
dolphinscheduler-common/src/test/java/org/apache/dolphinscheduler/common/utils/LoggerUtilsTest.java
/* * 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.common.utils; import org.junit.Assert; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.List; public class LoggerUtilsTest {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,939
[Improvement][worker] Optimize KillYarnJob
When KillYarnJob, determine whether the target host is the local machine, if it is, rpc communication is not required org.apache.dolphinscheduler.server.worker.processor.TaskKillProcessor#killYarnJob
https://github.com/apache/dolphinscheduler/issues/4939
https://github.com/apache/dolphinscheduler/pull/4943
beb5adb9855521341e8b88a31440075b9708b852
ea6b1de120cd438b7611b966d396164dec421cbb
"2021-03-03T07:19:13Z"
java
"2021-03-11T14:13:44Z"
dolphinscheduler-common/src/test/java/org/apache/dolphinscheduler/common/utils/LoggerUtilsTest.java
private Logger logger = LoggerFactory.getLogger(LoggerUtilsTest.class); @Test public void buildTaskId() { String taskId = LoggerUtils.buildTaskId(LoggerUtils.TASK_LOGGER_INFO_PREFIX,79,4084,15210); Assert.assertEquals(" - [taskAppId=TASK-79-4084-15210]", taskId); } @Test public void getAppIds() { List<String> appIdList = LoggerUtils.getAppIds("Running job: application_1_1",logger); Assert.assertEquals("application_1_1", appIdList.get(0)); } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,939
[Improvement][worker] Optimize KillYarnJob
When KillYarnJob, determine whether the target host is the local machine, if it is, rpc communication is not required org.apache.dolphinscheduler.server.worker.processor.TaskKillProcessor#killYarnJob
https://github.com/apache/dolphinscheduler/issues/4939
https://github.com/apache/dolphinscheduler/pull/4943
beb5adb9855521341e8b88a31440075b9708b852
ea6b1de120cd438b7611b966d396164dec421cbb
"2021-03-03T07:19:13Z"
java
"2021-03-11T14:13:44Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/log/LoggerRequestProcessor.java
/* * 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.server.log; import org.apache.dolphinscheduler.common.utils.IOUtils; import org.apache.dolphinscheduler.common.utils.JSONUtils; import org.apache.dolphinscheduler.remote.command.Command; import org.apache.dolphinscheduler.remote.command.CommandType; import org.apache.dolphinscheduler.remote.command.log.GetLogBytesRequestCommand; import org.apache.dolphinscheduler.remote.command.log.GetLogBytesResponseCommand; import org.apache.dolphinscheduler.remote.command.log.RemoveTaskLogRequestCommand;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,939
[Improvement][worker] Optimize KillYarnJob
When KillYarnJob, determine whether the target host is the local machine, if it is, rpc communication is not required org.apache.dolphinscheduler.server.worker.processor.TaskKillProcessor#killYarnJob
https://github.com/apache/dolphinscheduler/issues/4939
https://github.com/apache/dolphinscheduler/pull/4943
beb5adb9855521341e8b88a31440075b9708b852
ea6b1de120cd438b7611b966d396164dec421cbb
"2021-03-03T07:19:13Z"
java
"2021-03-11T14:13:44Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/log/LoggerRequestProcessor.java
import org.apache.dolphinscheduler.remote.command.log.RemoveTaskLogResponseCommand; import org.apache.dolphinscheduler.remote.command.log.RollViewLogRequestCommand; import org.apache.dolphinscheduler.remote.command.log.RollViewLogResponseCommand; import org.apache.dolphinscheduler.remote.command.log.ViewLogRequestCommand; import org.apache.dolphinscheduler.remote.command.log.ViewLogResponseCommand; import org.apache.dolphinscheduler.remote.processor.NettyRequestProcessor; import java.io.BufferedReader; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.nio.file.Files; import java.nio.file.Paths; import java.util.Collections; import java.util.List; import java.util.concurrent.ExecutorService; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; import java.util.stream.Stream; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import io.netty.channel.Channel; /** * logger request process logic */ public class LoggerRequestProcessor implements NettyRequestProcessor {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,939
[Improvement][worker] Optimize KillYarnJob
When KillYarnJob, determine whether the target host is the local machine, if it is, rpc communication is not required org.apache.dolphinscheduler.server.worker.processor.TaskKillProcessor#killYarnJob
https://github.com/apache/dolphinscheduler/issues/4939
https://github.com/apache/dolphinscheduler/pull/4943
beb5adb9855521341e8b88a31440075b9708b852
ea6b1de120cd438b7611b966d396164dec421cbb
"2021-03-03T07:19:13Z"
java
"2021-03-11T14:13:44Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/log/LoggerRequestProcessor.java
private final Logger logger = LoggerFactory.getLogger(LoggerRequestProcessor.class); private final ThreadPoolExecutor executor; public LoggerRequestProcessor() { this.executor = new ThreadPoolExecutor(4, 4, 10, TimeUnit.SECONDS, new LinkedBlockingQueue<>(100)); } @Override public void process(Channel channel, Command command) { logger.info("received command : {}", command); /** * reuqest task log command type */ final CommandType commandType = command.getType(); switch (commandType) { case GET_LOG_BYTES_REQUEST: GetLogBytesRequestCommand getLogRequest = JSONUtils.parseObject( command.getBody(), GetLogBytesRequestCommand.class); byte[] bytes = getFileContentBytes(getLogRequest.getPath());
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,939
[Improvement][worker] Optimize KillYarnJob
When KillYarnJob, determine whether the target host is the local machine, if it is, rpc communication is not required org.apache.dolphinscheduler.server.worker.processor.TaskKillProcessor#killYarnJob
https://github.com/apache/dolphinscheduler/issues/4939
https://github.com/apache/dolphinscheduler/pull/4943
beb5adb9855521341e8b88a31440075b9708b852
ea6b1de120cd438b7611b966d396164dec421cbb
"2021-03-03T07:19:13Z"
java
"2021-03-11T14:13:44Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/log/LoggerRequestProcessor.java
GetLogBytesResponseCommand getLogResponse = new GetLogBytesResponseCommand(bytes); channel.writeAndFlush(getLogResponse.convert2Command(command.getOpaque())); break; case VIEW_WHOLE_LOG_REQUEST: ViewLogRequestCommand viewLogRequest = JSONUtils.parseObject( command.getBody(), ViewLogRequestCommand.class); String msg = readWholeFileContent(viewLogRequest.getPath()); ViewLogResponseCommand viewLogResponse = new ViewLogResponseCommand(msg); channel.writeAndFlush(viewLogResponse.convert2Command(command.getOpaque())); break; case ROLL_VIEW_LOG_REQUEST: RollViewLogRequestCommand rollViewLogRequest = JSONUtils.parseObject( command.getBody(), RollViewLogRequestCommand.class); List<String> lines = readPartFileContent(rollViewLogRequest.getPath(), rollViewLogRequest.getSkipLineNum(), rollViewLogRequest.getLimit()); StringBuilder builder = new StringBuilder(); for (String line : lines) { builder.append(line + "\r\n"); } RollViewLogResponseCommand rollViewLogRequestResponse = new RollViewLogResponseCommand(builder.toString()); channel.writeAndFlush(rollViewLogRequestResponse.convert2Command(command.getOpaque())); break; case REMOVE_TAK_LOG_REQUEST: RemoveTaskLogRequestCommand removeTaskLogRequest = JSONUtils.parseObject( command.getBody(), RemoveTaskLogRequestCommand.class); String taskLogPath = removeTaskLogRequest.getPath(); File taskLogFile = new File(taskLogPath); Boolean status = true; try { if (taskLogFile.exists()) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,939
[Improvement][worker] Optimize KillYarnJob
When KillYarnJob, determine whether the target host is the local machine, if it is, rpc communication is not required org.apache.dolphinscheduler.server.worker.processor.TaskKillProcessor#killYarnJob
https://github.com/apache/dolphinscheduler/issues/4939
https://github.com/apache/dolphinscheduler/pull/4943
beb5adb9855521341e8b88a31440075b9708b852
ea6b1de120cd438b7611b966d396164dec421cbb
"2021-03-03T07:19:13Z"
java
"2021-03-11T14:13:44Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/log/LoggerRequestProcessor.java
status = taskLogFile.delete(); } } catch (Exception e) { status = false; } RemoveTaskLogResponseCommand removeTaskLogResponse = new RemoveTaskLogResponseCommand(status); channel.writeAndFlush(removeTaskLogResponse.convert2Command(command.getOpaque())); break; default: throw new IllegalArgumentException("unknown commandType"); } } public ExecutorService getExecutor() { return this.executor; } /** * get files content bytes,for down load file * * @param filePath file path * @return byte array of file * @throws Exception exception */ private byte[] getFileContentBytes(String filePath) { InputStream in = null; ByteArrayOutputStream bos = null; try { in = new FileInputStream(filePath); bos = new ByteArrayOutputStream(); byte[] buf = new byte[1024]; int len;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,939
[Improvement][worker] Optimize KillYarnJob
When KillYarnJob, determine whether the target host is the local machine, if it is, rpc communication is not required org.apache.dolphinscheduler.server.worker.processor.TaskKillProcessor#killYarnJob
https://github.com/apache/dolphinscheduler/issues/4939
https://github.com/apache/dolphinscheduler/pull/4943
beb5adb9855521341e8b88a31440075b9708b852
ea6b1de120cd438b7611b966d396164dec421cbb
"2021-03-03T07:19:13Z"
java
"2021-03-11T14:13:44Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/log/LoggerRequestProcessor.java
while ((len = in.read(buf)) != -1) { bos.write(buf, 0, len); } return bos.toByteArray(); } catch (IOException e) { logger.error("get file bytes error",e); } finally { IOUtils.closeQuietly(bos); IOUtils.closeQuietly(in); } return new byte[0]; } /** * read part file content,can skip any line and read some lines * * @param filePath file path * @param skipLine skip line * @param limit read lines limit * @return part file content */ private List<String> readPartFileContent(String filePath, int skipLine, int limit) { File file = new File(filePath); if (file.exists() && file.isFile()) { try (Stream<String> stream = Files.lines(Paths.get(filePath))) { return stream.skip(skipLine).limit(limit).collect(Collectors.toList()); } catch (IOException e) { logger.error("read file error",e); }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,939
[Improvement][worker] Optimize KillYarnJob
When KillYarnJob, determine whether the target host is the local machine, if it is, rpc communication is not required org.apache.dolphinscheduler.server.worker.processor.TaskKillProcessor#killYarnJob
https://github.com/apache/dolphinscheduler/issues/4939
https://github.com/apache/dolphinscheduler/pull/4943
beb5adb9855521341e8b88a31440075b9708b852
ea6b1de120cd438b7611b966d396164dec421cbb
"2021-03-03T07:19:13Z"
java
"2021-03-11T14:13:44Z"
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/log/LoggerRequestProcessor.java
} else { logger.info("file path: {} not exists", filePath); } return Collections.emptyList(); } /** * read whole file content * * @param filePath file path * @return whole file content */ private String readWholeFileContent(String filePath) { BufferedReader br = null; String line; StringBuilder sb = new StringBuilder(); try { br = new BufferedReader(new InputStreamReader(new FileInputStream(filePath))); while ((line = br.readLine()) != null) { sb.append(line + "\r\n"); } return sb.toString(); } catch (IOException e) { logger.error("read file error",e); } finally { IOUtils.closeQuietly(br); } return ""; } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,939
[Improvement][worker] Optimize KillYarnJob
When KillYarnJob, determine whether the target host is the local machine, if it is, rpc communication is not required org.apache.dolphinscheduler.server.worker.processor.TaskKillProcessor#killYarnJob
https://github.com/apache/dolphinscheduler/issues/4939
https://github.com/apache/dolphinscheduler/pull/4943
beb5adb9855521341e8b88a31440075b9708b852
ea6b1de120cd438b7611b966d396164dec421cbb
"2021-03-03T07:19:13Z"
java
"2021-03-11T14:13:44Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/log/LogClientService.java
/* * 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.service.log; import org.apache.dolphinscheduler.common.utils.JSONUtils; import org.apache.dolphinscheduler.remote.NettyRemotingClient; import org.apache.dolphinscheduler.remote.command.Command; import org.apache.dolphinscheduler.remote.command.log.GetLogBytesRequestCommand; import org.apache.dolphinscheduler.remote.command.log.GetLogBytesResponseCommand; import org.apache.dolphinscheduler.remote.command.log.RemoveTaskLogRequestCommand; import org.apache.dolphinscheduler.remote.command.log.RemoveTaskLogResponseCommand; import org.apache.dolphinscheduler.remote.command.log.RollViewLogRequestCommand; import org.apache.dolphinscheduler.remote.command.log.RollViewLogResponseCommand; import org.apache.dolphinscheduler.remote.command.log.ViewLogRequestCommand; import org.apache.dolphinscheduler.remote.command.log.ViewLogResponseCommand; import org.apache.dolphinscheduler.remote.config.NettyClientConfig;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,939
[Improvement][worker] Optimize KillYarnJob
When KillYarnJob, determine whether the target host is the local machine, if it is, rpc communication is not required org.apache.dolphinscheduler.server.worker.processor.TaskKillProcessor#killYarnJob
https://github.com/apache/dolphinscheduler/issues/4939
https://github.com/apache/dolphinscheduler/pull/4943
beb5adb9855521341e8b88a31440075b9708b852
ea6b1de120cd438b7611b966d396164dec421cbb
"2021-03-03T07:19:13Z"
java
"2021-03-11T14:13:44Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/log/LogClientService.java
import org.apache.dolphinscheduler.remote.utils.Host; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * log client */ public class LogClientService { private static final Logger logger = LoggerFactory.getLogger(LogClientService.class); private final NettyClientConfig clientConfig; private final NettyRemotingClient client; private volatile boolean isRunning; /** * request time out */ private static final long LOG_REQUEST_TIMEOUT = 10 * 1000L; /** * construct client */ public LogClientService() { this.clientConfig = new NettyClientConfig(); this.clientConfig.setWorkerThreads(4); this.client = new NettyRemotingClient(clientConfig); this.isRunning = true; } /** * close */ public void close() { this.client.close(); this.isRunning = false;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,939
[Improvement][worker] Optimize KillYarnJob
When KillYarnJob, determine whether the target host is the local machine, if it is, rpc communication is not required org.apache.dolphinscheduler.server.worker.processor.TaskKillProcessor#killYarnJob
https://github.com/apache/dolphinscheduler/issues/4939
https://github.com/apache/dolphinscheduler/pull/4943
beb5adb9855521341e8b88a31440075b9708b852
ea6b1de120cd438b7611b966d396164dec421cbb
"2021-03-03T07:19:13Z"
java
"2021-03-11T14:13:44Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/log/LogClientService.java
logger.info("logger client closed"); } /** * roll view log * * @param host host * @param port port * @param path path * @param skipLineNum skip line number * @param limit limit * @return log content */ public String rollViewLog(String host, int port, String path, int skipLineNum, int limit) { logger.info("roll view log, host : {}, port : {}, path {}, skipLineNum {} ,limit {}", host, port, path, skipLineNum, limit); RollViewLogRequestCommand request = new RollViewLogRequestCommand(path, skipLineNum, limit); String result = ""; final Host address = new Host(host, port); try { Command command = request.convert2Command(); Command response = this.client.sendSync(address, command, LOG_REQUEST_TIMEOUT); if (response != null) { RollViewLogResponseCommand rollReviewLog = JSONUtils.parseObject( response.getBody(), RollViewLogResponseCommand.class); return rollReviewLog.getMsg(); } } catch (Exception e) { logger.error("roll view log error", e); } finally { this.client.closeChannel(address); }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,939
[Improvement][worker] Optimize KillYarnJob
When KillYarnJob, determine whether the target host is the local machine, if it is, rpc communication is not required org.apache.dolphinscheduler.server.worker.processor.TaskKillProcessor#killYarnJob
https://github.com/apache/dolphinscheduler/issues/4939
https://github.com/apache/dolphinscheduler/pull/4943
beb5adb9855521341e8b88a31440075b9708b852
ea6b1de120cd438b7611b966d396164dec421cbb
"2021-03-03T07:19:13Z"
java
"2021-03-11T14:13:44Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/log/LogClientService.java
return result; } /** * view log * * @param host host * @param port port * @param path path * @return log content */ public String viewLog(String host, int port, String path) { logger.info("view log path {}", path); ViewLogRequestCommand request = new ViewLogRequestCommand(path); String result = ""; final Host address = new Host(host, port); try { Command command = request.convert2Command(); Command response = this.client.sendSync(address, command, LOG_REQUEST_TIMEOUT); if (response != null) { ViewLogResponseCommand viewLog = JSONUtils.parseObject( response.getBody(), ViewLogResponseCommand.class); return viewLog.getMsg(); } } catch (Exception e) { logger.error("view log error", e); } finally { this.client.closeChannel(address); } return result; }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,939
[Improvement][worker] Optimize KillYarnJob
When KillYarnJob, determine whether the target host is the local machine, if it is, rpc communication is not required org.apache.dolphinscheduler.server.worker.processor.TaskKillProcessor#killYarnJob
https://github.com/apache/dolphinscheduler/issues/4939
https://github.com/apache/dolphinscheduler/pull/4943
beb5adb9855521341e8b88a31440075b9708b852
ea6b1de120cd438b7611b966d396164dec421cbb
"2021-03-03T07:19:13Z"
java
"2021-03-11T14:13:44Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/log/LogClientService.java
/** * get log size * * @param host host * @param port port * @param path log path * @return log content bytes */ public byte[] getLogBytes(String host, int port, String path) { logger.info("log path {}", path); GetLogBytesRequestCommand request = new GetLogBytesRequestCommand(path); byte[] result = null; final Host address = new Host(host, port); try { Command command = request.convert2Command(); Command response = this.client.sendSync(address, command, LOG_REQUEST_TIMEOUT); if (response != null) { GetLogBytesResponseCommand getLog = JSONUtils.parseObject( response.getBody(), GetLogBytesResponseCommand.class); return getLog.getData(); } } catch (Exception e) { logger.error("get log size error", e); } finally { this.client.closeChannel(address); } return result; } /** * remove task log
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,939
[Improvement][worker] Optimize KillYarnJob
When KillYarnJob, determine whether the target host is the local machine, if it is, rpc communication is not required org.apache.dolphinscheduler.server.worker.processor.TaskKillProcessor#killYarnJob
https://github.com/apache/dolphinscheduler/issues/4939
https://github.com/apache/dolphinscheduler/pull/4943
beb5adb9855521341e8b88a31440075b9708b852
ea6b1de120cd438b7611b966d396164dec421cbb
"2021-03-03T07:19:13Z"
java
"2021-03-11T14:13:44Z"
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/log/LogClientService.java
* * @param host host * @param port port * @param path path * @return remove task status */ public Boolean removeTaskLog(String host, int port, String path) { logger.info("log path {}", path); RemoveTaskLogRequestCommand request = new RemoveTaskLogRequestCommand(path); Boolean result = false; final Host address = new Host(host, port); try { Command command = request.convert2Command(); Command response = this.client.sendSync(address, command, LOG_REQUEST_TIMEOUT); if (response != null) { RemoveTaskLogResponseCommand taskLogResponse = JSONUtils.parseObject( response.getBody(), RemoveTaskLogResponseCommand.class); return taskLogResponse.getStatus(); } } catch (Exception e) { logger.error("remove task log error", e); } finally { this.client.closeChannel(address); } return result; } public boolean isRunning() { return isRunning; } }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,884
[Improvement][Common] a concatenation URL problem occurred when the address of the ACITVE ResourceManager in YARN HA mode failed to be obtained
**Describe the question** Acitve ReSourceManager IP = null when obtaining Acitve ReSourceManager address in YARN HA mode fails, the program will return splicing application url = http://null:8088/ws/v1/cluster/apps/%s **What are the current deficiencies and the benefits of improvement** The yarn application URL generation failed exception should be thrown here **Which version of DolphinScheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/4884
https://github.com/apache/dolphinscheduler/pull/4885
ea6b1de120cd438b7611b966d396164dec421cbb
c8e31ad58e15936174e773172d12337a8cf26d69
"2021-02-26T04:31:57Z"
java
"2021-03-11T14:14:52Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/HadoopUtils.java
/* * 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.common.utils; import static org.apache.dolphinscheduler.common.Constants.RESOURCE_UPLOAD_PATH; import org.apache.dolphinscheduler.common.Constants; import org.apache.dolphinscheduler.common.enums.ExecutionStatus; import org.apache.dolphinscheduler.common.enums.ResUploadType; import org.apache.dolphinscheduler.common.enums.ResourceType; import org.apache.commons.io.IOUtils; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FSDataInputStream; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,884
[Improvement][Common] a concatenation URL problem occurred when the address of the ACITVE ResourceManager in YARN HA mode failed to be obtained
**Describe the question** Acitve ReSourceManager IP = null when obtaining Acitve ReSourceManager address in YARN HA mode fails, the program will return splicing application url = http://null:8088/ws/v1/cluster/apps/%s **What are the current deficiencies and the benefits of improvement** The yarn application URL generation failed exception should be thrown here **Which version of DolphinScheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/4884
https://github.com/apache/dolphinscheduler/pull/4885
ea6b1de120cd438b7611b966d396164dec421cbb
c8e31ad58e15936174e773172d12337a8cf26d69
"2021-02-26T04:31:57Z"
java
"2021-03-11T14:14:52Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/HadoopUtils.java
import org.apache.hadoop.fs.FileUtil; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hdfs.HdfsConfiguration; import org.apache.hadoop.security.UserGroupInformation; import org.apache.hadoop.yarn.client.cli.RMAdminCLI; import java.io.BufferedReader; import java.io.Closeable; import java.io.File; import java.io.IOException; import java.io.InputStreamReader; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.security.PrivilegedExceptionAction; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; import java.util.stream.Stream; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.fasterxml.jackson.databind.node.ObjectNode; import com.google.common.cache.CacheBuilder; import com.google.common.cache.CacheLoader; import com.google.common.cache.LoadingCache; /** * hadoop utils * single instance */ public class HadoopUtils implements Closeable {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,884
[Improvement][Common] a concatenation URL problem occurred when the address of the ACITVE ResourceManager in YARN HA mode failed to be obtained
**Describe the question** Acitve ReSourceManager IP = null when obtaining Acitve ReSourceManager address in YARN HA mode fails, the program will return splicing application url = http://null:8088/ws/v1/cluster/apps/%s **What are the current deficiencies and the benefits of improvement** The yarn application URL generation failed exception should be thrown here **Which version of DolphinScheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/4884
https://github.com/apache/dolphinscheduler/pull/4885
ea6b1de120cd438b7611b966d396164dec421cbb
c8e31ad58e15936174e773172d12337a8cf26d69
"2021-02-26T04:31:57Z"
java
"2021-03-11T14:14:52Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/HadoopUtils.java
private static final Logger logger = LoggerFactory.getLogger(HadoopUtils.class); private static String hdfsUser = PropertyUtils.getString(Constants.HDFS_ROOT_USER); public static final String resourceUploadPath = PropertyUtils.getString(RESOURCE_UPLOAD_PATH, "/dolphinscheduler"); public static final String rmHaIds = PropertyUtils.getString(Constants.YARN_RESOURCEMANAGER_HA_RM_IDS); public static final String appAddress = PropertyUtils.getString(Constants.YARN_APPLICATION_STATUS_ADDRESS); public static final String jobHistoryAddress = PropertyUtils.getString(Constants.YARN_JOB_HISTORY_STATUS_ADDRESS); private static final String HADOOP_UTILS_KEY = "HADOOP_UTILS_KEY"; private static final LoadingCache<String, HadoopUtils> cache = CacheBuilder .newBuilder() .expireAfterWrite(PropertyUtils.getInt(Constants.KERBEROS_EXPIRE_TIME, 2), TimeUnit.HOURS) .build(new CacheLoader<String, HadoopUtils>() { @Override public HadoopUtils load(String key) throws Exception { return new HadoopUtils(); } }); private static volatile boolean yarnEnabled = false; private Configuration configuration;
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,884
[Improvement][Common] a concatenation URL problem occurred when the address of the ACITVE ResourceManager in YARN HA mode failed to be obtained
**Describe the question** Acitve ReSourceManager IP = null when obtaining Acitve ReSourceManager address in YARN HA mode fails, the program will return splicing application url = http://null:8088/ws/v1/cluster/apps/%s **What are the current deficiencies and the benefits of improvement** The yarn application URL generation failed exception should be thrown here **Which version of DolphinScheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/4884
https://github.com/apache/dolphinscheduler/pull/4885
ea6b1de120cd438b7611b966d396164dec421cbb
c8e31ad58e15936174e773172d12337a8cf26d69
"2021-02-26T04:31:57Z"
java
"2021-03-11T14:14:52Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/HadoopUtils.java
private FileSystem fs; private HadoopUtils() { init(); initHdfsPath(); } public static HadoopUtils getInstance() { return cache.getUnchecked(HADOOP_UTILS_KEY); } /** * init dolphinscheduler root path in hdfs */ private void initHdfsPath() { Path path = new Path(resourceUploadPath); try { if (!fs.exists(path)) { fs.mkdirs(path); } } catch (Exception e) { logger.error(e.getMessage(), e); } } /** * init hadoop configuration */ private void init() { try { configuration = new HdfsConfiguration(); String resourceStorageType = PropertyUtils.getUpperCaseString(Constants.RESOURCE_STORAGE_TYPE); ResUploadType resUploadType = ResUploadType.valueOf(resourceStorageType); if (resUploadType == ResUploadType.HDFS) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,884
[Improvement][Common] a concatenation URL problem occurred when the address of the ACITVE ResourceManager in YARN HA mode failed to be obtained
**Describe the question** Acitve ReSourceManager IP = null when obtaining Acitve ReSourceManager address in YARN HA mode fails, the program will return splicing application url = http://null:8088/ws/v1/cluster/apps/%s **What are the current deficiencies and the benefits of improvement** The yarn application URL generation failed exception should be thrown here **Which version of DolphinScheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/4884
https://github.com/apache/dolphinscheduler/pull/4885
ea6b1de120cd438b7611b966d396164dec421cbb
c8e31ad58e15936174e773172d12337a8cf26d69
"2021-02-26T04:31:57Z"
java
"2021-03-11T14:14:52Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/HadoopUtils.java
if (PropertyUtils.getBoolean(Constants.HADOOP_SECURITY_AUTHENTICATION_STARTUP_STATE, false)) { System.setProperty(Constants.JAVA_SECURITY_KRB5_CONF, PropertyUtils.getString(Constants.JAVA_SECURITY_KRB5_CONF_PATH)); configuration.set(Constants.HADOOP_SECURITY_AUTHENTICATION, "kerberos"); hdfsUser = ""; UserGroupInformation.setConfiguration(configuration); UserGroupInformation.loginUserFromKeytab(PropertyUtils.getString(Constants.LOGIN_USER_KEY_TAB_USERNAME), PropertyUtils.getString(Constants.LOGIN_USER_KEY_TAB_PATH)); } String defaultFS = configuration.get(Constants.FS_DEFAULTFS); if (defaultFS.startsWith("file")) { String defaultFSProp = PropertyUtils.getString(Constants.FS_DEFAULTFS); if (StringUtils.isNotBlank(defaultFSProp)) { Map<String, String> fsRelatedProps = PropertyUtils.getPrefixedProperties("fs."); configuration.set(Constants.FS_DEFAULTFS, defaultFSProp); fsRelatedProps.forEach((key, value) -> configuration.set(key, value)); } else { logger.error("property:{} can not to be empty, please set!", Constants.FS_DEFAULTFS); throw new RuntimeException( String.format("property: %s can not to be empty, please set!", Constants.FS_DEFAULTFS) ); } } else { logger.info("get property:{} -> {}, from core-site.xml hdfs-site.xml ", Constants.FS_DEFAULTFS, defaultFS); } if (fs == null) { if (StringUtils.isNotEmpty(hdfsUser)) { UserGroupInformation ugi = UserGroupInformation.createRemoteUser(hdfsUser);
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,884
[Improvement][Common] a concatenation URL problem occurred when the address of the ACITVE ResourceManager in YARN HA mode failed to be obtained
**Describe the question** Acitve ReSourceManager IP = null when obtaining Acitve ReSourceManager address in YARN HA mode fails, the program will return splicing application url = http://null:8088/ws/v1/cluster/apps/%s **What are the current deficiencies and the benefits of improvement** The yarn application URL generation failed exception should be thrown here **Which version of DolphinScheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/4884
https://github.com/apache/dolphinscheduler/pull/4885
ea6b1de120cd438b7611b966d396164dec421cbb
c8e31ad58e15936174e773172d12337a8cf26d69
"2021-02-26T04:31:57Z"
java
"2021-03-11T14:14:52Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/HadoopUtils.java
ugi.doAs(new PrivilegedExceptionAction<Boolean>() { @Override public Boolean run() throws Exception { fs = FileSystem.get(configuration); return true; } }); } else { logger.warn("hdfs.root.user is not set value!"); fs = FileSystem.get(configuration); } } } else if (resUploadType == ResUploadType.S3) { System.setProperty(Constants.AWS_S3_V4, Constants.STRING_TRUE); configuration.set(Constants.FS_DEFAULTFS, PropertyUtils.getString(Constants.FS_DEFAULTFS)); configuration.set(Constants.FS_S3A_ENDPOINT, PropertyUtils.getString(Constants.FS_S3A_ENDPOINT)); configuration.set(Constants.FS_S3A_ACCESS_KEY, PropertyUtils.getString(Constants.FS_S3A_ACCESS_KEY)); configuration.set(Constants.FS_S3A_SECRET_KEY, PropertyUtils.getString(Constants.FS_S3A_SECRET_KEY)); fs = FileSystem.get(configuration); } } catch (Exception e) { logger.error(e.getMessage(), e); } } /** * @return Configuration */ public Configuration getConfiguration() { return configuration; }
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,884
[Improvement][Common] a concatenation URL problem occurred when the address of the ACITVE ResourceManager in YARN HA mode failed to be obtained
**Describe the question** Acitve ReSourceManager IP = null when obtaining Acitve ReSourceManager address in YARN HA mode fails, the program will return splicing application url = http://null:8088/ws/v1/cluster/apps/%s **What are the current deficiencies and the benefits of improvement** The yarn application URL generation failed exception should be thrown here **Which version of DolphinScheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/4884
https://github.com/apache/dolphinscheduler/pull/4885
ea6b1de120cd438b7611b966d396164dec421cbb
c8e31ad58e15936174e773172d12337a8cf26d69
"2021-02-26T04:31:57Z"
java
"2021-03-11T14:14:52Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/HadoopUtils.java
/** * get application url * * @param applicationId application id * @return url of application */ public String getApplicationUrl(String applicationId) throws Exception { /** * if rmHaIds contains xx, it signs not use resourcemanager * otherwise: * if rmHaIds is empty, single resourcemanager enabled * if rmHaIds not empty: resourcemanager HA enabled */ String appUrl = ""; if (StringUtils.isEmpty(rmHaIds)) { appUrl = appAddress; yarnEnabled = true; } else { appUrl = getAppAddress(appAddress, rmHaIds); yarnEnabled = true; logger.info("application url : {}", appUrl); } if (StringUtils.isBlank(appUrl)) { throw new Exception("application url is blank"); } return String.format(appUrl, applicationId); } public String getJobHistoryUrl(String applicationId) {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,884
[Improvement][Common] a concatenation URL problem occurred when the address of the ACITVE ResourceManager in YARN HA mode failed to be obtained
**Describe the question** Acitve ReSourceManager IP = null when obtaining Acitve ReSourceManager address in YARN HA mode fails, the program will return splicing application url = http://null:8088/ws/v1/cluster/apps/%s **What are the current deficiencies and the benefits of improvement** The yarn application URL generation failed exception should be thrown here **Which version of DolphinScheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/4884
https://github.com/apache/dolphinscheduler/pull/4885
ea6b1de120cd438b7611b966d396164dec421cbb
c8e31ad58e15936174e773172d12337a8cf26d69
"2021-02-26T04:31:57Z"
java
"2021-03-11T14:14:52Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/HadoopUtils.java
String jobId = applicationId.replace("application", "job"); return String.format(jobHistoryAddress, jobId); } /** * cat file on hdfs * * @param hdfsFilePath hdfs file path * @return byte[] byte array * @throws IOException errors */ public byte[] catFile(String hdfsFilePath) throws IOException { if (StringUtils.isBlank(hdfsFilePath)) { logger.error("hdfs file path:{} is blank", hdfsFilePath); return new byte[0]; } try (FSDataInputStream fsDataInputStream = fs.open(new Path(hdfsFilePath))) { return IOUtils.toByteArray(fsDataInputStream); } } /** * cat file on hdfs * * @param hdfsFilePath hdfs file path * @param skipLineNums skip line numbers * @param limit read how many lines * @return content of file * @throws IOException errors */ public List<String> catFile(String hdfsFilePath, int skipLineNums, int limit) throws IOException {
closed
apache/dolphinscheduler
https://github.com/apache/dolphinscheduler
4,884
[Improvement][Common] a concatenation URL problem occurred when the address of the ACITVE ResourceManager in YARN HA mode failed to be obtained
**Describe the question** Acitve ReSourceManager IP = null when obtaining Acitve ReSourceManager address in YARN HA mode fails, the program will return splicing application url = http://null:8088/ws/v1/cluster/apps/%s **What are the current deficiencies and the benefits of improvement** The yarn application URL generation failed exception should be thrown here **Which version of DolphinScheduler:** -[dev]
https://github.com/apache/dolphinscheduler/issues/4884
https://github.com/apache/dolphinscheduler/pull/4885
ea6b1de120cd438b7611b966d396164dec421cbb
c8e31ad58e15936174e773172d12337a8cf26d69
"2021-02-26T04:31:57Z"
java
"2021-03-11T14:14:52Z"
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/HadoopUtils.java
if (StringUtils.isBlank(hdfsFilePath)) { logger.error("hdfs file path:{} is blank", hdfsFilePath); return Collections.emptyList(); } try (FSDataInputStream in = fs.open(new Path(hdfsFilePath))) { BufferedReader br = new BufferedReader(new InputStreamReader(in, StandardCharsets.UTF_8)); Stream<String> stream = br.lines().skip(skipLineNums).limit(limit); return stream.collect(Collectors.toList()); } } /** * make the given file and all non-existent parents into * directories. Has the semantics of Unix 'mkdir -p'. * Existence of the directory hierarchy is not an error. * * @param hdfsPath path to create * @return mkdir result * @throws IOException errors */ public boolean mkdir(String hdfsPath) throws IOException { return fs.mkdirs(new Path(hdfsPath)); } /** * copy files between FileSystems * * @param srcPath source hdfs path * @param dstPath destination hdfs path * @param deleteSource whether to delete the src * @param overwrite whether to overwrite an existing file * @return if success or not