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 | 2,735 | [BUG]The IP and process pid of the master and worker in the monitoring center are not displayed |


**Which version of Dolphin Scheduler:**
-[dev_1.3.0]
| https://github.com/apache/dolphinscheduler/issues/2735 | https://github.com/apache/dolphinscheduler/pull/2770 | 3d857bba925348f4b92b9ba857c37fbca28549dd | 396b1716e4e9b0f55f3686ba8e0283555c65c085 | "2020-05-18T06:14:37Z" | java | "2020-05-22T03:20:54Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java | public static final String SPRING_DATASOURCE_MAX_POOL_PREPARED_STATEMENT_PER_CONNECTION_SIZE = "spring.datasource.maxPoolPreparedStatementPerConnectionSize";
public static final String DEVELOPMENT = "development";
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 = 9;
/**
* hadoop params constant
*/
/**
* 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"; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,735 | [BUG]The IP and process pid of the master and worker in the monitoring center are not displayed |


**Which version of Dolphin Scheduler:**
-[dev_1.3.0]
| https://github.com/apache/dolphinscheduler/issues/2735 | https://github.com/apache/dolphinscheduler/pull/2770 | 3d857bba925348f4b92b9ba857c37fbca28549dd | 396b1716e4e9b0f55f3686ba8e0283555c65c085 | "2020-05-18T06:14:37Z" | java | "2020-05-22T03:20:54Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java | /**
* spark params constant
*/
public static final String MASTER = "--master";
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";
/** |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,735 | [BUG]The IP and process pid of the master and worker in the monitoring center are not displayed |


**Which version of Dolphin Scheduler:**
-[dev_1.3.0]
| https://github.com/apache/dolphinscheduler/issues/2735 | https://github.com/apache/dolphinscheduler/pull/2770 | 3d857bba925348f4b92b9ba857c37fbca28549dd | 396b1716e4e9b0f55f3686ba8e0283555c65c085 | "2020-05-18T06:14:37Z" | java | "2020-05-22T03:20:54Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java | * --queue QUEUE
*/
public static final String SPARK_QUEUE = "--queue";
/**
* --queue --qu
*/
public static final String FLINK_QUEUE = "--qu";
/**
* 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)
*/ |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,735 | [BUG]The IP and process pid of the master and worker in the monitoring center are not displayed |


**Which version of Dolphin Scheduler:**
-[dev_1.3.0]
| https://github.com/apache/dolphinscheduler/issues/2735 | https://github.com/apache/dolphinscheduler/pull/2770 | 3d857bba925348f4b92b9ba857c37fbca28549dd | 396b1716e4e9b0f55f3686ba8e0283555c65c085 | "2020-05-18T06:14:37Z" | java | "2020-05-22T03:20:54Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java | 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
*/
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";
/** |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,735 | [BUG]The IP and process pid of the master and worker in the monitoring center are not displayed |


**Which version of Dolphin Scheduler:**
-[dev_1.3.0]
| https://github.com/apache/dolphinscheduler/issues/2735 | https://github.com/apache/dolphinscheduler/pull/2770 | 3d857bba925348f4b92b9ba857c37fbca28549dd | 396b1716e4e9b0f55f3686ba8e0283555c65c085 | "2020-05-18T06:14:37Z" | java | "2020-05-22T03:20:54Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java | * FAILED
*/
public static final String FAILED = "FAILED";
/**
* KILLED
*/
public static final String KILLED = "KILLED";
/**
* 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
*/ |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,735 | [BUG]The IP and process pid of the master and worker in the monitoring center are not displayed |


**Which version of Dolphin Scheduler:**
-[dev_1.3.0]
| https://github.com/apache/dolphinscheduler/issues/2735 | https://github.com/apache/dolphinscheduler/pull/2770 | 3d857bba925348f4b92b9ba857c37fbca28549dd | 396b1716e4e9b0f55f3686ba8e0283555c65c085 | "2020-05-18T06:14:37Z" | java | "2020-05-22T03:20:54Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java | public static final String SCHEDULE_ID = "scheduleId";
/**
* schedule
*/
public static final String SCHEDULE = "schedule";
/**
* application regex
*/
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"; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,735 | [BUG]The IP and process pid of the master and worker in the monitoring center are not displayed |


**Which version of Dolphin Scheduler:**
-[dev_1.3.0]
| https://github.com/apache/dolphinscheduler/issues/2735 | https://github.com/apache/dolphinscheduler/pull/2770 | 3d857bba925348f4b92b9ba857c37fbca28549dd | 396b1716e4e9b0f55f3686ba8e0283555c65c085 | "2020-05-18T06:14:37Z" | java | "2020-05-22T03:20:54Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java | /**
* 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 = '/';
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 PROCESS_INSTANCE_STATE = "processInstanceState";
public static final String TASK_LIST = "taskList";
public static final String RWXR_XR_X = "rwxr-xr-x";
/**
* 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 | 2,735 | [BUG]The IP and process pid of the master and worker in the monitoring center are not displayed |


**Which version of Dolphin Scheduler:**
-[dev_1.3.0]
| https://github.com/apache/dolphinscheduler/issues/2735 | https://github.com/apache/dolphinscheduler/pull/2770 | 3d857bba925348f4b92b9ba857c37fbca28549dd | 396b1716e4e9b0f55f3686ba8e0283555c65c085 | "2020-05-18T06:14:37Z" | java | "2020-05-22T03:20:54Z" | 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 | 2,735 | [BUG]The IP and process pid of the master and worker in the monitoring center are not displayed |


**Which version of Dolphin Scheduler:**
-[dev_1.3.0]
| https://github.com/apache/dolphinscheduler/issues/2735 | https://github.com/apache/dolphinscheduler/pull/2770 | 3d857bba925348f4b92b9ba857c37fbca28549dd | 396b1716e4e9b0f55f3686ba8e0283555c65c085 | "2020-05-18T06:14:37Z" | java | "2020-05-22T03:20:54Z" | 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";
/**
* 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:";
public static final String FLINK_YARN_CLUSTER = "yarn-cluster";
public static final String FLINK_RUN_MODE = "-m";
public static final String FLINK_YARN_SLOT = "-ys";
public static final String FLINK_APP_NAME = "-ynm";
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_DETACH = "-d"; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,735 | [BUG]The IP and process pid of the master and worker in the monitoring center are not displayed |


**Which version of Dolphin Scheduler:**
-[dev_1.3.0]
| https://github.com/apache/dolphinscheduler/issues/2735 | https://github.com/apache/dolphinscheduler/pull/2770 | 3d857bba925348f4b92b9ba857c37fbca28549dd | 396b1716e4e9b0f55f3686ba8e0283555c65c085 | "2020-05-18T06:14:37Z" | java | "2020-05-22T03:20:54Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java | public static final String FLINK_MAIN_CLASS = "-c";
public static final int[] NOT_TERMINATED_STATES = new int[]{
ExecutionStatus.SUBMITTED_SUCCESS.ordinal(),
ExecutionStatus.RUNNING_EXEUTION.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
*/
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"; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,735 | [BUG]The IP and process pid of the master and worker in the monitoring center are not displayed |


**Which version of Dolphin Scheduler:**
-[dev_1.3.0]
| https://github.com/apache/dolphinscheduler/issues/2735 | https://github.com/apache/dolphinscheduler/pull/2770 | 3d857bba925348f4b92b9ba857c37fbca28549dd | 396b1716e4e9b0f55f3686ba8e0283555c65c085 | "2020-05-18T06:14:37Z" | java | "2020-05-22T03:20:54Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java | /**
*
*/
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";
/**
* session user
*/
public static final String SESSION_USER = "session.user";
public static final String SESSION_ID = "sessionId";
public static final String PASSWORD_DEFAULT = "******";
/**
* 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";
/**
* database type
*/
public static final String MYSQL = "MYSQL";
public static final String POSTGRESQL = "POSTGRESQL";
public static final String HIVE = "HIVE"; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,735 | [BUG]The IP and process pid of the master and worker in the monitoring center are not displayed |


**Which version of Dolphin Scheduler:**
-[dev_1.3.0]
| https://github.com/apache/dolphinscheduler/issues/2735 | https://github.com/apache/dolphinscheduler/pull/2770 | 3d857bba925348f4b92b9ba857c37fbca28549dd | 396b1716e4e9b0f55f3686ba8e0283555c65c085 | "2020-05-18T06:14:37Z" | java | "2020-05-22T03:20:54Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java | 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";
/**
* jdbc url
*/
public static final String JDBC_MYSQL = "jdbc:mysql://";
public static final String JDBC_POSTGRESQL = "jdbc:postgresql://";
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 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";
/**
* 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"; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,735 | [BUG]The IP and process pid of the master and worker in the monitoring center are not displayed |


**Which version of Dolphin Scheduler:**
-[dev_1.3.0]
| https://github.com/apache/dolphinscheduler/issues/2735 | https://github.com/apache/dolphinscheduler/pull/2770 | 3d857bba925348f4b92b9ba857c37fbca28549dd | 396b1716e4e9b0f55f3686ba8e0283555c65c085 | "2020-05-18T06:14:37Z" | java | "2020-05-22T03:20:54Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/Constants.java | /**
* dataSource sensitive param
*/
public static final String DATASOURCE_PASSWORD_REGEX = "(?<=(\"password\":\")).*?(?=(\"))";
/**
* 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 NORAML_NODE_STATUS = 0;
public static final int ABNORMAL_NODE_STATUS = 1;
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,735 | [BUG]The IP and process pid of the master and worker in the monitoring center are not displayed |


**Which version of Dolphin Scheduler:**
-[dev_1.3.0]
| https://github.com/apache/dolphinscheduler/issues/2735 | https://github.com/apache/dolphinscheduler/pull/2770 | 3d857bba925348f4b92b9ba857c37fbca28549dd | 396b1716e4e9b0f55f3686ba8e0283555c65c085 | "2020-05-18T06:14:37Z" | java | "2020-05-22T03:20:54Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/ResInfo.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 org.apache.dolphinscheduler.common.model.Server;
import java.util.Date;
/**
* heartbeat for ZK reigster res info
*/
public class ResInfo { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,735 | [BUG]The IP and process pid of the master and worker in the monitoring center are not displayed |


**Which version of Dolphin Scheduler:**
-[dev_1.3.0]
| https://github.com/apache/dolphinscheduler/issues/2735 | https://github.com/apache/dolphinscheduler/pull/2770 | 3d857bba925348f4b92b9ba857c37fbca28549dd | 396b1716e4e9b0f55f3686ba8e0283555c65c085 | "2020-05-18T06:14:37Z" | java | "2020-05-22T03:20:54Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/ResInfo.java | /**
* cpuUsage
*/
private double cpuUsage;
/**
* memoryUsage
*/
private double memoryUsage;
/**
* loadAverage
*/
private double loadAverage;
public ResInfo(){} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,735 | [BUG]The IP and process pid of the master and worker in the monitoring center are not displayed |


**Which version of Dolphin Scheduler:**
-[dev_1.3.0]
| https://github.com/apache/dolphinscheduler/issues/2735 | https://github.com/apache/dolphinscheduler/pull/2770 | 3d857bba925348f4b92b9ba857c37fbca28549dd | 396b1716e4e9b0f55f3686ba8e0283555c65c085 | "2020-05-18T06:14:37Z" | java | "2020-05-22T03:20:54Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/ResInfo.java | public ResInfo(double cpuUsage , double memoryUsage){
this.cpuUsage = cpuUsage ;
this.memoryUsage = memoryUsage;
}
public ResInfo(double cpuUsage, double memoryUsage, double loadAverage) {
this(cpuUsage,memoryUsage);
this.loadAverage = loadAverage;
}
public double getCpuUsage() {
return cpuUsage;
}
public void setCpuUsage(double cpuUsage) {
this.cpuUsage = cpuUsage;
}
public double getMemoryUsage() {
return memoryUsage;
}
public void setMemoryUsage(double memoryUsage) {
this.memoryUsage = memoryUsage;
}
public double getLoadAverage() {
return loadAverage;
}
public void setLoadAverage(double loadAverage) {
this.loadAverage = loadAverage;
}
/**
* get CPU and memory usage
* @param cpuUsage cpu usage
* @param memoryUsage memory usage |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,735 | [BUG]The IP and process pid of the master and worker in the monitoring center are not displayed |


**Which version of Dolphin Scheduler:**
-[dev_1.3.0]
| https://github.com/apache/dolphinscheduler/issues/2735 | https://github.com/apache/dolphinscheduler/pull/2770 | 3d857bba925348f4b92b9ba857c37fbca28549dd | 396b1716e4e9b0f55f3686ba8e0283555c65c085 | "2020-05-18T06:14:37Z" | java | "2020-05-22T03:20:54Z" | dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/ResInfo.java | * @param loadAverage load average
* @return cpu and memory usage
*/
public static String getResInfoJson(double cpuUsage , double memoryUsage,double loadAverage){
ResInfo resInfo = new ResInfo(cpuUsage,memoryUsage,loadAverage);
return JSONUtils.toJson(resInfo);
}
/**
* parse heartbeat info for zk
* @param heartBeatInfo heartbeat info
* @return heartbeat info to Server
*/
public static Server parseHeartbeatForZKInfo(String heartBeatInfo){
if (StringUtils.isEmpty(heartBeatInfo)) {
return null;
}
String[] masterArray = heartBeatInfo.split(Constants.COMMA);
if(masterArray.length != Constants.HEARTBEAT_FOR_ZOOKEEPER_INFO_LENGTH){
return null;
}
Server masterServer = new Server();
masterServer.setResInfo(getResInfoJson(Double.parseDouble(masterArray[0]),
Double.parseDouble(masterArray[1]),
Double.parseDouble(masterArray[2])));
masterServer.setCreateTime(DateUtils.stringToDate(masterArray[6]));
masterServer.setLastHeartbeatTime(DateUtils.stringToDate(masterArray[7]));
return masterServer;
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,735 | [BUG]The IP and process pid of the master and worker in the monitoring center are not displayed |


**Which version of Dolphin Scheduler:**
-[dev_1.3.0]
| https://github.com/apache/dolphinscheduler/issues/2735 | https://github.com/apache/dolphinscheduler/pull/2770 | 3d857bba925348f4b92b9ba857c37fbca28549dd | 396b1716e4e9b0f55f3686ba8e0283555c65c085 | "2020-05-18T06:14:37Z" | java | "2020-05-22T03:20:54Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/registry/MasterRegistry.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 | 2,735 | [BUG]The IP and process pid of the master and worker in the monitoring center are not displayed |


**Which version of Dolphin Scheduler:**
-[dev_1.3.0]
| https://github.com/apache/dolphinscheduler/issues/2735 | https://github.com/apache/dolphinscheduler/pull/2770 | 3d857bba925348f4b92b9ba857c37fbca28549dd | 396b1716e4e9b0f55f3686ba8e0283555c65c085 | "2020-05-18T06:14:37Z" | java | "2020-05-22T03:20:54Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/registry/MasterRegistry.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.master.registry;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.state.ConnectionState;
import org.apache.curator.framework.state.ConnectionStateListener;
import org.apache.dolphinscheduler.common.utils.DateUtils;
import org.apache.dolphinscheduler.common.utils.OSUtils;
import org.apache.dolphinscheduler.remote.utils.NamedThreadFactory;
import org.apache.dolphinscheduler.server.master.config.MasterConfig;
import org.apache.dolphinscheduler.server.registry.HeartBeatTask;
import org.apache.dolphinscheduler.server.registry.ZookeeperRegistryCenter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
import java.util.Date;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import static org.apache.dolphinscheduler.remote.utils.Constants.COMMA;
/**
* master registry
*/
@Service |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,735 | [BUG]The IP and process pid of the master and worker in the monitoring center are not displayed |


**Which version of Dolphin Scheduler:**
-[dev_1.3.0]
| https://github.com/apache/dolphinscheduler/issues/2735 | https://github.com/apache/dolphinscheduler/pull/2770 | 3d857bba925348f4b92b9ba857c37fbca28549dd | 396b1716e4e9b0f55f3686ba8e0283555c65c085 | "2020-05-18T06:14:37Z" | java | "2020-05-22T03:20:54Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/registry/MasterRegistry.java | public class MasterRegistry {
private final Logger logger = LoggerFactory.getLogger(MasterRegistry.class);
/**
* zookeeper registry center
*/
@Autowired
private ZookeeperRegistryCenter zookeeperRegistryCenter;
/**
* master config
*/
@Autowired
private MasterConfig masterConfig;
/**
* heartbeat executor
*/
private ScheduledExecutorService heartBeatExecutor;
/**
* worker start time
*/
private String startTime;
@PostConstruct |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,735 | [BUG]The IP and process pid of the master and worker in the monitoring center are not displayed |


**Which version of Dolphin Scheduler:**
-[dev_1.3.0]
| https://github.com/apache/dolphinscheduler/issues/2735 | https://github.com/apache/dolphinscheduler/pull/2770 | 3d857bba925348f4b92b9ba857c37fbca28549dd | 396b1716e4e9b0f55f3686ba8e0283555c65c085 | "2020-05-18T06:14:37Z" | java | "2020-05-22T03:20:54Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/registry/MasterRegistry.java | public void init(){
this.startTime = DateUtils.dateToString(new Date());
this.heartBeatExecutor = Executors.newSingleThreadScheduledExecutor(new NamedThreadFactory("HeartBeatExecutor"));
}
/**
* registry
*/
public void registry() {
String address = OSUtils.getHost();
String localNodePath = getMasterPath();
zookeeperRegistryCenter.getZookeeperCachedOperator().persistEphemeral(localNodePath, "");
zookeeperRegistryCenter.getZookeeperCachedOperator().getZkClient().getConnectionStateListenable().addListener(new ConnectionStateListener() {
@Override
public void stateChanged(CuratorFramework client, ConnectionState newState) {
if(newState == ConnectionState.LOST){
logger.error("master : {} connection lost from zookeeper", address);
} else if(newState == ConnectionState.RECONNECTED){
logger.info("master : {} reconnected to zookeeper", address);
zookeeperRegistryCenter.getZookeeperCachedOperator().persistEphemeral(localNodePath, "");
} else if(newState == ConnectionState.SUSPENDED){
logger.warn("master : {} connection SUSPENDED ", address);
}
}
});
int masterHeartbeatInterval = masterConfig.getMasterHeartbeatInterval();
HeartBeatTask heartBeatTask = new HeartBeatTask(startTime,
masterConfig.getMasterReservedMemory(),
masterConfig.getMasterMaxCpuloadAvg(),
getMasterPath(),
zookeeperRegistryCenter); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,735 | [BUG]The IP and process pid of the master and worker in the monitoring center are not displayed |


**Which version of Dolphin Scheduler:**
-[dev_1.3.0]
| https://github.com/apache/dolphinscheduler/issues/2735 | https://github.com/apache/dolphinscheduler/pull/2770 | 3d857bba925348f4b92b9ba857c37fbca28549dd | 396b1716e4e9b0f55f3686ba8e0283555c65c085 | "2020-05-18T06:14:37Z" | java | "2020-05-22T03:20:54Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/registry/MasterRegistry.java | this.heartBeatExecutor.scheduleAtFixedRate(heartBeatTask, masterHeartbeatInterval, masterHeartbeatInterval, TimeUnit.SECONDS);
logger.info("master node : {} registry to ZK successfully with heartBeatInterval : {}s", address, masterHeartbeatInterval);
}
/**
* remove registry info
*/
public void unRegistry() {
String address = getLocalAddress();
String localNodePath = getMasterPath();
zookeeperRegistryCenter.getZookeeperCachedOperator().remove(localNodePath);
logger.info("master node : {} unRegistry to ZK.", address);
}
/**
* get master path
* @return
*/
private String getMasterPath() {
String address = getLocalAddress();
String localNodePath = this.zookeeperRegistryCenter.getMasterPath() + "/" + address;
return localNodePath;
}
/**
* get local address
* @return
*/
private String getLocalAddress(){
return OSUtils.getHost() + ":" + masterConfig.getListenPort();
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,735 | [BUG]The IP and process pid of the master and worker in the monitoring center are not displayed |


**Which version of Dolphin Scheduler:**
-[dev_1.3.0]
| https://github.com/apache/dolphinscheduler/issues/2735 | https://github.com/apache/dolphinscheduler/pull/2770 | 3d857bba925348f4b92b9ba857c37fbca28549dd | 396b1716e4e9b0f55f3686ba8e0283555c65c085 | "2020-05-18T06:14:37Z" | java | "2020-05-22T03:20:54Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/registry/HeartBeatTask.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.registry;
import org.apache.dolphinscheduler.common.Constants;
import org.apache.dolphinscheduler.common.utils.DateUtils;
import org.apache.dolphinscheduler.common.utils.OSUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Date;
import static org.apache.dolphinscheduler.remote.utils.Constants.COMMA;
public class HeartBeatTask extends Thread{ |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,735 | [BUG]The IP and process pid of the master and worker in the monitoring center are not displayed |


**Which version of Dolphin Scheduler:**
-[dev_1.3.0]
| https://github.com/apache/dolphinscheduler/issues/2735 | https://github.com/apache/dolphinscheduler/pull/2770 | 3d857bba925348f4b92b9ba857c37fbca28549dd | 396b1716e4e9b0f55f3686ba8e0283555c65c085 | "2020-05-18T06:14:37Z" | java | "2020-05-22T03:20:54Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/registry/HeartBeatTask.java | private final Logger logger = LoggerFactory.getLogger(HeartBeatTask.class);
private String startTime;
private double reservedMemory;
private double maxCpuloadAvg;
private String heartBeatPath;
private ZookeeperRegistryCenter zookeeperRegistryCenter;
public HeartBeatTask(String startTime,
double reservedMemory,
double maxCpuloadAvg,
String heartBeatPath,
ZookeeperRegistryCenter zookeeperRegistryCenter){
this.startTime = startTime;
this.reservedMemory = reservedMemory;
this.maxCpuloadAvg = maxCpuloadAvg;
this.heartBeatPath = heartBeatPath; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,735 | [BUG]The IP and process pid of the master and worker in the monitoring center are not displayed |


**Which version of Dolphin Scheduler:**
-[dev_1.3.0]
| https://github.com/apache/dolphinscheduler/issues/2735 | https://github.com/apache/dolphinscheduler/pull/2770 | 3d857bba925348f4b92b9ba857c37fbca28549dd | 396b1716e4e9b0f55f3686ba8e0283555c65c085 | "2020-05-18T06:14:37Z" | java | "2020-05-22T03:20:54Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/registry/HeartBeatTask.java | this.zookeeperRegistryCenter = zookeeperRegistryCenter;
}
@Override
public void run() {
try {
double availablePhysicalMemorySize = OSUtils.availablePhysicalMemorySize();
double loadAverage = OSUtils.loadAverage();
int status = Constants.NORAML_NODE_STATUS;
if(availablePhysicalMemorySize < reservedMemory
|| loadAverage > maxCpuloadAvg){
logger.warn("load is too high or availablePhysicalMemorySize(G) is too low, it's availablePhysicalMemorySize(G):{},loadAvg:{}", availablePhysicalMemorySize , loadAverage);
status = Constants.ABNORMAL_NODE_STATUS;
}
StringBuilder builder = new StringBuilder(100);
builder.append(OSUtils.cpuUsage()).append(COMMA);
builder.append(OSUtils.memoryUsage()).append(COMMA);
builder.append(OSUtils.loadAverage()).append(COMMA);
builder.append(OSUtils.availablePhysicalMemorySize()).append(Constants.COMMA);
builder.append(maxCpuloadAvg).append(Constants.COMMA);
builder.append(reservedMemory).append(Constants.COMMA);
builder.append(startTime).append(Constants.COMMA);
builder.append(DateUtils.dateToString(new Date())).append(Constants.COMMA);
builder.append(status);
zookeeperRegistryCenter.getZookeeperCachedOperator().update(heartBeatPath, builder.toString());
} catch (Throwable ex){
logger.error("error write heartbeat info", ex);
}
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,735 | [BUG]The IP and process pid of the master and worker in the monitoring center are not displayed |


**Which version of Dolphin Scheduler:**
-[dev_1.3.0]
| https://github.com/apache/dolphinscheduler/issues/2735 | https://github.com/apache/dolphinscheduler/pull/2770 | 3d857bba925348f4b92b9ba857c37fbca28549dd | 396b1716e4e9b0f55f3686ba8e0283555c65c085 | "2020-05-18T06:14:37Z" | java | "2020-05-22T03:20:54Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/registry/WorkerRegistry.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. |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,735 | [BUG]The IP and process pid of the master and worker in the monitoring center are not displayed |


**Which version of Dolphin Scheduler:**
-[dev_1.3.0]
| https://github.com/apache/dolphinscheduler/issues/2735 | https://github.com/apache/dolphinscheduler/pull/2770 | 3d857bba925348f4b92b9ba857c37fbca28549dd | 396b1716e4e9b0f55f3686ba8e0283555c65c085 | "2020-05-18T06:14:37Z" | java | "2020-05-22T03:20:54Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/registry/WorkerRegistry.java | */
package org.apache.dolphinscheduler.server.worker.registry;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.state.ConnectionState;
import org.apache.curator.framework.state.ConnectionStateListener;
import org.apache.dolphinscheduler.common.utils.DateUtils;
import org.apache.dolphinscheduler.common.utils.OSUtils;
import org.apache.dolphinscheduler.common.utils.StringUtils;
import org.apache.dolphinscheduler.remote.utils.NamedThreadFactory;
import org.apache.dolphinscheduler.server.registry.HeartBeatTask;
import org.apache.dolphinscheduler.server.registry.ZookeeperRegistryCenter;
import org.apache.dolphinscheduler.server.worker.config.WorkerConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
import java.util.Date;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import static org.apache.dolphinscheduler.common.Constants.COMMA;
import static org.apache.dolphinscheduler.common.Constants.DEFAULT_WORKER_GROUP;
import static org.apache.dolphinscheduler.common.Constants.SLASH;
/**
* worker registry
*/
@Service
public class WorkerRegistry {
private final Logger logger = LoggerFactory.getLogger(WorkerRegistry.class); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,735 | [BUG]The IP and process pid of the master and worker in the monitoring center are not displayed |


**Which version of Dolphin Scheduler:**
-[dev_1.3.0]
| https://github.com/apache/dolphinscheduler/issues/2735 | https://github.com/apache/dolphinscheduler/pull/2770 | 3d857bba925348f4b92b9ba857c37fbca28549dd | 396b1716e4e9b0f55f3686ba8e0283555c65c085 | "2020-05-18T06:14:37Z" | java | "2020-05-22T03:20:54Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/registry/WorkerRegistry.java | /**
* zookeeper registry center
*/
@Autowired
private ZookeeperRegistryCenter zookeeperRegistryCenter;
/**
* worker config
*/
@Autowired
private WorkerConfig workerConfig;
/**
* heartbeat executor
*/
private ScheduledExecutorService heartBeatExecutor;
/**
* worker start time
*/
private String startTime;
private String workerGroup;
@PostConstruct
public void init(){
this.workerGroup = workerConfig.getWorkerGroup();
this.startTime = DateUtils.dateToString(new Date());
this.heartBeatExecutor = Executors.newSingleThreadScheduledExecutor(new NamedThreadFactory("HeartBeatExecutor"));
}
/**
* registry
*/
public void registry() {
String address = OSUtils.getHost(); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,735 | [BUG]The IP and process pid of the master and worker in the monitoring center are not displayed |


**Which version of Dolphin Scheduler:**
-[dev_1.3.0]
| https://github.com/apache/dolphinscheduler/issues/2735 | https://github.com/apache/dolphinscheduler/pull/2770 | 3d857bba925348f4b92b9ba857c37fbca28549dd | 396b1716e4e9b0f55f3686ba8e0283555c65c085 | "2020-05-18T06:14:37Z" | java | "2020-05-22T03:20:54Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/registry/WorkerRegistry.java | String localNodePath = getWorkerPath();
zookeeperRegistryCenter.getZookeeperCachedOperator().persistEphemeral(localNodePath, "");
zookeeperRegistryCenter.getZookeeperCachedOperator().getZkClient().getConnectionStateListenable().addListener(new ConnectionStateListener() {
@Override
public void stateChanged(CuratorFramework client, ConnectionState newState) {
if(newState == ConnectionState.LOST){
logger.error("worker : {} connection lost from zookeeper", address);
} else if(newState == ConnectionState.RECONNECTED){
logger.info("worker : {} reconnected to zookeeper", address);
zookeeperRegistryCenter.getZookeeperCachedOperator().persistEphemeral(localNodePath, "");
} else if(newState == ConnectionState.SUSPENDED){
logger.warn("worker : {} connection SUSPENDED ", address);
}
}
});
int workerHeartbeatInterval = workerConfig.getWorkerHeartbeatInterval();
HeartBeatTask heartBeatTask = new HeartBeatTask(startTime,
workerConfig.getWorkerReservedMemory(),
workerConfig.getWorkerMaxCpuloadAvg(),
getWorkerPath(),
zookeeperRegistryCenter);
this.heartBeatExecutor.scheduleAtFixedRate(heartBeatTask, workerHeartbeatInterval, workerHeartbeatInterval, TimeUnit.SECONDS);
logger.info("worker node : {} registry to ZK successfully with heartBeatInterval : {}s", address, workerHeartbeatInterval);
}
/**
* remove registry info
*/
public void unRegistry() {
String address = getLocalAddress();
String localNodePath = getWorkerPath(); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,735 | [BUG]The IP and process pid of the master and worker in the monitoring center are not displayed |


**Which version of Dolphin Scheduler:**
-[dev_1.3.0]
| https://github.com/apache/dolphinscheduler/issues/2735 | https://github.com/apache/dolphinscheduler/pull/2770 | 3d857bba925348f4b92b9ba857c37fbca28549dd | 396b1716e4e9b0f55f3686ba8e0283555c65c085 | "2020-05-18T06:14:37Z" | java | "2020-05-22T03:20:54Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/registry/WorkerRegistry.java | zookeeperRegistryCenter.getZookeeperCachedOperator().remove(localNodePath);
this.heartBeatExecutor.shutdownNow();
logger.info("worker node : {} unRegistry to ZK.", address);
}
/**
* get worker path
* @return
*/
private String getWorkerPath() {
String address = getLocalAddress();
StringBuilder builder = new StringBuilder(100);
String workerPath = this.zookeeperRegistryCenter.getWorkerPath();
builder.append(workerPath).append(SLASH);
if(StringUtils.isEmpty(workerGroup)){
workerGroup = DEFAULT_WORKER_GROUP;
}
builder.append(workerGroup.trim().toLowerCase()).append(SLASH);
builder.append(address);
return builder.toString();
}
/**
* get local address
* @return
*/
private String getLocalAddress(){
return OSUtils.getHost() + ":" + workerConfig.getListenPort();
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,735 | [BUG]The IP and process pid of the master and worker in the monitoring center are not displayed |


**Which version of Dolphin Scheduler:**
-[dev_1.3.0]
| https://github.com/apache/dolphinscheduler/issues/2735 | https://github.com/apache/dolphinscheduler/pull/2770 | 3d857bba925348f4b92b9ba857c37fbca28549dd | 396b1716e4e9b0f55f3686ba8e0283555c65c085 | "2020-05-18T06:14:37Z" | java | "2020-05-22T03:20:54Z" | dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/zk/AbstractZKClient.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.zk;
import org.apache.curator.framework.recipes.locks.InterProcessMutex;
import org.apache.dolphinscheduler.common.Constants;
import org.apache.dolphinscheduler.common.enums.ZKNodeType;
import org.apache.dolphinscheduler.common.model.Server; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,735 | [BUG]The IP and process pid of the master and worker in the monitoring center are not displayed |


**Which version of Dolphin Scheduler:**
-[dev_1.3.0]
| https://github.com/apache/dolphinscheduler/issues/2735 | https://github.com/apache/dolphinscheduler/pull/2770 | 3d857bba925348f4b92b9ba857c37fbca28549dd | 396b1716e4e9b0f55f3686ba8e0283555c65c085 | "2020-05-18T06:14:37Z" | java | "2020-05-22T03:20:54Z" | dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/zk/AbstractZKClient.java | import org.apache.dolphinscheduler.common.utils.ResInfo;
import org.apache.dolphinscheduler.common.utils.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import java.util.*;
import static org.apache.dolphinscheduler.common.Constants.*;
/**
* abstract zookeeper client
*/
@Component
public abstract class AbstractZKClient extends ZookeeperCachedOperator {
private static final Logger logger = LoggerFactory.getLogger(AbstractZKClient.class);
/**
* remove dead server by host
* @param host host
* @param serverType serverType
* @throws Exception
*/
public void removeDeadServerByHost(String host, String serverType) throws Exception {
List<String> deadServers = super.getChildrenKeys(getDeadZNodeParentPath());
for(String serverPath : deadServers){
if(serverPath.startsWith(serverType+UNDERLINE+host)){
String server = getDeadZNodeParentPath() + SINGLE_SLASH + serverPath;
super.remove(server);
logger.info("{} server {} deleted from zk dead server path success" , serverType , host);
}
}
}
/** |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,735 | [BUG]The IP and process pid of the master and worker in the monitoring center are not displayed |


**Which version of Dolphin Scheduler:**
-[dev_1.3.0]
| https://github.com/apache/dolphinscheduler/issues/2735 | https://github.com/apache/dolphinscheduler/pull/2770 | 3d857bba925348f4b92b9ba857c37fbca28549dd | 396b1716e4e9b0f55f3686ba8e0283555c65c085 | "2020-05-18T06:14:37Z" | java | "2020-05-22T03:20:54Z" | dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/zk/AbstractZKClient.java | * opType(add): if find dead server , then add to zk deadServerPath
* opType(delete): delete path from zk
*
* @param zNode node path
* @param zkNodeType master or worker
* @param opType delete or add
* @throws Exception errors
*/
public void handleDeadServer(String zNode, ZKNodeType zkNodeType, String opType) throws Exception {
String host = getHostByEventDataPath(zNode);
String type = (zkNodeType == ZKNodeType.MASTER) ? MASTER_PREFIX : WORKER_PREFIX;
if(opType.equals(DELETE_ZK_OP)){
removeDeadServerByHost(host, type);
}else if(opType.equals(ADD_ZK_OP)){
String deadServerPath = getDeadZNodeParentPath() + SINGLE_SLASH + type + UNDERLINE + host;
if(!super.isExisted(deadServerPath)){
super.persist(deadServerPath,(type + UNDERLINE + host));
logger.info("{} server dead , and {} added to zk dead server path success" ,
zkNodeType.toString(), zNode);
}
}
}
/**
* get active master num
* @return active master number
*/
public int getActiveMasterNum(){
List<String> childrenList = new ArrayList<>(); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,735 | [BUG]The IP and process pid of the master and worker in the monitoring center are not displayed |


**Which version of Dolphin Scheduler:**
-[dev_1.3.0]
| https://github.com/apache/dolphinscheduler/issues/2735 | https://github.com/apache/dolphinscheduler/pull/2770 | 3d857bba925348f4b92b9ba857c37fbca28549dd | 396b1716e4e9b0f55f3686ba8e0283555c65c085 | "2020-05-18T06:14:37Z" | java | "2020-05-22T03:20:54Z" | dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/zk/AbstractZKClient.java | try {
if(super.isExisted(getZNodeParentPath(ZKNodeType.MASTER))){
childrenList = super.getChildrenKeys(getZNodeParentPath(ZKNodeType.MASTER));
}
} catch (Exception e) {
logger.error("getActiveMasterNum error",e);
}
return childrenList.size();
}
/**
*
* @return zookeeper quorum
*/
public String getZookeeperQuorum(){
return getZookeeperConfig().getServerList();
}
/**
* get server list.
* @param zkNodeType zookeeper node type
* @return server list
*/
public List<Server> getServersList(ZKNodeType zkNodeType){
Map<String, String> masterMap = getServerMaps(zkNodeType);
String parentPath = getZNodeParentPath(zkNodeType);
List<Server> masterServers = new ArrayList<>();
int i = 0;
for (Map.Entry<String, String> entry : masterMap.entrySet()) {
Server masterServer = ResInfo.parseHeartbeatForZKInfo(entry.getValue());
masterServer.setZkDirectory(parentPath + "/"+ entry.getKey()); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,735 | [BUG]The IP and process pid of the master and worker in the monitoring center are not displayed |


**Which version of Dolphin Scheduler:**
-[dev_1.3.0]
| https://github.com/apache/dolphinscheduler/issues/2735 | https://github.com/apache/dolphinscheduler/pull/2770 | 3d857bba925348f4b92b9ba857c37fbca28549dd | 396b1716e4e9b0f55f3686ba8e0283555c65c085 | "2020-05-18T06:14:37Z" | java | "2020-05-22T03:20:54Z" | dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/zk/AbstractZKClient.java | masterServer.setId(i);
i ++;
masterServers.add(masterServer);
}
return masterServers;
}
/**
* get master server list map.
* @param zkNodeType zookeeper node type
* @return result : {host : resource info}
*/
public Map<String, String> getServerMaps(ZKNodeType zkNodeType){
Map<String, String> masterMap = new HashMap<>();
try {
String path = getZNodeParentPath(zkNodeType);
List<String> serverList = super.getChildrenKeys(path);
if(zkNodeType == ZKNodeType.WORKER){
List<String> workerList = new ArrayList<>();
for(String group : serverList){
List<String> groupServers = super.getChildrenKeys(path + Constants.SLASH + group);
for(String groupServer : groupServers){
workerList.add(group + Constants.SLASH + groupServer);
}
}
serverList = workerList;
}
for(String server : serverList){
masterMap.putIfAbsent(server, super.get(path + Constants.SLASH + server));
}
} catch (Exception e) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,735 | [BUG]The IP and process pid of the master and worker in the monitoring center are not displayed |


**Which version of Dolphin Scheduler:**
-[dev_1.3.0]
| https://github.com/apache/dolphinscheduler/issues/2735 | https://github.com/apache/dolphinscheduler/pull/2770 | 3d857bba925348f4b92b9ba857c37fbca28549dd | 396b1716e4e9b0f55f3686ba8e0283555c65c085 | "2020-05-18T06:14:37Z" | java | "2020-05-22T03:20:54Z" | dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/zk/AbstractZKClient.java | logger.error("get server list failed", e);
}
return masterMap;
}
/**
* check the zookeeper node already exists
* @param host host
* @param zkNodeType zookeeper node type
* @return true if exists
*/
public boolean checkZKNodeExists(String host, ZKNodeType zkNodeType) {
String path = getZNodeParentPath(zkNodeType);
if(StringUtils.isEmpty(path)){
logger.error("check zk node exists error, host:{}, zk node type:{}",
host, zkNodeType.toString());
return false;
}
Map<String, String> serverMaps = getServerMaps(zkNodeType);
for(String hostKey : serverMaps.keySet()){
if(hostKey.startsWith(host)){
return true;
}
}
return false;
}
/**
*
* @return get worker node parent path
*/
protected String getWorkerZNodeParentPath(){ |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,735 | [BUG]The IP and process pid of the master and worker in the monitoring center are not displayed |


**Which version of Dolphin Scheduler:**
-[dev_1.3.0]
| https://github.com/apache/dolphinscheduler/issues/2735 | https://github.com/apache/dolphinscheduler/pull/2770 | 3d857bba925348f4b92b9ba857c37fbca28549dd | 396b1716e4e9b0f55f3686ba8e0283555c65c085 | "2020-05-18T06:14:37Z" | java | "2020-05-22T03:20:54Z" | dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/zk/AbstractZKClient.java | return getZookeeperConfig().getDsRoot() + Constants.ZOOKEEPER_DOLPHINSCHEDULER_WORKERS;
}
/**
*
* @return get master node parent path
*/
protected String getMasterZNodeParentPath(){
return getZookeeperConfig().getDsRoot() + Constants.ZOOKEEPER_DOLPHINSCHEDULER_MASTERS;
}
/**
*
* @return get master lock path
*/
public String getMasterLockPath(){
return getZookeeperConfig().getDsRoot() + Constants.ZOOKEEPER_DOLPHINSCHEDULER_LOCK_MASTERS;
}
/**
*
* @param zkNodeType zookeeper node type
* @return get zookeeper node parent path
*/
public String getZNodeParentPath(ZKNodeType zkNodeType) {
String path = "";
switch (zkNodeType){
case MASTER:
return getMasterZNodeParentPath();
case WORKER:
return getWorkerZNodeParentPath();
case DEAD_SERVER:
return getDeadZNodeParentPath(); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,735 | [BUG]The IP and process pid of the master and worker in the monitoring center are not displayed |


**Which version of Dolphin Scheduler:**
-[dev_1.3.0]
| https://github.com/apache/dolphinscheduler/issues/2735 | https://github.com/apache/dolphinscheduler/pull/2770 | 3d857bba925348f4b92b9ba857c37fbca28549dd | 396b1716e4e9b0f55f3686ba8e0283555c65c085 | "2020-05-18T06:14:37Z" | java | "2020-05-22T03:20:54Z" | dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/zk/AbstractZKClient.java | default:
break;
}
return path;
}
/**
*
* @return get dead server node parent path
*/
protected String getDeadZNodeParentPath(){
return getZookeeperConfig().getDsRoot() + Constants.ZOOKEEPER_DOLPHINSCHEDULER_DEAD_SERVERS;
}
/**
*
* @return get master start up lock path
*/
public String getMasterStartUpLockPath(){
return getZookeeperConfig().getDsRoot() + Constants.ZOOKEEPER_DOLPHINSCHEDULER_LOCK_FAILOVER_STARTUP_MASTERS;
}
/**
*
* @return get master failover lock path
*/
public String getMasterFailoverLockPath(){
return getZookeeperConfig().getDsRoot() + Constants.ZOOKEEPER_DOLPHINSCHEDULER_LOCK_FAILOVER_MASTERS;
}
/**
*
* @return get worker failover lock path
*/ |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,735 | [BUG]The IP and process pid of the master and worker in the monitoring center are not displayed |


**Which version of Dolphin Scheduler:**
-[dev_1.3.0]
| https://github.com/apache/dolphinscheduler/issues/2735 | https://github.com/apache/dolphinscheduler/pull/2770 | 3d857bba925348f4b92b9ba857c37fbca28549dd | 396b1716e4e9b0f55f3686ba8e0283555c65c085 | "2020-05-18T06:14:37Z" | java | "2020-05-22T03:20:54Z" | dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/zk/AbstractZKClient.java | public String getWorkerFailoverLockPath(){
return getZookeeperConfig().getDsRoot() + Constants.ZOOKEEPER_DOLPHINSCHEDULER_LOCK_FAILOVER_WORKERS;
}
/**
* release mutex
* @param mutex mutex
*/
public void releaseMutex(InterProcessMutex mutex) {
if (mutex != null){
try {
mutex.release();
} catch (Exception e) {
if(e.getMessage().equals("instance must be started before calling this method")){
logger.warn("lock release");
}else{
logger.error("lock release failed",e);
}
}
}
}
/**
* init system znode
*/
protected void initSystemZNode(){
try {
persist(getMasterZNodeParentPath(), "");
persist(getWorkerZNodeParentPath(), "");
persist(getDeadZNodeParentPath(), "");
logger.info("initialize server nodes success.");
} catch (Exception e) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,735 | [BUG]The IP and process pid of the master and worker in the monitoring center are not displayed |


**Which version of Dolphin Scheduler:**
-[dev_1.3.0]
| https://github.com/apache/dolphinscheduler/issues/2735 | https://github.com/apache/dolphinscheduler/pull/2770 | 3d857bba925348f4b92b9ba857c37fbca28549dd | 396b1716e4e9b0f55f3686ba8e0283555c65c085 | "2020-05-18T06:14:37Z" | java | "2020-05-22T03:20:54Z" | dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/zk/AbstractZKClient.java | logger.error("init system znode failed",e);
}
}
/**
* get host ip, string format: masterParentPath/ip
* @param path path
* @return host ip, string format: masterParentPath/ip
*/
protected String getHostByEventDataPath(String path) {
if(StringUtils.isEmpty(path)){
logger.error("empty path!");
return "";
}
String[] pathArray = path.split(SINGLE_SLASH);
if(pathArray.length < 1){
logger.error("parse ip error: {}", path);
return "";
}
return pathArray[pathArray.length - 1];
}
@Override
public String toString() {
return "AbstractZKClient{" +
"zkClient=" + zkClient +
", deadServerZNodeParentPath='" + getZNodeParentPath(ZKNodeType.DEAD_SERVER) + '\'' +
", masterZNodeParentPath='" + getZNodeParentPath(ZKNodeType.MASTER) + '\'' +
", workerZNodeParentPath='" + getZNodeParentPath(ZKNodeType.WORKER) + '\'' +
'}';
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,499 | [BUG]The task is in progress, the master and worker hang up , start the master and worker again, the process instance and task are not fault-tolerant | 1.The task is in progress
2. Worker hangs first, then hangs master
3.start the master and worker again, the process instance and task are not fault-tolerant,Status has been in progress


**Which version of Dolphin Scheduler:**
-[dev]
| https://github.com/apache/dolphinscheduler/issues/2499 | https://github.com/apache/dolphinscheduler/pull/2833 | f25069bf839cb76c6dd3bcd58887040f8317d7f6 | d67436ffad7afe4985d843bc63cab260667ed7d7 | "2020-04-23T03:05:33Z" | java | "2020-05-28T04:31:12Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/processor/TaskCallbackService.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.worker.processor;
import io.netty.channel.Channel;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelFutureListener;
import org.apache.dolphinscheduler.common.thread.Stopper;
import org.apache.dolphinscheduler.common.thread.ThreadUtils;
import org.apache.dolphinscheduler.common.utils.CollectionUtils; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,499 | [BUG]The task is in progress, the master and worker hang up , start the master and worker again, the process instance and task are not fault-tolerant | 1.The task is in progress
2. Worker hangs first, then hangs master
3.start the master and worker again, the process instance and task are not fault-tolerant,Status has been in progress


**Which version of Dolphin Scheduler:**
-[dev]
| https://github.com/apache/dolphinscheduler/issues/2499 | https://github.com/apache/dolphinscheduler/pull/2833 | f25069bf839cb76c6dd3bcd58887040f8317d7f6 | d67436ffad7afe4985d843bc63cab260667ed7d7 | "2020-04-23T03:05:33Z" | java | "2020-05-28T04:31:12Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/processor/TaskCallbackService.java | import org.apache.dolphinscheduler.remote.NettyRemotingClient;
import org.apache.dolphinscheduler.remote.command.Command;
import org.apache.dolphinscheduler.remote.config.NettyClientConfig;
import org.apache.dolphinscheduler.remote.utils.Host;
import org.apache.dolphinscheduler.server.registry.ZookeeperRegistryCenter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import static org.apache.dolphinscheduler.common.Constants.SLEEP_TIME_MILLIS;
/**
* taks callback service
*/
@Service
public class TaskCallbackService {
private final Logger logger = LoggerFactory.getLogger(TaskCallbackService.class);
/**
* remote channels
*/
private static final ConcurrentHashMap<Integer, NettyRemoteChannel> REMOTE_CHANNELS = new ConcurrentHashMap<>();
/**
* zookeeper register center
*/
@Autowired
private ZookeeperRegistryCenter zookeeperRegistryCenter;
/**
* netty remoting client
*/ |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,499 | [BUG]The task is in progress, the master and worker hang up , start the master and worker again, the process instance and task are not fault-tolerant | 1.The task is in progress
2. Worker hangs first, then hangs master
3.start the master and worker again, the process instance and task are not fault-tolerant,Status has been in progress


**Which version of Dolphin Scheduler:**
-[dev]
| https://github.com/apache/dolphinscheduler/issues/2499 | https://github.com/apache/dolphinscheduler/pull/2833 | f25069bf839cb76c6dd3bcd58887040f8317d7f6 | d67436ffad7afe4985d843bc63cab260667ed7d7 | "2020-04-23T03:05:33Z" | java | "2020-05-28T04:31:12Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/processor/TaskCallbackService.java | private final NettyRemotingClient nettyRemotingClient;
public TaskCallbackService(){
final NettyClientConfig clientConfig = new NettyClientConfig();
this.nettyRemotingClient = new NettyRemotingClient(clientConfig);
}
/**
* add callback channel
* @param taskInstanceId taskInstanceId
* @param channel channel
*/
public void addRemoteChannel(int taskInstanceId, NettyRemoteChannel channel){
REMOTE_CHANNELS.put(taskInstanceId, channel);
}
/**
* get callback channel
* @param taskInstanceId taskInstanceId
* @return callback channel
*/
private NettyRemoteChannel getRemoteChannel(int taskInstanceId){
NettyRemoteChannel nettyRemoteChannel = REMOTE_CHANNELS.get(taskInstanceId);
if(nettyRemoteChannel == null){
throw new IllegalArgumentException("nettyRemoteChannel is empty, should call addRemoteChannel first");
}
if(nettyRemoteChannel.isActive()){
return nettyRemoteChannel;
}
Channel newChannel = nettyRemotingClient.getChannel(nettyRemoteChannel.getHost());
if(newChannel != null){
return getRemoteChannel(newChannel, nettyRemoteChannel.getOpaque(), taskInstanceId);
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,499 | [BUG]The task is in progress, the master and worker hang up , start the master and worker again, the process instance and task are not fault-tolerant | 1.The task is in progress
2. Worker hangs first, then hangs master
3.start the master and worker again, the process instance and task are not fault-tolerant,Status has been in progress


**Which version of Dolphin Scheduler:**
-[dev]
| https://github.com/apache/dolphinscheduler/issues/2499 | https://github.com/apache/dolphinscheduler/pull/2833 | f25069bf839cb76c6dd3bcd58887040f8317d7f6 | d67436ffad7afe4985d843bc63cab260667ed7d7 | "2020-04-23T03:05:33Z" | java | "2020-05-28T04:31:12Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/processor/TaskCallbackService.java | logger.warn("original master : {} is not reachable, random select master", nettyRemoteChannel.getHost());
Set<String> masterNodes = null;
while (Stopper.isRunning()) {
masterNodes = zookeeperRegistryCenter.getMasterNodesDirectly();
if (CollectionUtils.isEmpty(masterNodes)) {
logger.error("no available master node");
ThreadUtils.sleep(SLEEP_TIME_MILLIS);
}else {
break;
}
}
for(String masterNode : masterNodes){
newChannel = nettyRemotingClient.getChannel(Host.of(masterNode));
if(newChannel != null){
return getRemoteChannel(newChannel, nettyRemoteChannel.getOpaque(), taskInstanceId);
}
}
throw new IllegalStateException(String.format("all available master nodes : %s are not reachable", masterNodes));
}
private NettyRemoteChannel getRemoteChannel(Channel newChannel, long opaque, int taskInstanceId){
NettyRemoteChannel remoteChannel = new NettyRemoteChannel(newChannel, opaque);
addRemoteChannel(taskInstanceId, remoteChannel);
return remoteChannel;
}
/**
* remove callback channels
* @param taskInstanceId taskInstanceId
*/
public void remove(int taskInstanceId){
REMOTE_CHANNELS.remove(taskInstanceId); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,499 | [BUG]The task is in progress, the master and worker hang up , start the master and worker again, the process instance and task are not fault-tolerant | 1.The task is in progress
2. Worker hangs first, then hangs master
3.start the master and worker again, the process instance and task are not fault-tolerant,Status has been in progress


**Which version of Dolphin Scheduler:**
-[dev]
| https://github.com/apache/dolphinscheduler/issues/2499 | https://github.com/apache/dolphinscheduler/pull/2833 | f25069bf839cb76c6dd3bcd58887040f8317d7f6 | d67436ffad7afe4985d843bc63cab260667ed7d7 | "2020-04-23T03:05:33Z" | java | "2020-05-28T04:31:12Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/processor/TaskCallbackService.java | }
/**
* send ack
* @param taskInstanceId taskInstanceId
* @param command command
*/
public void sendAck(int taskInstanceId, Command command){
NettyRemoteChannel nettyRemoteChannel = getRemoteChannel(taskInstanceId);
nettyRemoteChannel.writeAndFlush(command);
}
/**
* send result
*
* @param taskInstanceId taskInstanceId
* @param command command
*/
public void sendResult(int taskInstanceId, Command command){
NettyRemoteChannel nettyRemoteChannel = getRemoteChannel(taskInstanceId);
nettyRemoteChannel.writeAndFlush(command).addListener(new ChannelFutureListener(){
@Override
public void operationComplete(ChannelFuture future) throws Exception {
if(future.isSuccess()){
remove(taskInstanceId);
return;
}
}
});
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,499 | [BUG]The task is in progress, the master and worker hang up , start the master and worker again, the process instance and task are not fault-tolerant | 1.The task is in progress
2. Worker hangs first, then hangs master
3.start the master and worker again, the process instance and task are not fault-tolerant,Status has been in progress


**Which version of Dolphin Scheduler:**
-[dev]
| https://github.com/apache/dolphinscheduler/issues/2499 | https://github.com/apache/dolphinscheduler/pull/2833 | f25069bf839cb76c6dd3bcd58887040f8317d7f6 | d67436ffad7afe4985d843bc63cab260667ed7d7 | "2020-04-23T03:05:33Z" | java | "2020-05-28T04:31:12Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/zk/ZKMasterClient.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.zk; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,499 | [BUG]The task is in progress, the master and worker hang up , start the master and worker again, the process instance and task are not fault-tolerant | 1.The task is in progress
2. Worker hangs first, then hangs master
3.start the master and worker again, the process instance and task are not fault-tolerant,Status has been in progress


**Which version of Dolphin Scheduler:**
-[dev]
| https://github.com/apache/dolphinscheduler/issues/2499 | https://github.com/apache/dolphinscheduler/pull/2833 | f25069bf839cb76c6dd3bcd58887040f8317d7f6 | d67436ffad7afe4985d843bc63cab260667ed7d7 | "2020-04-23T03:05:33Z" | java | "2020-05-28T04:31:12Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/zk/ZKMasterClient.java | import org.apache.commons.lang.StringUtils;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.recipes.cache.TreeCacheEvent;
import org.apache.curator.framework.recipes.locks.InterProcessMutex;
import org.apache.dolphinscheduler.common.Constants;
import org.apache.dolphinscheduler.common.enums.ExecutionStatus;
import org.apache.dolphinscheduler.common.enums.ZKNodeType;
import org.apache.dolphinscheduler.common.model.Server;
import org.apache.dolphinscheduler.common.thread.ThreadUtils;
import org.apache.dolphinscheduler.common.utils.OSUtils;
import org.apache.dolphinscheduler.dao.entity.ProcessInstance;
import org.apache.dolphinscheduler.dao.entity.TaskInstance;
import org.apache.dolphinscheduler.server.builder.TaskExecutionContextBuilder;
import org.apache.dolphinscheduler.server.entity.TaskExecutionContext;
import org.apache.dolphinscheduler.server.utils.ProcessUtils;
import org.apache.dolphinscheduler.service.process.ProcessService;
import org.apache.dolphinscheduler.service.zk.AbstractZKClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Date;
import java.util.List;
import static org.apache.dolphinscheduler.common.Constants.*;
/**
* zookeeper master client
*
* single instance
*/
@Component |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,499 | [BUG]The task is in progress, the master and worker hang up , start the master and worker again, the process instance and task are not fault-tolerant | 1.The task is in progress
2. Worker hangs first, then hangs master
3.start the master and worker again, the process instance and task are not fault-tolerant,Status has been in progress


**Which version of Dolphin Scheduler:**
-[dev]
| https://github.com/apache/dolphinscheduler/issues/2499 | https://github.com/apache/dolphinscheduler/pull/2833 | f25069bf839cb76c6dd3bcd58887040f8317d7f6 | d67436ffad7afe4985d843bc63cab260667ed7d7 | "2020-04-23T03:05:33Z" | java | "2020-05-28T04:31:12Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/zk/ZKMasterClient.java | public class ZKMasterClient extends AbstractZKClient {
/**
* logger
*/
private static final Logger logger = LoggerFactory.getLogger(ZKMasterClient.class);
/**
* process service
*/
@Autowired
private ProcessService processService;
public void start() {
InterProcessMutex mutex = null;
try {
String znodeLock = getMasterStartUpLockPath();
mutex = new InterProcessMutex(getZkClient(), znodeLock);
mutex.acquire();
this.initSystemZNode();
while (!checkZKNodeExists(OSUtils.getHost(), ZKNodeType.MASTER)){
ThreadUtils.sleep(SLEEP_TIME_MILLIS);
}
if (getActiveMasterNum() == 1) {
failoverWorker(null, true);
failoverMaster(null); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,499 | [BUG]The task is in progress, the master and worker hang up , start the master and worker again, the process instance and task are not fault-tolerant | 1.The task is in progress
2. Worker hangs first, then hangs master
3.start the master and worker again, the process instance and task are not fault-tolerant,Status has been in progress


**Which version of Dolphin Scheduler:**
-[dev]
| https://github.com/apache/dolphinscheduler/issues/2499 | https://github.com/apache/dolphinscheduler/pull/2833 | f25069bf839cb76c6dd3bcd58887040f8317d7f6 | d67436ffad7afe4985d843bc63cab260667ed7d7 | "2020-04-23T03:05:33Z" | java | "2020-05-28T04:31:12Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/zk/ZKMasterClient.java | }
}catch (Exception e){
logger.error("master start up exception",e);
}finally {
releaseMutex(mutex);
}
}
@Override
public void close(){
super.close();
}
/**
* handle path events that this class cares about
* @param client zkClient
* @param event path event
* @param path zk path
*/
@Override
protected void dataChanged(CuratorFramework client, TreeCacheEvent event, String path) {
if(path.startsWith(getZNodeParentPath(ZKNodeType.MASTER)+Constants.SINGLE_SLASH)){
handleMasterEvent(event,path);
}else if(path.startsWith(getZNodeParentPath(ZKNodeType.WORKER)+Constants.SINGLE_SLASH)){
handleWorkerEvent(event,path);
}
}
/**
* remove zookeeper node path
* |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,499 | [BUG]The task is in progress, the master and worker hang up , start the master and worker again, the process instance and task are not fault-tolerant | 1.The task is in progress
2. Worker hangs first, then hangs master
3.start the master and worker again, the process instance and task are not fault-tolerant,Status has been in progress


**Which version of Dolphin Scheduler:**
-[dev]
| https://github.com/apache/dolphinscheduler/issues/2499 | https://github.com/apache/dolphinscheduler/pull/2833 | f25069bf839cb76c6dd3bcd58887040f8317d7f6 | d67436ffad7afe4985d843bc63cab260667ed7d7 | "2020-04-23T03:05:33Z" | java | "2020-05-28T04:31:12Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/zk/ZKMasterClient.java | * @param path zookeeper node path
* @param zkNodeType zookeeper node type
* @param failover is failover
*/
private void removeZKNodePath(String path, ZKNodeType zkNodeType, boolean failover) {
logger.info("{} node deleted : {}", zkNodeType.toString(), path);
InterProcessMutex mutex = null;
try {
String failoverPath = getFailoverLockPath(zkNodeType);
mutex = new InterProcessMutex(getZkClient(), failoverPath);
mutex.acquire();
String serverHost = getHostByEventDataPath(path);
handleDeadServer(path, zkNodeType, Constants.ADD_ZK_OP);
if(failover){
failoverServerWhenDown(serverHost, zkNodeType);
}
}catch (Exception e){
logger.error("{} server failover failed.", zkNodeType.toString());
logger.error("failover exception ",e);
}
finally {
releaseMutex(mutex);
}
}
/**
* failover server when server down
* |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,499 | [BUG]The task is in progress, the master and worker hang up , start the master and worker again, the process instance and task are not fault-tolerant | 1.The task is in progress
2. Worker hangs first, then hangs master
3.start the master and worker again, the process instance and task are not fault-tolerant,Status has been in progress


**Which version of Dolphin Scheduler:**
-[dev]
| https://github.com/apache/dolphinscheduler/issues/2499 | https://github.com/apache/dolphinscheduler/pull/2833 | f25069bf839cb76c6dd3bcd58887040f8317d7f6 | d67436ffad7afe4985d843bc63cab260667ed7d7 | "2020-04-23T03:05:33Z" | java | "2020-05-28T04:31:12Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/zk/ZKMasterClient.java | * @param serverHost server host
* @param zkNodeType zookeeper node type
* @throws Exception exception
*/
private void failoverServerWhenDown(String serverHost, ZKNodeType zkNodeType) throws Exception {
if(StringUtils.isEmpty(serverHost) || serverHost.startsWith(OSUtils.getHost())){
return ;
}
switch (zkNodeType){
case MASTER:
failoverMaster(serverHost);
break;
case WORKER:
failoverWorker(serverHost, true);
default:
break;
}
}
/**
* get failover lock path
*
* @param zkNodeType zookeeper node type
* @return fail over lock path
*/
private String getFailoverLockPath(ZKNodeType zkNodeType){
switch (zkNodeType){
case MASTER:
return getMasterFailoverLockPath();
case WORKER:
return getWorkerFailoverLockPath(); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,499 | [BUG]The task is in progress, the master and worker hang up , start the master and worker again, the process instance and task are not fault-tolerant | 1.The task is in progress
2. Worker hangs first, then hangs master
3.start the master and worker again, the process instance and task are not fault-tolerant,Status has been in progress


**Which version of Dolphin Scheduler:**
-[dev]
| https://github.com/apache/dolphinscheduler/issues/2499 | https://github.com/apache/dolphinscheduler/pull/2833 | f25069bf839cb76c6dd3bcd58887040f8317d7f6 | d67436ffad7afe4985d843bc63cab260667ed7d7 | "2020-04-23T03:05:33Z" | java | "2020-05-28T04:31:12Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/zk/ZKMasterClient.java | default:
return "";
}
}
/**
* monitor master
* @param event event
* @param path path
*/
public void handleMasterEvent(TreeCacheEvent event, String path){
switch (event.getType()) {
case NODE_ADDED:
logger.info("master node added : {}", path);
break;
case NODE_REMOVED:
removeZKNodePath(path, ZKNodeType.MASTER, true);
break;
default:
break;
}
}
/**
* monitor worker
* @param event event
* @param path path
*/
public void handleWorkerEvent(TreeCacheEvent event, String path){
switch (event.getType()) {
case NODE_ADDED:
logger.info("worker node added : {}", path); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,499 | [BUG]The task is in progress, the master and worker hang up , start the master and worker again, the process instance and task are not fault-tolerant | 1.The task is in progress
2. Worker hangs first, then hangs master
3.start the master and worker again, the process instance and task are not fault-tolerant,Status has been in progress


**Which version of Dolphin Scheduler:**
-[dev]
| https://github.com/apache/dolphinscheduler/issues/2499 | https://github.com/apache/dolphinscheduler/pull/2833 | f25069bf839cb76c6dd3bcd58887040f8317d7f6 | d67436ffad7afe4985d843bc63cab260667ed7d7 | "2020-04-23T03:05:33Z" | java | "2020-05-28T04:31:12Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/zk/ZKMasterClient.java | break;
case NODE_REMOVED:
logger.info("worker node deleted : {}", path);
removeZKNodePath(path, ZKNodeType.WORKER, true);
break;
default:
break;
}
}
/**
* task needs failover if task start before worker starts
*
* @param taskInstance task instance
* @return true if task instance need fail over
*/
private boolean checkTaskInstanceNeedFailover(TaskInstance taskInstance) throws Exception {
boolean taskNeedFailover = true;
if(taskInstance.getHost() == null){
return false;
}
if(checkZKNodeExists(taskInstance.getHost(), ZKNodeType.WORKER)){
if(checkTaskAfterWorkerStart(taskInstance)){
taskNeedFailover = false;
}
}
return taskNeedFailover;
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,499 | [BUG]The task is in progress, the master and worker hang up , start the master and worker again, the process instance and task are not fault-tolerant | 1.The task is in progress
2. Worker hangs first, then hangs master
3.start the master and worker again, the process instance and task are not fault-tolerant,Status has been in progress


**Which version of Dolphin Scheduler:**
-[dev]
| https://github.com/apache/dolphinscheduler/issues/2499 | https://github.com/apache/dolphinscheduler/pull/2833 | f25069bf839cb76c6dd3bcd58887040f8317d7f6 | d67436ffad7afe4985d843bc63cab260667ed7d7 | "2020-04-23T03:05:33Z" | java | "2020-05-28T04:31:12Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/zk/ZKMasterClient.java | /**
* check task start after the worker server starts.
*
* @param taskInstance task instance
* @return true if task instance start time after worker server start date
*/
private boolean checkTaskAfterWorkerStart(TaskInstance taskInstance) {
if(StringUtils.isEmpty(taskInstance.getHost())){
return false;
}
Date workerServerStartDate = null;
List<Server> workerServers = getServersList(ZKNodeType.WORKER);
for(Server workerServer : workerServers){
if(workerServer.getHost().equals(taskInstance.getHost())){
workerServerStartDate = workerServer.getCreateTime();
break;
}
}
if(workerServerStartDate != null){
return taskInstance.getStartTime().after(workerServerStartDate);
}else{
return false;
}
}
/**
* failover worker tasks
*
* 1. kill yarn job if there are yarn jobs in tasks.
* 2. change task state from running to need failover.
* 3. failover all tasks when workerHost is null |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,499 | [BUG]The task is in progress, the master and worker hang up , start the master and worker again, the process instance and task are not fault-tolerant | 1.The task is in progress
2. Worker hangs first, then hangs master
3.start the master and worker again, the process instance and task are not fault-tolerant,Status has been in progress


**Which version of Dolphin Scheduler:**
-[dev]
| https://github.com/apache/dolphinscheduler/issues/2499 | https://github.com/apache/dolphinscheduler/pull/2833 | f25069bf839cb76c6dd3bcd58887040f8317d7f6 | d67436ffad7afe4985d843bc63cab260667ed7d7 | "2020-04-23T03:05:33Z" | java | "2020-05-28T04:31:12Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/zk/ZKMasterClient.java | * @param workerHost worker host
*/
/**
* failover worker tasks
*
* 1. kill yarn job if there are yarn jobs in tasks.
* 2. change task state from running to need failover.
* 3. failover all tasks when workerHost is null
* @param workerHost worker host
* @param needCheckWorkerAlive need check worker alive
* @throws Exception exception
*/
private void failoverWorker(String workerHost, boolean needCheckWorkerAlive) throws Exception {
logger.info("start worker[{}] failover ...", workerHost);
List<TaskInstance> needFailoverTaskInstanceList = processService.queryNeedFailoverTaskInstances(workerHost);
for(TaskInstance taskInstance : needFailoverTaskInstanceList){
if(needCheckWorkerAlive){
if(!checkTaskInstanceNeedFailover(taskInstance)){
continue;
}
}
ProcessInstance processInstance = processService.findProcessInstanceDetailById(taskInstance.getProcessInstanceId());
if(processInstance != null){
taskInstance.setProcessInstance(processInstance);
}
TaskExecutionContext taskExecutionContext = TaskExecutionContextBuilder.get()
.buildTaskInstanceRelatedInfo(taskInstance)
.buildProcessInstanceRelatedInfo(processInstance)
.create(); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,499 | [BUG]The task is in progress, the master and worker hang up , start the master and worker again, the process instance and task are not fault-tolerant | 1.The task is in progress
2. Worker hangs first, then hangs master
3.start the master and worker again, the process instance and task are not fault-tolerant,Status has been in progress


**Which version of Dolphin Scheduler:**
-[dev]
| https://github.com/apache/dolphinscheduler/issues/2499 | https://github.com/apache/dolphinscheduler/pull/2833 | f25069bf839cb76c6dd3bcd58887040f8317d7f6 | d67436ffad7afe4985d843bc63cab260667ed7d7 | "2020-04-23T03:05:33Z" | java | "2020-05-28T04:31:12Z" | dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/zk/ZKMasterClient.java | ProcessUtils.killYarnJob(taskExecutionContext);
taskInstance.setState(ExecutionStatus.NEED_FAULT_TOLERANCE);
processService.saveTaskInstance(taskInstance);
}
logger.info("end worker[{}] failover ...", workerHost);
}
/**
* failover master tasks
*
* @param masterHost master host
*/
private void failoverMaster(String masterHost) {
logger.info("start master failover ...");
List<ProcessInstance> needFailoverProcessInstanceList = processService.queryNeedFailoverProcessInstances(masterHost);
for(ProcessInstance processInstance : needFailoverProcessInstanceList){
if(Constants.NULL.equals(processInstance.getHost()) ){
continue;
}
processService.processNeedFailoverProcessInstances(processInstance);
}
logger.info("master failover end");
}
public InterProcessMutex blockAcquireMutex() throws Exception {
InterProcessMutex mutex = new InterProcessMutex(getZkClient(), getMasterLockPath());
mutex.acquire();
return mutex;
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,499 | [BUG]The task is in progress, the master and worker hang up , start the master and worker again, the process instance and task are not fault-tolerant | 1.The task is in progress
2. Worker hangs first, then hangs master
3.start the master and worker again, the process instance and task are not fault-tolerant,Status has been in progress


**Which version of Dolphin Scheduler:**
-[dev]
| https://github.com/apache/dolphinscheduler/issues/2499 | https://github.com/apache/dolphinscheduler/pull/2833 | f25069bf839cb76c6dd3bcd58887040f8317d7f6 | d67436ffad7afe4985d843bc63cab260667ed7d7 | "2020-04-23T03:05:33Z" | java | "2020-05-28T04:31:12Z" | dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/zk/AbstractZKClient.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.zk;
import org.apache.curator.framework.recipes.locks.InterProcessMutex;
import org.apache.dolphinscheduler.common.Constants;
import org.apache.dolphinscheduler.common.enums.ZKNodeType;
import org.apache.dolphinscheduler.common.model.Server;
import org.apache.dolphinscheduler.common.utils.ResInfo;
import org.apache.dolphinscheduler.common.utils.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import java.util.*;
import static org.apache.dolphinscheduler.common.Constants.*; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,499 | [BUG]The task is in progress, the master and worker hang up , start the master and worker again, the process instance and task are not fault-tolerant | 1.The task is in progress
2. Worker hangs first, then hangs master
3.start the master and worker again, the process instance and task are not fault-tolerant,Status has been in progress


**Which version of Dolphin Scheduler:**
-[dev]
| https://github.com/apache/dolphinscheduler/issues/2499 | https://github.com/apache/dolphinscheduler/pull/2833 | f25069bf839cb76c6dd3bcd58887040f8317d7f6 | d67436ffad7afe4985d843bc63cab260667ed7d7 | "2020-04-23T03:05:33Z" | java | "2020-05-28T04:31:12Z" | dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/zk/AbstractZKClient.java | /**
* abstract zookeeper client
*/
@Component
public abstract class AbstractZKClient extends ZookeeperCachedOperator {
private static final Logger logger = LoggerFactory.getLogger(AbstractZKClient.class);
/**
* remove dead server by host
* @param host host
* @param serverType serverType
* @throws Exception
*/
public void removeDeadServerByHost(String host, String serverType) throws Exception {
List<String> deadServers = super.getChildrenKeys(getDeadZNodeParentPath());
for(String serverPath : deadServers){
if(serverPath.startsWith(serverType+UNDERLINE+host)){
String server = getDeadZNodeParentPath() + SINGLE_SLASH + serverPath;
super.remove(server);
logger.info("{} server {} deleted from zk dead server path success" , serverType , host);
}
}
}
/**
* opType(add): if find dead server , then add to zk deadServerPath
* opType(delete): delete path from zk
*
* @param zNode node path
* @param zkNodeType master or worker
* @param opType delete or add
* @throws Exception errors |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,499 | [BUG]The task is in progress, the master and worker hang up , start the master and worker again, the process instance and task are not fault-tolerant | 1.The task is in progress
2. Worker hangs first, then hangs master
3.start the master and worker again, the process instance and task are not fault-tolerant,Status has been in progress


**Which version of Dolphin Scheduler:**
-[dev]
| https://github.com/apache/dolphinscheduler/issues/2499 | https://github.com/apache/dolphinscheduler/pull/2833 | f25069bf839cb76c6dd3bcd58887040f8317d7f6 | d67436ffad7afe4985d843bc63cab260667ed7d7 | "2020-04-23T03:05:33Z" | java | "2020-05-28T04:31:12Z" | dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/zk/AbstractZKClient.java | */
public void handleDeadServer(String zNode, ZKNodeType zkNodeType, String opType) throws Exception {
String host = getHostByEventDataPath(zNode);
String type = (zkNodeType == ZKNodeType.MASTER) ? MASTER_PREFIX : WORKER_PREFIX;
if(opType.equals(DELETE_ZK_OP)){
removeDeadServerByHost(host, type);
}else if(opType.equals(ADD_ZK_OP)){
String deadServerPath = getDeadZNodeParentPath() + SINGLE_SLASH + type + UNDERLINE + host;
if(!super.isExisted(deadServerPath)){
super.persist(deadServerPath,(type + UNDERLINE + host));
logger.info("{} server dead , and {} added to zk dead server path success" ,
zkNodeType.toString(), zNode);
}
}
}
/**
* get active master num
* @return active master number
*/
public int getActiveMasterNum(){
List<String> childrenList = new ArrayList<>();
try {
if(super.isExisted(getZNodeParentPath(ZKNodeType.MASTER))){
childrenList = super.getChildrenKeys(getZNodeParentPath(ZKNodeType.MASTER));
}
} catch (Exception e) {
logger.error("getActiveMasterNum error",e); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,499 | [BUG]The task is in progress, the master and worker hang up , start the master and worker again, the process instance and task are not fault-tolerant | 1.The task is in progress
2. Worker hangs first, then hangs master
3.start the master and worker again, the process instance and task are not fault-tolerant,Status has been in progress


**Which version of Dolphin Scheduler:**
-[dev]
| https://github.com/apache/dolphinscheduler/issues/2499 | https://github.com/apache/dolphinscheduler/pull/2833 | f25069bf839cb76c6dd3bcd58887040f8317d7f6 | d67436ffad7afe4985d843bc63cab260667ed7d7 | "2020-04-23T03:05:33Z" | java | "2020-05-28T04:31:12Z" | dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/zk/AbstractZKClient.java | }
return childrenList.size();
}
/**
*
* @return zookeeper quorum
*/
public String getZookeeperQuorum(){
return getZookeeperConfig().getServerList();
}
/**
* get server list.
* @param zkNodeType zookeeper node type
* @return server list
*/
public List<Server> getServersList(ZKNodeType zkNodeType){
Map<String, String> masterMap = getServerMaps(zkNodeType);
String parentPath = getZNodeParentPath(zkNodeType);
List<Server> masterServers = new ArrayList<>();
for (Map.Entry<String, String> entry : masterMap.entrySet()) {
Server masterServer = ResInfo.parseHeartbeatForZKInfo(entry.getValue());
if(masterServer == null){
continue;
}
String key = entry.getKey();
masterServer.setZkDirectory(parentPath + "/"+ key);
String[] hostAndPort=key.split(COLON);
String[] hosts=hostAndPort[0].split(DIVISION_STRING); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,499 | [BUG]The task is in progress, the master and worker hang up , start the master and worker again, the process instance and task are not fault-tolerant | 1.The task is in progress
2. Worker hangs first, then hangs master
3.start the master and worker again, the process instance and task are not fault-tolerant,Status has been in progress


**Which version of Dolphin Scheduler:**
-[dev]
| https://github.com/apache/dolphinscheduler/issues/2499 | https://github.com/apache/dolphinscheduler/pull/2833 | f25069bf839cb76c6dd3bcd58887040f8317d7f6 | d67436ffad7afe4985d843bc63cab260667ed7d7 | "2020-04-23T03:05:33Z" | java | "2020-05-28T04:31:12Z" | dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/zk/AbstractZKClient.java | masterServer.setHost(hosts[hosts.length-1]);
masterServer.setPort(Integer.parseInt(hostAndPort[1]));
masterServers.add(masterServer);
}
return masterServers;
}
/**
* get master server list map.
* @param zkNodeType zookeeper node type
* @return result : {host : resource info}
*/
public Map<String, String> getServerMaps(ZKNodeType zkNodeType){
Map<String, String> masterMap = new HashMap<>();
try {
String path = getZNodeParentPath(zkNodeType);
List<String> serverList = super.getChildrenKeys(path);
if(zkNodeType == ZKNodeType.WORKER){
List<String> workerList = new ArrayList<>();
for(String group : serverList){
List<String> groupServers = super.getChildrenKeys(path + Constants.SLASH + group);
for(String groupServer : groupServers){
workerList.add(group + Constants.SLASH + groupServer);
}
}
serverList = workerList;
}
for(String server : serverList){
masterMap.putIfAbsent(server, super.get(path + Constants.SLASH + server));
}
} catch (Exception e) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,499 | [BUG]The task is in progress, the master and worker hang up , start the master and worker again, the process instance and task are not fault-tolerant | 1.The task is in progress
2. Worker hangs first, then hangs master
3.start the master and worker again, the process instance and task are not fault-tolerant,Status has been in progress


**Which version of Dolphin Scheduler:**
-[dev]
| https://github.com/apache/dolphinscheduler/issues/2499 | https://github.com/apache/dolphinscheduler/pull/2833 | f25069bf839cb76c6dd3bcd58887040f8317d7f6 | d67436ffad7afe4985d843bc63cab260667ed7d7 | "2020-04-23T03:05:33Z" | java | "2020-05-28T04:31:12Z" | dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/zk/AbstractZKClient.java | logger.error("get server list failed", e);
}
return masterMap;
}
/**
* check the zookeeper node already exists
* @param host host
* @param zkNodeType zookeeper node type
* @return true if exists
*/
public boolean checkZKNodeExists(String host, ZKNodeType zkNodeType) {
String path = getZNodeParentPath(zkNodeType);
if(StringUtils.isEmpty(path)){
logger.error("check zk node exists error, host:{}, zk node type:{}",
host, zkNodeType.toString());
return false;
}
Map<String, String> serverMaps = getServerMaps(zkNodeType);
for(String hostKey : serverMaps.keySet()){
if(hostKey.startsWith(host)){
return true;
}
}
return false;
}
/**
*
* @return get worker node parent path
*/
protected String getWorkerZNodeParentPath(){ |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,499 | [BUG]The task is in progress, the master and worker hang up , start the master and worker again, the process instance and task are not fault-tolerant | 1.The task is in progress
2. Worker hangs first, then hangs master
3.start the master and worker again, the process instance and task are not fault-tolerant,Status has been in progress


**Which version of Dolphin Scheduler:**
-[dev]
| https://github.com/apache/dolphinscheduler/issues/2499 | https://github.com/apache/dolphinscheduler/pull/2833 | f25069bf839cb76c6dd3bcd58887040f8317d7f6 | d67436ffad7afe4985d843bc63cab260667ed7d7 | "2020-04-23T03:05:33Z" | java | "2020-05-28T04:31:12Z" | dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/zk/AbstractZKClient.java | return getZookeeperConfig().getDsRoot() + Constants.ZOOKEEPER_DOLPHINSCHEDULER_WORKERS;
}
/**
*
* @return get master node parent path
*/
protected String getMasterZNodeParentPath(){
return getZookeeperConfig().getDsRoot() + Constants.ZOOKEEPER_DOLPHINSCHEDULER_MASTERS;
}
/**
*
* @return get master lock path
*/
public String getMasterLockPath(){
return getZookeeperConfig().getDsRoot() + Constants.ZOOKEEPER_DOLPHINSCHEDULER_LOCK_MASTERS;
}
/**
*
* @param zkNodeType zookeeper node type
* @return get zookeeper node parent path
*/
public String getZNodeParentPath(ZKNodeType zkNodeType) {
String path = "";
switch (zkNodeType){
case MASTER:
return getMasterZNodeParentPath();
case WORKER:
return getWorkerZNodeParentPath();
case DEAD_SERVER:
return getDeadZNodeParentPath(); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,499 | [BUG]The task is in progress, the master and worker hang up , start the master and worker again, the process instance and task are not fault-tolerant | 1.The task is in progress
2. Worker hangs first, then hangs master
3.start the master and worker again, the process instance and task are not fault-tolerant,Status has been in progress


**Which version of Dolphin Scheduler:**
-[dev]
| https://github.com/apache/dolphinscheduler/issues/2499 | https://github.com/apache/dolphinscheduler/pull/2833 | f25069bf839cb76c6dd3bcd58887040f8317d7f6 | d67436ffad7afe4985d843bc63cab260667ed7d7 | "2020-04-23T03:05:33Z" | java | "2020-05-28T04:31:12Z" | dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/zk/AbstractZKClient.java | default:
break;
}
return path;
}
/**
*
* @return get dead server node parent path
*/
protected String getDeadZNodeParentPath(){
return getZookeeperConfig().getDsRoot() + Constants.ZOOKEEPER_DOLPHINSCHEDULER_DEAD_SERVERS;
}
/**
*
* @return get master start up lock path
*/
public String getMasterStartUpLockPath(){
return getZookeeperConfig().getDsRoot() + Constants.ZOOKEEPER_DOLPHINSCHEDULER_LOCK_FAILOVER_STARTUP_MASTERS;
}
/**
*
* @return get master failover lock path
*/
public String getMasterFailoverLockPath(){
return getZookeeperConfig().getDsRoot() + Constants.ZOOKEEPER_DOLPHINSCHEDULER_LOCK_FAILOVER_MASTERS;
}
/**
*
* @return get worker failover lock path
*/ |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,499 | [BUG]The task is in progress, the master and worker hang up , start the master and worker again, the process instance and task are not fault-tolerant | 1.The task is in progress
2. Worker hangs first, then hangs master
3.start the master and worker again, the process instance and task are not fault-tolerant,Status has been in progress


**Which version of Dolphin Scheduler:**
-[dev]
| https://github.com/apache/dolphinscheduler/issues/2499 | https://github.com/apache/dolphinscheduler/pull/2833 | f25069bf839cb76c6dd3bcd58887040f8317d7f6 | d67436ffad7afe4985d843bc63cab260667ed7d7 | "2020-04-23T03:05:33Z" | java | "2020-05-28T04:31:12Z" | dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/zk/AbstractZKClient.java | public String getWorkerFailoverLockPath(){
return getZookeeperConfig().getDsRoot() + Constants.ZOOKEEPER_DOLPHINSCHEDULER_LOCK_FAILOVER_WORKERS;
}
/**
* release mutex
* @param mutex mutex
*/
public void releaseMutex(InterProcessMutex mutex) {
if (mutex != null){
try {
mutex.release();
} catch (Exception e) {
if(e.getMessage().equals("instance must be started before calling this method")){
logger.warn("lock release");
}else{
logger.error("lock release failed",e);
}
}
}
}
/**
* init system znode
*/
protected void initSystemZNode(){
try {
persist(getMasterZNodeParentPath(), "");
persist(getWorkerZNodeParentPath(), "");
persist(getDeadZNodeParentPath(), "");
logger.info("initialize server nodes success.");
} catch (Exception e) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,499 | [BUG]The task is in progress, the master and worker hang up , start the master and worker again, the process instance and task are not fault-tolerant | 1.The task is in progress
2. Worker hangs first, then hangs master
3.start the master and worker again, the process instance and task are not fault-tolerant,Status has been in progress


**Which version of Dolphin Scheduler:**
-[dev]
| https://github.com/apache/dolphinscheduler/issues/2499 | https://github.com/apache/dolphinscheduler/pull/2833 | f25069bf839cb76c6dd3bcd58887040f8317d7f6 | d67436ffad7afe4985d843bc63cab260667ed7d7 | "2020-04-23T03:05:33Z" | java | "2020-05-28T04:31:12Z" | dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/zk/AbstractZKClient.java | logger.error("init system znode failed",e);
}
}
/**
* get host ip, string format: masterParentPath/ip
* @param path path
* @return host ip, string format: masterParentPath/ip
*/
protected String getHostByEventDataPath(String path) {
if(StringUtils.isEmpty(path)){
logger.error("empty path!");
return "";
}
String[] pathArray = path.split(SINGLE_SLASH);
if(pathArray.length < 1){
logger.error("parse ip error: {}", path);
return "";
}
return pathArray[pathArray.length - 1];
}
@Override
public String toString() {
return "AbstractZKClient{" +
"zkClient=" + zkClient +
", deadServerZNodeParentPath='" + getZNodeParentPath(ZKNodeType.DEAD_SERVER) + '\'' +
", masterZNodeParentPath='" + getZNodeParentPath(ZKNodeType.MASTER) + '\'' +
", workerZNodeParentPath='" + getZNodeParentPath(ZKNodeType.WORKER) + '\'' +
'}';
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,619 | [BUG] /dolphinscheduler/projects/create doesn't return project ID when create successfuly |
**Describe the bug**
V1.2.0, when invoke /dolphinscheduler/projects/create, it doesn't return project ID when create successfuly just return
{
"code": 0,
"msg": "success",
"data": null
}
**Expected behavior**
it should return project ID, otherwise, how can I build relationship between dolphin and my system.
**Which version of Dolphin Scheduler:**
-[1.2.0]
**Additional context**
Add any other context about the problem here.
**Requirement or improvement
- Please fix this or tell me how to get project ID for newly created project.
| https://github.com/apache/dolphinscheduler/issues/2619 | https://github.com/apache/dolphinscheduler/pull/2804 | e89f543f04872b2b7d8d3c5cd94e68cd4ddaab7e | fbb8ff438ad0c0db1bfc78d33bbc73b2c7d40683 | "2020-05-07T08:17:58Z" | java | "2020-05-30T04:45:39Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProjectService.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 |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,619 | [BUG] /dolphinscheduler/projects/create doesn't return project ID when create successfuly |
**Describe the bug**
V1.2.0, when invoke /dolphinscheduler/projects/create, it doesn't return project ID when create successfuly just return
{
"code": 0,
"msg": "success",
"data": null
}
**Expected behavior**
it should return project ID, otherwise, how can I build relationship between dolphin and my system.
**Which version of Dolphin Scheduler:**
-[1.2.0]
**Additional context**
Add any other context about the problem here.
**Requirement or improvement
- Please fix this or tell me how to get project ID for newly created project.
| https://github.com/apache/dolphinscheduler/issues/2619 | https://github.com/apache/dolphinscheduler/pull/2804 | e89f543f04872b2b7d8d3c5cd94e68cd4ddaab7e | fbb8ff438ad0c0db1bfc78d33bbc73b2c7d40683 | "2020-05-07T08:17:58Z" | java | "2020-05-30T04:45:39Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProjectService.java | * 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.api.service;
import org.apache.dolphinscheduler.api.enums.Status;
import org.apache.dolphinscheduler.api.utils.PageInfo;
import org.apache.dolphinscheduler.common.Constants;
import org.apache.dolphinscheduler.common.enums.UserType;
import org.apache.dolphinscheduler.dao.entity.ProcessDefinition;
import org.apache.dolphinscheduler.dao.entity.Project;
import org.apache.dolphinscheduler.dao.entity.ProjectUser;
import org.apache.dolphinscheduler.dao.entity.User;
import org.apache.dolphinscheduler.dao.mapper.ProcessDefinitionMapper;
import org.apache.dolphinscheduler.dao.mapper.ProjectMapper;
import org.apache.dolphinscheduler.dao.mapper.ProjectUserMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
import static org.apache.dolphinscheduler.api.utils.CheckUtils.checkDesc;
/**
* project service
*HttpTask./
**/
@Service |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,619 | [BUG] /dolphinscheduler/projects/create doesn't return project ID when create successfuly |
**Describe the bug**
V1.2.0, when invoke /dolphinscheduler/projects/create, it doesn't return project ID when create successfuly just return
{
"code": 0,
"msg": "success",
"data": null
}
**Expected behavior**
it should return project ID, otherwise, how can I build relationship between dolphin and my system.
**Which version of Dolphin Scheduler:**
-[1.2.0]
**Additional context**
Add any other context about the problem here.
**Requirement or improvement
- Please fix this or tell me how to get project ID for newly created project.
| https://github.com/apache/dolphinscheduler/issues/2619 | https://github.com/apache/dolphinscheduler/pull/2804 | e89f543f04872b2b7d8d3c5cd94e68cd4ddaab7e | fbb8ff438ad0c0db1bfc78d33bbc73b2c7d40683 | "2020-05-07T08:17:58Z" | java | "2020-05-30T04:45:39Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProjectService.java | public class ProjectService extends BaseService{
private static final Logger logger = LoggerFactory.getLogger(ProjectService.class);
@Autowired
private ProjectMapper projectMapper;
@Autowired
private ProjectUserMapper projectUserMapper;
@Autowired
private ProcessDefinitionMapper processDefinitionMapper;
/**
* create project
*
* @param loginUser login user
* @param name project name
* @param desc description
* @return returns an error if it exists
*/
public Map<String, Object> createProject(User loginUser, String name, String desc) {
Map<String, Object> result = new HashMap<>(5);
Map<String, Object> descCheck = checkDesc(desc);
if (descCheck.get(Constants.STATUS) != Status.SUCCESS) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,619 | [BUG] /dolphinscheduler/projects/create doesn't return project ID when create successfuly |
**Describe the bug**
V1.2.0, when invoke /dolphinscheduler/projects/create, it doesn't return project ID when create successfuly just return
{
"code": 0,
"msg": "success",
"data": null
}
**Expected behavior**
it should return project ID, otherwise, how can I build relationship between dolphin and my system.
**Which version of Dolphin Scheduler:**
-[1.2.0]
**Additional context**
Add any other context about the problem here.
**Requirement or improvement
- Please fix this or tell me how to get project ID for newly created project.
| https://github.com/apache/dolphinscheduler/issues/2619 | https://github.com/apache/dolphinscheduler/pull/2804 | e89f543f04872b2b7d8d3c5cd94e68cd4ddaab7e | fbb8ff438ad0c0db1bfc78d33bbc73b2c7d40683 | "2020-05-07T08:17:58Z" | java | "2020-05-30T04:45:39Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProjectService.java | return descCheck;
}
Project project = projectMapper.queryByName(name);
if (project != null) {
putMsg(result, Status.PROJECT_ALREADY_EXISTS, name);
return result;
}
project = new Project();
Date now = new Date();
project.setName(name);
project.setDescription(desc);
project.setUserId(loginUser.getId());
project.setUserName(loginUser.getUserName());
project.setCreateTime(now);
project.setUpdateTime(now);
if (projectMapper.insert(project) > 0) {
putMsg(result, Status.SUCCESS);
} else {
putMsg(result, Status.CREATE_PROJECT_ERROR);
}
return result;
}
/**
* query project details by id
*
* @param projectId project id
* @return project detail information
*/
public Map<String, Object> queryById(Integer projectId) {
Map<String, Object> result = new HashMap<>(5); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,619 | [BUG] /dolphinscheduler/projects/create doesn't return project ID when create successfuly |
**Describe the bug**
V1.2.0, when invoke /dolphinscheduler/projects/create, it doesn't return project ID when create successfuly just return
{
"code": 0,
"msg": "success",
"data": null
}
**Expected behavior**
it should return project ID, otherwise, how can I build relationship between dolphin and my system.
**Which version of Dolphin Scheduler:**
-[1.2.0]
**Additional context**
Add any other context about the problem here.
**Requirement or improvement
- Please fix this or tell me how to get project ID for newly created project.
| https://github.com/apache/dolphinscheduler/issues/2619 | https://github.com/apache/dolphinscheduler/pull/2804 | e89f543f04872b2b7d8d3c5cd94e68cd4ddaab7e | fbb8ff438ad0c0db1bfc78d33bbc73b2c7d40683 | "2020-05-07T08:17:58Z" | java | "2020-05-30T04:45:39Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProjectService.java | Project project = projectMapper.selectById(projectId);
if (project != null) {
result.put(Constants.DATA_LIST, project);
putMsg(result, Status.SUCCESS);
} else {
putMsg(result, Status.PROJECT_NOT_FOUNT, projectId);
}
return result;
}
/**
* check project and authorization
*
* @param loginUser login user
* @param project project
* @param projectName project name
* @return true if the login user have permission to see the project
*/
public Map<String, Object> checkProjectAndAuth(User loginUser, Project project, String projectName) {
Map<String, Object> result = new HashMap<>(5);
if (project == null) {
putMsg(result, Status.PROJECT_NOT_FOUNT, projectName);
} else if (!checkReadPermission(loginUser, project)) {
putMsg(result, Status.USER_NO_OPERATION_PROJECT_PERM, loginUser.getUserName(), projectName);
}else {
putMsg(result, Status.SUCCESS);
}
return result;
}
public boolean hasProjectAndPerm(User loginUser, Project project, Map<String, Object> result) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,619 | [BUG] /dolphinscheduler/projects/create doesn't return project ID when create successfuly |
**Describe the bug**
V1.2.0, when invoke /dolphinscheduler/projects/create, it doesn't return project ID when create successfuly just return
{
"code": 0,
"msg": "success",
"data": null
}
**Expected behavior**
it should return project ID, otherwise, how can I build relationship between dolphin and my system.
**Which version of Dolphin Scheduler:**
-[1.2.0]
**Additional context**
Add any other context about the problem here.
**Requirement or improvement
- Please fix this or tell me how to get project ID for newly created project.
| https://github.com/apache/dolphinscheduler/issues/2619 | https://github.com/apache/dolphinscheduler/pull/2804 | e89f543f04872b2b7d8d3c5cd94e68cd4ddaab7e | fbb8ff438ad0c0db1bfc78d33bbc73b2c7d40683 | "2020-05-07T08:17:58Z" | java | "2020-05-30T04:45:39Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProjectService.java | boolean checkResult = false;
if (project == null) {
putMsg(result, Status.PROJECT_NOT_FOUNT, "");
} else if (!checkReadPermission(loginUser, project)) {
putMsg(result, Status.USER_NO_OPERATION_PROJECT_PERM, loginUser.getUserName(), project.getName());
} else {
checkResult = true;
}
return checkResult;
}
/**
* admin can view all projects
*
* @param loginUser login user
* @param searchVal search value
* @param pageSize page size
* @param pageNo page number
* @return project list which the login user have permission to see
*/
public Map<String, Object> queryProjectListPaging(User loginUser, Integer pageSize, Integer pageNo, String searchVal) {
Map<String, Object> result = new HashMap<>();
PageInfo pageInfo = new PageInfo<Project>(pageNo, pageSize);
Page<Project> page = new Page(pageNo, pageSize);
int userId = loginUser.getUserType() == UserType.ADMIN_USER ? 0 : loginUser.getId();
IPage<Project> projectIPage = projectMapper.queryProjectListPaging(page, userId, searchVal);
List<Project> projectList = projectIPage.getRecords();
if(userId != 0){
for (Project project : projectList) {
project.setPerm(org.apache.dolphinscheduler.common.Constants.DEFAULT_ADMIN_PERMISSION);
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,619 | [BUG] /dolphinscheduler/projects/create doesn't return project ID when create successfuly |
**Describe the bug**
V1.2.0, when invoke /dolphinscheduler/projects/create, it doesn't return project ID when create successfuly just return
{
"code": 0,
"msg": "success",
"data": null
}
**Expected behavior**
it should return project ID, otherwise, how can I build relationship between dolphin and my system.
**Which version of Dolphin Scheduler:**
-[1.2.0]
**Additional context**
Add any other context about the problem here.
**Requirement or improvement
- Please fix this or tell me how to get project ID for newly created project.
| https://github.com/apache/dolphinscheduler/issues/2619 | https://github.com/apache/dolphinscheduler/pull/2804 | e89f543f04872b2b7d8d3c5cd94e68cd4ddaab7e | fbb8ff438ad0c0db1bfc78d33bbc73b2c7d40683 | "2020-05-07T08:17:58Z" | java | "2020-05-30T04:45:39Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProjectService.java | }
pageInfo.setTotalCount((int)projectIPage.getTotal());
pageInfo.setLists(projectList);
result.put(Constants.COUNT, (int)projectIPage.getTotal());
result.put(Constants.DATA_LIST, pageInfo);
putMsg(result, Status.SUCCESS);
return result;
}
/**
* delete project by id
*
* @param loginUser login user
* @param projectId project id
* @return delete result code
*/
public Map<String, Object> deleteProject(User loginUser, Integer projectId) {
Map<String, Object> result = new HashMap<>(5);
Project project = projectMapper.selectById(projectId);
Map<String, Object> checkResult = getCheckResult(loginUser, project);
if (checkResult != null) {
return checkResult;
}
if (!hasPerm(loginUser, project.getUserId())) {
putMsg(result, Status.USER_NO_OPERATION_PERM);
return result;
}
List<ProcessDefinition> processDefinitionList = processDefinitionMapper.queryAllDefinitionList(projectId);
if(processDefinitionList.size() > 0){
putMsg(result, Status.DELETE_PROJECT_ERROR_DEFINES_NOT_NULL);
return result; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,619 | [BUG] /dolphinscheduler/projects/create doesn't return project ID when create successfuly |
**Describe the bug**
V1.2.0, when invoke /dolphinscheduler/projects/create, it doesn't return project ID when create successfuly just return
{
"code": 0,
"msg": "success",
"data": null
}
**Expected behavior**
it should return project ID, otherwise, how can I build relationship between dolphin and my system.
**Which version of Dolphin Scheduler:**
-[1.2.0]
**Additional context**
Add any other context about the problem here.
**Requirement or improvement
- Please fix this or tell me how to get project ID for newly created project.
| https://github.com/apache/dolphinscheduler/issues/2619 | https://github.com/apache/dolphinscheduler/pull/2804 | e89f543f04872b2b7d8d3c5cd94e68cd4ddaab7e | fbb8ff438ad0c0db1bfc78d33bbc73b2c7d40683 | "2020-05-07T08:17:58Z" | java | "2020-05-30T04:45:39Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProjectService.java | }
int delete = projectMapper.deleteById(projectId);
if (delete > 0) {
putMsg(result, Status.SUCCESS);
} else {
putMsg(result, Status.DELETE_PROJECT_ERROR);
}
return result;
}
/**
* get check result
*
* @param loginUser login user
* @param project project
* @return check result
*/
private Map<String, Object> getCheckResult(User loginUser, Project project) {
String projectName = project == null ? null:project.getName();
Map<String, Object> checkResult = checkProjectAndAuth(loginUser, project, projectName);
Status status = (Status) checkResult.get(Constants.STATUS);
if (status != Status.SUCCESS) {
return checkResult;
}
return null;
}
/**
* updateProcessInstance project
*
* @param loginUser login user
* @param projectId project id |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,619 | [BUG] /dolphinscheduler/projects/create doesn't return project ID when create successfuly |
**Describe the bug**
V1.2.0, when invoke /dolphinscheduler/projects/create, it doesn't return project ID when create successfuly just return
{
"code": 0,
"msg": "success",
"data": null
}
**Expected behavior**
it should return project ID, otherwise, how can I build relationship between dolphin and my system.
**Which version of Dolphin Scheduler:**
-[1.2.0]
**Additional context**
Add any other context about the problem here.
**Requirement or improvement
- Please fix this or tell me how to get project ID for newly created project.
| https://github.com/apache/dolphinscheduler/issues/2619 | https://github.com/apache/dolphinscheduler/pull/2804 | e89f543f04872b2b7d8d3c5cd94e68cd4ddaab7e | fbb8ff438ad0c0db1bfc78d33bbc73b2c7d40683 | "2020-05-07T08:17:58Z" | java | "2020-05-30T04:45:39Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProjectService.java | * @param projectName project name
* @param desc description
* @return update result code
*/
public Map<String, Object> update(User loginUser, Integer projectId, String projectName, String desc) {
Map<String, Object> result = new HashMap<>(5);
Map<String, Object> descCheck = checkDesc(desc);
if (descCheck.get(Constants.STATUS) != Status.SUCCESS) {
return descCheck;
}
Project project = projectMapper.selectById(projectId);
boolean hasProjectAndPerm = hasProjectAndPerm(loginUser, project, result);
if (!hasProjectAndPerm) {
return result;
}
Project tempProject = projectMapper.queryByName(projectName);
if (tempProject != null && tempProject.getId() != projectId) {
putMsg(result, Status.PROJECT_ALREADY_EXISTS, projectName);
return result;
}
project.setName(projectName);
project.setDescription(desc);
project.setUpdateTime(new Date());
int update = projectMapper.updateById(project);
if (update > 0) {
putMsg(result, Status.SUCCESS);
} else {
putMsg(result, Status.UPDATE_PROJECT_ERROR);
}
return result; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,619 | [BUG] /dolphinscheduler/projects/create doesn't return project ID when create successfuly |
**Describe the bug**
V1.2.0, when invoke /dolphinscheduler/projects/create, it doesn't return project ID when create successfuly just return
{
"code": 0,
"msg": "success",
"data": null
}
**Expected behavior**
it should return project ID, otherwise, how can I build relationship between dolphin and my system.
**Which version of Dolphin Scheduler:**
-[1.2.0]
**Additional context**
Add any other context about the problem here.
**Requirement or improvement
- Please fix this or tell me how to get project ID for newly created project.
| https://github.com/apache/dolphinscheduler/issues/2619 | https://github.com/apache/dolphinscheduler/pull/2804 | e89f543f04872b2b7d8d3c5cd94e68cd4ddaab7e | fbb8ff438ad0c0db1bfc78d33bbc73b2c7d40683 | "2020-05-07T08:17:58Z" | java | "2020-05-30T04:45:39Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProjectService.java | }
/**
* query unauthorized project
*
* @param loginUser login user
* @param userId user id
* @return the projects which user have not permission to see
*/
public Map<String, Object> queryUnauthorizedProject(User loginUser, Integer userId) {
Map<String, Object> result = new HashMap<>(5);
if (checkAdmin(loginUser, result)) {
return result;
}
/**
* query all project list except specified userId
*/
List<Project> projectList = projectMapper.queryProjectExceptUserId(userId);
List<Project> resultList = new ArrayList<>();
Set<Project> projectSet = null;
if (projectList != null && projectList.size() > 0) {
projectSet = new HashSet<>(projectList);
List<Project> authedProjectList = projectMapper.queryAuthedProjectListByUserId(userId);
resultList = getUnauthorizedProjects(projectSet, authedProjectList);
}
result.put(Constants.DATA_LIST, resultList);
putMsg(result,Status.SUCCESS);
return result;
}
/**
* get unauthorized project |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,619 | [BUG] /dolphinscheduler/projects/create doesn't return project ID when create successfuly |
**Describe the bug**
V1.2.0, when invoke /dolphinscheduler/projects/create, it doesn't return project ID when create successfuly just return
{
"code": 0,
"msg": "success",
"data": null
}
**Expected behavior**
it should return project ID, otherwise, how can I build relationship between dolphin and my system.
**Which version of Dolphin Scheduler:**
-[1.2.0]
**Additional context**
Add any other context about the problem here.
**Requirement or improvement
- Please fix this or tell me how to get project ID for newly created project.
| https://github.com/apache/dolphinscheduler/issues/2619 | https://github.com/apache/dolphinscheduler/pull/2804 | e89f543f04872b2b7d8d3c5cd94e68cd4ddaab7e | fbb8ff438ad0c0db1bfc78d33bbc73b2c7d40683 | "2020-05-07T08:17:58Z" | java | "2020-05-30T04:45:39Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProjectService.java | *
* @param projectSet project set
* @param authedProjectList authed project list
* @return project list that authorization
*/
private List<Project> getUnauthorizedProjects(Set<Project> projectSet, List<Project> authedProjectList) {
List<Project> resultList;
Set<Project> authedProjectSet = null;
if (authedProjectList != null && authedProjectList.size() > 0) {
authedProjectSet = new HashSet<>(authedProjectList);
projectSet.removeAll(authedProjectSet);
}
resultList = new ArrayList<>(projectSet);
return resultList;
}
/**
* query authorized project
*
* @param loginUser login user
* @param userId user id
* @return projects which the user have permission to see, Except for items created by this user
*/
public Map<String, Object> queryAuthorizedProject(User loginUser, Integer userId) {
Map<String, Object> result = new HashMap<>();
if (checkAdmin(loginUser, result)) {
return result;
}
List<Project> projects = projectMapper.queryAuthedProjectListByUserId(userId);
result.put(Constants.DATA_LIST, projects);
putMsg(result,Status.SUCCESS); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,619 | [BUG] /dolphinscheduler/projects/create doesn't return project ID when create successfuly |
**Describe the bug**
V1.2.0, when invoke /dolphinscheduler/projects/create, it doesn't return project ID when create successfuly just return
{
"code": 0,
"msg": "success",
"data": null
}
**Expected behavior**
it should return project ID, otherwise, how can I build relationship between dolphin and my system.
**Which version of Dolphin Scheduler:**
-[1.2.0]
**Additional context**
Add any other context about the problem here.
**Requirement or improvement
- Please fix this or tell me how to get project ID for newly created project.
| https://github.com/apache/dolphinscheduler/issues/2619 | https://github.com/apache/dolphinscheduler/pull/2804 | e89f543f04872b2b7d8d3c5cd94e68cd4ddaab7e | fbb8ff438ad0c0db1bfc78d33bbc73b2c7d40683 | "2020-05-07T08:17:58Z" | java | "2020-05-30T04:45:39Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProjectService.java | return result;
}
/**
* check whether have read permission
*
* @param user user
* @param project project
* @return true if the user have permission to see the project, otherwise return false
*/
private boolean checkReadPermission(User user, Project project) {
int permissionId = queryPermission(user, project);
return (permissionId & Constants.READ_PERMISSION) != 0;
}
/**
* query permission id
*
* @param user user
* @param project project
* @return permission
*/
private int queryPermission(User user, Project project) {
if (user.getUserType() == UserType.ADMIN_USER) {
return Constants.READ_PERMISSION;
}
if (project.getUserId() == user.getId()) {
return Constants.ALL_PERMISSIONS;
}
ProjectUser projectUser = projectUserMapper.queryProjectRelation(project.getId(), user.getId());
if (projectUser == null) {
return 0; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,619 | [BUG] /dolphinscheduler/projects/create doesn't return project ID when create successfuly |
**Describe the bug**
V1.2.0, when invoke /dolphinscheduler/projects/create, it doesn't return project ID when create successfuly just return
{
"code": 0,
"msg": "success",
"data": null
}
**Expected behavior**
it should return project ID, otherwise, how can I build relationship between dolphin and my system.
**Which version of Dolphin Scheduler:**
-[1.2.0]
**Additional context**
Add any other context about the problem here.
**Requirement or improvement
- Please fix this or tell me how to get project ID for newly created project.
| https://github.com/apache/dolphinscheduler/issues/2619 | https://github.com/apache/dolphinscheduler/pull/2804 | e89f543f04872b2b7d8d3c5cd94e68cd4ddaab7e | fbb8ff438ad0c0db1bfc78d33bbc73b2c7d40683 | "2020-05-07T08:17:58Z" | java | "2020-05-30T04:45:39Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProjectService.java | }
return projectUser.getPerm();
}
/**
* query all project list that have one or more process definitions.
* @return project list
*/
public Map<String, Object> queryAllProjectList() {
Map<String, Object> result = new HashMap<>();
List<Project> projects = projectMapper.selectList(null);
List<ProcessDefinition> processDefinitions = processDefinitionMapper.selectList(null);
if(projects != null){
Set set = new HashSet<>();
for (ProcessDefinition processDefinition : processDefinitions){
set.add(processDefinition.getProjectId());
}
List<Project> tempDeletelist = new ArrayList<Project>();
for (Project project : projects) {
if(!set.contains(project.getId())){
tempDeletelist.add(project);
}
}
projects.removeAll(tempDeletelist);
}
result.put(Constants.DATA_LIST, projects);
putMsg(result,Status.SUCCESS);
return result;
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,619 | [BUG] /dolphinscheduler/projects/create doesn't return project ID when create successfuly |
**Describe the bug**
V1.2.0, when invoke /dolphinscheduler/projects/create, it doesn't return project ID when create successfuly just return
{
"code": 0,
"msg": "success",
"data": null
}
**Expected behavior**
it should return project ID, otherwise, how can I build relationship between dolphin and my system.
**Which version of Dolphin Scheduler:**
-[1.2.0]
**Additional context**
Add any other context about the problem here.
**Requirement or improvement
- Please fix this or tell me how to get project ID for newly created project.
| https://github.com/apache/dolphinscheduler/issues/2619 | https://github.com/apache/dolphinscheduler/pull/2804 | e89f543f04872b2b7d8d3c5cd94e68cd4ddaab7e | fbb8ff438ad0c0db1bfc78d33bbc73b2c7d40683 | "2020-05-07T08:17:58Z" | java | "2020-05-30T04:45:39Z" | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/ProjectControllerTest.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.api.controller;
import org.apache.dolphinscheduler.api.enums.Status;
import org.apache.dolphinscheduler.api.utils.Result;
import org.apache.dolphinscheduler.common.utils.JSONUtils;
import org.junit.Assert; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,619 | [BUG] /dolphinscheduler/projects/create doesn't return project ID when create successfuly |
**Describe the bug**
V1.2.0, when invoke /dolphinscheduler/projects/create, it doesn't return project ID when create successfuly just return
{
"code": 0,
"msg": "success",
"data": null
}
**Expected behavior**
it should return project ID, otherwise, how can I build relationship between dolphin and my system.
**Which version of Dolphin Scheduler:**
-[1.2.0]
**Additional context**
Add any other context about the problem here.
**Requirement or improvement
- Please fix this or tell me how to get project ID for newly created project.
| https://github.com/apache/dolphinscheduler/issues/2619 | https://github.com/apache/dolphinscheduler/pull/2804 | e89f543f04872b2b7d8d3c5cd94e68cd4ddaab7e | fbb8ff438ad0c0db1bfc78d33bbc73b2c7d40683 | "2020-05-07T08:17:58Z" | java | "2020-05-30T04:45:39Z" | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/ProjectControllerTest.java | import org.junit.Ignore;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.MediaType;
import org.springframework.test.web.servlet.MvcResult;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
/**
* project controller
*/
public class ProjectControllerTest extends AbstractControllerTest{
private static Logger logger = LoggerFactory.getLogger(ProjectControllerTest.class);
@Test
public void testCreateProject() throws Exception {
MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>();
paramsMap.add("projectName","project_test1");
paramsMap.add("desc","the test project");
MvcResult mvcResult = mockMvc.perform(post("/projects/create")
.header(SESSION_ID, sessionId)
.params(paramsMap))
.andExpect(status().isCreated())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8))
.andReturn();
Result result = JSONUtils.parseObject(mvcResult.getResponse().getContentAsString(), Result.class);
Assert.assertEquals(Status.SUCCESS.getCode(),result.getCode().intValue()); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,619 | [BUG] /dolphinscheduler/projects/create doesn't return project ID when create successfuly |
**Describe the bug**
V1.2.0, when invoke /dolphinscheduler/projects/create, it doesn't return project ID when create successfuly just return
{
"code": 0,
"msg": "success",
"data": null
}
**Expected behavior**
it should return project ID, otherwise, how can I build relationship between dolphin and my system.
**Which version of Dolphin Scheduler:**
-[1.2.0]
**Additional context**
Add any other context about the problem here.
**Requirement or improvement
- Please fix this or tell me how to get project ID for newly created project.
| https://github.com/apache/dolphinscheduler/issues/2619 | https://github.com/apache/dolphinscheduler/pull/2804 | e89f543f04872b2b7d8d3c5cd94e68cd4ddaab7e | fbb8ff438ad0c0db1bfc78d33bbc73b2c7d40683 | "2020-05-07T08:17:58Z" | java | "2020-05-30T04:45:39Z" | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/ProjectControllerTest.java | logger.info(mvcResult.getResponse().getContentAsString());
}
@Test
public void testUpdateProject() throws Exception {
MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>();
paramsMap.add("projectId","18");
paramsMap.add("projectName","project_test_update");
paramsMap.add("desc","the test project update");
MvcResult mvcResult = mockMvc.perform(post("/projects/update")
.header(SESSION_ID, sessionId)
.params(paramsMap))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8))
.andReturn();
Result result = JSONUtils.parseObject(mvcResult.getResponse().getContentAsString(), Result.class);
Assert.assertEquals(Status.SUCCESS.getCode(),result.getCode().intValue());
logger.info(mvcResult.getResponse().getContentAsString());
}
@Test
public void testQueryProjectById() throws Exception {
MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>();
paramsMap.add("projectId","18");
MvcResult mvcResult = mockMvc.perform(get("/projects/query-by-id")
.header(SESSION_ID, sessionId)
.params(paramsMap))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8))
.andReturn();
Result result = JSONUtils.parseObject(mvcResult.getResponse().getContentAsString(), Result.class);
Assert.assertEquals(Status.SUCCESS.getCode(),result.getCode().intValue()); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,619 | [BUG] /dolphinscheduler/projects/create doesn't return project ID when create successfuly |
**Describe the bug**
V1.2.0, when invoke /dolphinscheduler/projects/create, it doesn't return project ID when create successfuly just return
{
"code": 0,
"msg": "success",
"data": null
}
**Expected behavior**
it should return project ID, otherwise, how can I build relationship between dolphin and my system.
**Which version of Dolphin Scheduler:**
-[1.2.0]
**Additional context**
Add any other context about the problem here.
**Requirement or improvement
- Please fix this or tell me how to get project ID for newly created project.
| https://github.com/apache/dolphinscheduler/issues/2619 | https://github.com/apache/dolphinscheduler/pull/2804 | e89f543f04872b2b7d8d3c5cd94e68cd4ddaab7e | fbb8ff438ad0c0db1bfc78d33bbc73b2c7d40683 | "2020-05-07T08:17:58Z" | java | "2020-05-30T04:45:39Z" | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/ProjectControllerTest.java | logger.info(mvcResult.getResponse().getContentAsString());
}
@Test
public void testQueryProjectListPaging() throws Exception {
MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>();
paramsMap.add("searchVal","test");
paramsMap.add("pageSize","2");
paramsMap.add("pageNo","2");
MvcResult mvcResult = mockMvc.perform(get("/projects/list-paging")
.header(SESSION_ID, sessionId)
.params(paramsMap))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8))
.andReturn();
Result result = JSONUtils.parseObject(mvcResult.getResponse().getContentAsString(), Result.class);
Assert.assertEquals(Status.SUCCESS.getCode(),result.getCode().intValue());
logger.info(mvcResult.getResponse().getContentAsString());
}
@Test
public void testQueryUnauthorizedProject() throws Exception {
MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>();
paramsMap.add("userId","2");
MvcResult mvcResult = mockMvc.perform(get("/projects/unauth-project")
.header(SESSION_ID, sessionId)
.params(paramsMap))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8))
.andReturn();
Result result = JSONUtils.parseObject(mvcResult.getResponse().getContentAsString(), Result.class);
Assert.assertEquals(Status.SUCCESS.getCode(),result.getCode().intValue()); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,619 | [BUG] /dolphinscheduler/projects/create doesn't return project ID when create successfuly |
**Describe the bug**
V1.2.0, when invoke /dolphinscheduler/projects/create, it doesn't return project ID when create successfuly just return
{
"code": 0,
"msg": "success",
"data": null
}
**Expected behavior**
it should return project ID, otherwise, how can I build relationship between dolphin and my system.
**Which version of Dolphin Scheduler:**
-[1.2.0]
**Additional context**
Add any other context about the problem here.
**Requirement or improvement
- Please fix this or tell me how to get project ID for newly created project.
| https://github.com/apache/dolphinscheduler/issues/2619 | https://github.com/apache/dolphinscheduler/pull/2804 | e89f543f04872b2b7d8d3c5cd94e68cd4ddaab7e | fbb8ff438ad0c0db1bfc78d33bbc73b2c7d40683 | "2020-05-07T08:17:58Z" | java | "2020-05-30T04:45:39Z" | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/ProjectControllerTest.java | logger.info(mvcResult.getResponse().getContentAsString());
}
@Test
public void testQueryAuthorizedProject() throws Exception {
MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>();
paramsMap.add("userId","2");
MvcResult mvcResult = mockMvc.perform(get("/projects/authed-project")
.header(SESSION_ID, sessionId)
.params(paramsMap))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8))
.andReturn();
Result result = JSONUtils.parseObject(mvcResult.getResponse().getContentAsString(), Result.class);
Assert.assertEquals(Status.SUCCESS.getCode(),result.getCode().intValue());
logger.info(mvcResult.getResponse().getContentAsString());
}
@Test
public void testQueryAllProjectList() throws Exception {
MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>();
MvcResult mvcResult = mockMvc.perform(get("/projects/query-project-list")
.header(SESSION_ID, sessionId)
.params(paramsMap))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8))
.andReturn();
Result result = JSONUtils.parseObject(mvcResult.getResponse().getContentAsString(), Result.class);
Assert.assertEquals(Status.SUCCESS.getCode(),result.getCode().intValue());
logger.info(mvcResult.getResponse().getContentAsString());
}
@Ignore |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,619 | [BUG] /dolphinscheduler/projects/create doesn't return project ID when create successfuly |
**Describe the bug**
V1.2.0, when invoke /dolphinscheduler/projects/create, it doesn't return project ID when create successfuly just return
{
"code": 0,
"msg": "success",
"data": null
}
**Expected behavior**
it should return project ID, otherwise, how can I build relationship between dolphin and my system.
**Which version of Dolphin Scheduler:**
-[1.2.0]
**Additional context**
Add any other context about the problem here.
**Requirement or improvement
- Please fix this or tell me how to get project ID for newly created project.
| https://github.com/apache/dolphinscheduler/issues/2619 | https://github.com/apache/dolphinscheduler/pull/2804 | e89f543f04872b2b7d8d3c5cd94e68cd4ddaab7e | fbb8ff438ad0c0db1bfc78d33bbc73b2c7d40683 | "2020-05-07T08:17:58Z" | java | "2020-05-30T04:45:39Z" | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/ProjectControllerTest.java | @Test
public void testImportProcessDefinition() throws Exception {
MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>();
paramsMap.add("file","test");
MvcResult mvcResult = mockMvc.perform(post("/projects/import-definition")
.header(SESSION_ID, sessionId)
.params(paramsMap))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.TEXT_PLAIN))
.andReturn();
Result result = JSONUtils.parseObject(mvcResult.getResponse().getContentAsString(), Result.class);
Assert.assertEquals(Status.IMPORT_PROCESS_DEFINE_ERROR.getCode(),result.getCode().intValue());
logger.info(mvcResult.getResponse().getContentAsString());
}
@Test
public void testDeleteProject() throws Exception {
MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>();
paramsMap.add("projectId","18");
MvcResult mvcResult = mockMvc.perform(get("/projects/delete")
.header(SESSION_ID, sessionId)
.params(paramsMap))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8))
.andReturn();
Result result = JSONUtils.parseObject(mvcResult.getResponse().getContentAsString(), Result.class);
Assert.assertEquals(Status.SUCCESS.getCode(),result.getCode().intValue());
logger.info(mvcResult.getResponse().getContentAsString());
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,638 | Improve the security of datasource management | **Is your feature request related to a problem? Please describe.**
Company database account management is relatively strict. We found that when the data source management is updated, the original password is actually brought out.
(公司数据库账号管理比较严格,我们发现目前数据源管理更新得时候实际上是把原始密码给带出来了。)
**Describe the solution you'd like**
The datasources / update-ui interface should not take out the password. The datasources / updateDataSource interface does not update this field without passing the password. You can call the query one more time when the server is updated.
(datasources/update-ui 接口不要将密码带出去,datasources/updateDataSource 接口不传 密码就不更新该字段,服务端更新时可以先多调用一次查询。)
| https://github.com/apache/dolphinscheduler/issues/2638 | https://github.com/apache/dolphinscheduler/pull/2844 | fbb8ff438ad0c0db1bfc78d33bbc73b2c7d40683 | 1c153454423f4b967f3fcd8fb906a4626799872f | "2020-05-08T08:42:20Z" | java | "2020-05-30T07:03:10Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/DataSourceService.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.api.service;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,638 | Improve the security of datasource management | **Is your feature request related to a problem? Please describe.**
Company database account management is relatively strict. We found that when the data source management is updated, the original password is actually brought out.
(公司数据库账号管理比较严格,我们发现目前数据源管理更新得时候实际上是把原始密码给带出来了。)
**Describe the solution you'd like**
The datasources / update-ui interface should not take out the password. The datasources / updateDataSource interface does not update this field without passing the password. You can call the query one more time when the server is updated.
(datasources/update-ui 接口不要将密码带出去,datasources/updateDataSource 接口不传 密码就不更新该字段,服务端更新时可以先多调用一次查询。)
| https://github.com/apache/dolphinscheduler/issues/2638 | https://github.com/apache/dolphinscheduler/pull/2844 | fbb8ff438ad0c0db1bfc78d33bbc73b2c7d40683 | 1c153454423f4b967f3fcd8fb906a4626799872f | "2020-05-08T08:42:20Z" | java | "2020-05-30T07:03:10Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/DataSourceService.java | import org.apache.dolphinscheduler.api.enums.Status;
import org.apache.dolphinscheduler.api.utils.PageInfo;
import org.apache.dolphinscheduler.api.utils.Result;
import org.apache.dolphinscheduler.common.Constants;
import org.apache.dolphinscheduler.common.enums.DbConnectType;
import org.apache.dolphinscheduler.common.enums.DbType;
import org.apache.dolphinscheduler.common.utils.CommonUtils;
import org.apache.dolphinscheduler.common.utils.JSONUtils;
import org.apache.dolphinscheduler.dao.datasource.*;
import org.apache.dolphinscheduler.dao.entity.DataSource;
import org.apache.dolphinscheduler.dao.entity.Resource;
import org.apache.dolphinscheduler.dao.entity.User;
import org.apache.dolphinscheduler.dao.mapper.DataSourceMapper;
import org.apache.dolphinscheduler.dao.mapper.DataSourceUserMapper;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.security.UserGroupInformation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.*;
import static org.apache.dolphinscheduler.common.utils.PropertyUtils.getString;
/**
* datasource service
*/
@Service |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,638 | Improve the security of datasource management | **Is your feature request related to a problem? Please describe.**
Company database account management is relatively strict. We found that when the data source management is updated, the original password is actually brought out.
(公司数据库账号管理比较严格,我们发现目前数据源管理更新得时候实际上是把原始密码给带出来了。)
**Describe the solution you'd like**
The datasources / update-ui interface should not take out the password. The datasources / updateDataSource interface does not update this field without passing the password. You can call the query one more time when the server is updated.
(datasources/update-ui 接口不要将密码带出去,datasources/updateDataSource 接口不传 密码就不更新该字段,服务端更新时可以先多调用一次查询。)
| https://github.com/apache/dolphinscheduler/issues/2638 | https://github.com/apache/dolphinscheduler/pull/2844 | fbb8ff438ad0c0db1bfc78d33bbc73b2c7d40683 | 1c153454423f4b967f3fcd8fb906a4626799872f | "2020-05-08T08:42:20Z" | java | "2020-05-30T07:03:10Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/DataSourceService.java | public class DataSourceService extends BaseService{
private static final Logger logger = LoggerFactory.getLogger(DataSourceService.class);
public static final String NAME = "name";
public static final String NOTE = "note";
public static final String TYPE = "type";
public static final String HOST = "host";
public static final String PORT = "port";
public static final String PRINCIPAL = "principal";
public static final String DATABASE = "database";
public static final String USER_NAME = "userName";
public static final String PASSWORD = Constants.PASSWORD;
public static final String OTHER = "other";
@Autowired
private DataSourceMapper dataSourceMapper;
@Autowired
private DataSourceUserMapper datasourceUserMapper;
/**
* create data source
*
* @param loginUser login user
* @param name data source name
* @param desc data source description
* @param type data source type
* @param parameter datasource parameters |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,638 | Improve the security of datasource management | **Is your feature request related to a problem? Please describe.**
Company database account management is relatively strict. We found that when the data source management is updated, the original password is actually brought out.
(公司数据库账号管理比较严格,我们发现目前数据源管理更新得时候实际上是把原始密码给带出来了。)
**Describe the solution you'd like**
The datasources / update-ui interface should not take out the password. The datasources / updateDataSource interface does not update this field without passing the password. You can call the query one more time when the server is updated.
(datasources/update-ui 接口不要将密码带出去,datasources/updateDataSource 接口不传 密码就不更新该字段,服务端更新时可以先多调用一次查询。)
| https://github.com/apache/dolphinscheduler/issues/2638 | https://github.com/apache/dolphinscheduler/pull/2844 | fbb8ff438ad0c0db1bfc78d33bbc73b2c7d40683 | 1c153454423f4b967f3fcd8fb906a4626799872f | "2020-05-08T08:42:20Z" | java | "2020-05-30T07:03:10Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/DataSourceService.java | * @return create result code
*/
public Map<String, Object> createDataSource(User loginUser, String name, String desc, DbType type, String parameter) {
Map<String, Object> result = new HashMap<>(5);
if (checkName(name)) {
putMsg(result, Status.DATASOURCE_EXIST);
return result;
}
Boolean isConnection = checkConnection(type, parameter);
if (!isConnection) {
logger.info("connect failed, type:{}, parameter:{}", type, parameter);
putMsg(result, Status.DATASOURCE_CONNECT_FAILED);
return result;
}
BaseDataSource datasource = DataSourceFactory.getDatasource(type, parameter);
if (datasource == null) {
putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, parameter);
return result;
}
DataSource dataSource = new DataSource();
Date now = new Date();
dataSource.setName(name.trim());
dataSource.setNote(desc);
dataSource.setUserId(loginUser.getId());
dataSource.setUserName(loginUser.getUserName());
dataSource.setType(type);
dataSource.setConnectionParams(parameter);
dataSource.setCreateTime(now); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,638 | Improve the security of datasource management | **Is your feature request related to a problem? Please describe.**
Company database account management is relatively strict. We found that when the data source management is updated, the original password is actually brought out.
(公司数据库账号管理比较严格,我们发现目前数据源管理更新得时候实际上是把原始密码给带出来了。)
**Describe the solution you'd like**
The datasources / update-ui interface should not take out the password. The datasources / updateDataSource interface does not update this field without passing the password. You can call the query one more time when the server is updated.
(datasources/update-ui 接口不要将密码带出去,datasources/updateDataSource 接口不传 密码就不更新该字段,服务端更新时可以先多调用一次查询。)
| https://github.com/apache/dolphinscheduler/issues/2638 | https://github.com/apache/dolphinscheduler/pull/2844 | fbb8ff438ad0c0db1bfc78d33bbc73b2c7d40683 | 1c153454423f4b967f3fcd8fb906a4626799872f | "2020-05-08T08:42:20Z" | java | "2020-05-30T07:03:10Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/DataSourceService.java | dataSource.setUpdateTime(now);
dataSourceMapper.insert(dataSource);
putMsg(result, Status.SUCCESS);
return result;
}
/**
* updateProcessInstance datasource
*
* @param loginUser login user
* @param name data source name
* @param desc data source description
* @param type data source type
* @param parameter datasource parameters
* @param id data source id
* @return update result code
*/
public Map<String, Object> updateDataSource(int id, User loginUser, String name, String desc, DbType type, String parameter) {
Map<String, Object> result = new HashMap<>();
DataSource dataSource = dataSourceMapper.selectById(id);
if (dataSource == null) {
putMsg(result, Status.RESOURCE_NOT_EXIST);
return result;
}
if(!hasPerm(loginUser, dataSource.getUserId())){
putMsg(result, Status.USER_NO_OPERATION_PERM);
return result;
}
if(!name.trim().equals(dataSource.getName()) && checkName(name)){ |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,638 | Improve the security of datasource management | **Is your feature request related to a problem? Please describe.**
Company database account management is relatively strict. We found that when the data source management is updated, the original password is actually brought out.
(公司数据库账号管理比较严格,我们发现目前数据源管理更新得时候实际上是把原始密码给带出来了。)
**Describe the solution you'd like**
The datasources / update-ui interface should not take out the password. The datasources / updateDataSource interface does not update this field without passing the password. You can call the query one more time when the server is updated.
(datasources/update-ui 接口不要将密码带出去,datasources/updateDataSource 接口不传 密码就不更新该字段,服务端更新时可以先多调用一次查询。)
| https://github.com/apache/dolphinscheduler/issues/2638 | https://github.com/apache/dolphinscheduler/pull/2844 | fbb8ff438ad0c0db1bfc78d33bbc73b2c7d40683 | 1c153454423f4b967f3fcd8fb906a4626799872f | "2020-05-08T08:42:20Z" | java | "2020-05-30T07:03:10Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/DataSourceService.java | putMsg(result, Status.DATASOURCE_EXIST);
return result;
}
Boolean isConnection = checkConnection(type, parameter);
if (!isConnection) {
logger.info("connect failed, type:{}, parameter:{}", type, parameter);
putMsg(result, Status.DATASOURCE_CONNECT_FAILED);
return result;
}
Date now = new Date();
dataSource.setName(name.trim());
dataSource.setNote(desc);
dataSource.setUserName(loginUser.getUserName());
dataSource.setType(type);
dataSource.setConnectionParams(parameter);
dataSource.setUpdateTime(now);
dataSourceMapper.updateById(dataSource);
putMsg(result, Status.SUCCESS);
return result;
}
private boolean checkName(String name) {
List<DataSource> queryDataSource = dataSourceMapper.queryDataSourceByName(name.trim());
if (queryDataSource != null && queryDataSource.size() > 0) {
return true;
}
return false;
}
/**
* updateProcessInstance datasource
* @param id datasource id |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,638 | Improve the security of datasource management | **Is your feature request related to a problem? Please describe.**
Company database account management is relatively strict. We found that when the data source management is updated, the original password is actually brought out.
(公司数据库账号管理比较严格,我们发现目前数据源管理更新得时候实际上是把原始密码给带出来了。)
**Describe the solution you'd like**
The datasources / update-ui interface should not take out the password. The datasources / updateDataSource interface does not update this field without passing the password. You can call the query one more time when the server is updated.
(datasources/update-ui 接口不要将密码带出去,datasources/updateDataSource 接口不传 密码就不更新该字段,服务端更新时可以先多调用一次查询。)
| https://github.com/apache/dolphinscheduler/issues/2638 | https://github.com/apache/dolphinscheduler/pull/2844 | fbb8ff438ad0c0db1bfc78d33bbc73b2c7d40683 | 1c153454423f4b967f3fcd8fb906a4626799872f | "2020-05-08T08:42:20Z" | java | "2020-05-30T07:03:10Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/DataSourceService.java | * @return data source detail
*/
public Map<String, Object> queryDataSource(int id) {
Map<String, Object> result = new HashMap<String, Object>(5);
DataSource dataSource = dataSourceMapper.selectById(id);
if (dataSource == null) {
putMsg(result, Status.RESOURCE_NOT_EXIST);
return result;
}
String dataSourceType = dataSource.getType().toString();
String dataSourceName = dataSource.getName();
String desc = dataSource.getNote();
String parameter = dataSource.getConnectionParams();
BaseDataSource datasourceForm = DataSourceFactory.getDatasource(dataSource.getType(), parameter);
String database = datasourceForm.getDatabase();
String other = datasourceForm.getOther();
String address = datasourceForm.getAddress();
String[] hostsPorts = getHostsAndPort(address);
String host = hostsPorts[0];
String port = hostsPorts[1];
String separator = "";
switch (dataSource.getType()) {
case HIVE: |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,638 | Improve the security of datasource management | **Is your feature request related to a problem? Please describe.**
Company database account management is relatively strict. We found that when the data source management is updated, the original password is actually brought out.
(公司数据库账号管理比较严格,我们发现目前数据源管理更新得时候实际上是把原始密码给带出来了。)
**Describe the solution you'd like**
The datasources / update-ui interface should not take out the password. The datasources / updateDataSource interface does not update this field without passing the password. You can call the query one more time when the server is updated.
(datasources/update-ui 接口不要将密码带出去,datasources/updateDataSource 接口不传 密码就不更新该字段,服务端更新时可以先多调用一次查询。)
| https://github.com/apache/dolphinscheduler/issues/2638 | https://github.com/apache/dolphinscheduler/pull/2844 | fbb8ff438ad0c0db1bfc78d33bbc73b2c7d40683 | 1c153454423f4b967f3fcd8fb906a4626799872f | "2020-05-08T08:42:20Z" | java | "2020-05-30T07:03:10Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/DataSourceService.java | case SQLSERVER:
separator = ";";
break;
case MYSQL:
case POSTGRESQL:
case CLICKHOUSE:
case ORACLE:
separator = "&";
break;
default:
separator = "&";
break;
}
Map<String, String> otherMap = new LinkedHashMap<String, String>();
if (other != null) {
String[] configs = other.split(separator);
for (String config : configs) {
otherMap.put(config.split("=")[0], config.split("=")[1]);
}
}
Map<String, Object> map = new HashMap<>(10);
map.put(NAME, dataSourceName);
map.put(NOTE, desc);
map.put(TYPE, dataSourceType);
map.put(HOST, host);
map.put(PORT, port);
map.put(PRINCIPAL, datasourceForm.getPrincipal());
map.put(DATABASE, database);
map.put(USER_NAME, datasourceForm.getUser());
map.put(PASSWORD, datasourceForm.getPassword()); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,638 | Improve the security of datasource management | **Is your feature request related to a problem? Please describe.**
Company database account management is relatively strict. We found that when the data source management is updated, the original password is actually brought out.
(公司数据库账号管理比较严格,我们发现目前数据源管理更新得时候实际上是把原始密码给带出来了。)
**Describe the solution you'd like**
The datasources / update-ui interface should not take out the password. The datasources / updateDataSource interface does not update this field without passing the password. You can call the query one more time when the server is updated.
(datasources/update-ui 接口不要将密码带出去,datasources/updateDataSource 接口不传 密码就不更新该字段,服务端更新时可以先多调用一次查询。)
| https://github.com/apache/dolphinscheduler/issues/2638 | https://github.com/apache/dolphinscheduler/pull/2844 | fbb8ff438ad0c0db1bfc78d33bbc73b2c7d40683 | 1c153454423f4b967f3fcd8fb906a4626799872f | "2020-05-08T08:42:20Z" | java | "2020-05-30T07:03:10Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/DataSourceService.java | map.put(OTHER, otherMap);
result.put(Constants.DATA_LIST, map);
putMsg(result, Status.SUCCESS);
return result;
}
/**
* query datasource list by keyword
*
* @param loginUser login user
* @param searchVal search value
* @param pageNo page number
* @param pageSize page size
* @return data source list page
*/
public Map<String, Object> queryDataSourceListPaging(User loginUser, String searchVal, Integer pageNo, Integer pageSize) {
Map<String, Object> result = new HashMap<>();
IPage<DataSource> dataSourceList = null;
Page<DataSource> dataSourcePage = new Page(pageNo, pageSize);
if (isAdmin(loginUser)) {
dataSourceList = dataSourceMapper.selectPaging(dataSourcePage, 0, searchVal);
}else{
dataSourceList = dataSourceMapper.selectPaging(dataSourcePage, loginUser.getId(), searchVal);
}
List<DataSource> dataSources = dataSourceList.getRecords();
handlePasswd(dataSources);
PageInfo pageInfo = new PageInfo<Resource>(pageNo, pageSize);
pageInfo.setTotalCount((int)(dataSourceList.getTotal()));
pageInfo.setLists(dataSources);
result.put(Constants.DATA_LIST, pageInfo);
putMsg(result, Status.SUCCESS); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,638 | Improve the security of datasource management | **Is your feature request related to a problem? Please describe.**
Company database account management is relatively strict. We found that when the data source management is updated, the original password is actually brought out.
(公司数据库账号管理比较严格,我们发现目前数据源管理更新得时候实际上是把原始密码给带出来了。)
**Describe the solution you'd like**
The datasources / update-ui interface should not take out the password. The datasources / updateDataSource interface does not update this field without passing the password. You can call the query one more time when the server is updated.
(datasources/update-ui 接口不要将密码带出去,datasources/updateDataSource 接口不传 密码就不更新该字段,服务端更新时可以先多调用一次查询。)
| https://github.com/apache/dolphinscheduler/issues/2638 | https://github.com/apache/dolphinscheduler/pull/2844 | fbb8ff438ad0c0db1bfc78d33bbc73b2c7d40683 | 1c153454423f4b967f3fcd8fb906a4626799872f | "2020-05-08T08:42:20Z" | java | "2020-05-30T07:03:10Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/DataSourceService.java | return result;
}
/**
* handle datasource connection password for safety
* @param dataSourceList
*/
private void handlePasswd(List<DataSource> dataSourceList) {
for (DataSource dataSource : dataSourceList) {
String connectionParams = dataSource.getConnectionParams();
JSONObject object = JSON.parseObject(connectionParams);
object.put(Constants.PASSWORD, Constants.XXXXXX);
dataSource.setConnectionParams(JSONUtils.toJson(object));
}
}
/**
* query data resource list
*
* @param loginUser login user
* @param type data source type
* @return data source list page
*/
public Map<String, Object> queryDataSourceList(User loginUser, Integer type) {
Map<String, Object> result = new HashMap<>(5);
List<DataSource> datasourceList;
if (isAdmin(loginUser)) {
datasourceList = dataSourceMapper.listAllDataSourceByType(type);
}else{
datasourceList = dataSourceMapper.queryDataSourceByType(loginUser.getId(), type);
}
result.put(Constants.DATA_LIST, datasourceList); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,638 | Improve the security of datasource management | **Is your feature request related to a problem? Please describe.**
Company database account management is relatively strict. We found that when the data source management is updated, the original password is actually brought out.
(公司数据库账号管理比较严格,我们发现目前数据源管理更新得时候实际上是把原始密码给带出来了。)
**Describe the solution you'd like**
The datasources / update-ui interface should not take out the password. The datasources / updateDataSource interface does not update this field without passing the password. You can call the query one more time when the server is updated.
(datasources/update-ui 接口不要将密码带出去,datasources/updateDataSource 接口不传 密码就不更新该字段,服务端更新时可以先多调用一次查询。)
| https://github.com/apache/dolphinscheduler/issues/2638 | https://github.com/apache/dolphinscheduler/pull/2844 | fbb8ff438ad0c0db1bfc78d33bbc73b2c7d40683 | 1c153454423f4b967f3fcd8fb906a4626799872f | "2020-05-08T08:42:20Z" | java | "2020-05-30T07:03:10Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/DataSourceService.java | putMsg(result, Status.SUCCESS);
return result;
}
/**
* verify datasource exists
*
* @param loginUser login user
* @param name datasource name
* @return true if data datasource not exists, otherwise return false
*/
public Result verifyDataSourceName(User loginUser, String name) {
Result result = new Result();
List<DataSource> dataSourceList = dataSourceMapper.queryDataSourceByName(name);
if (dataSourceList != null && dataSourceList.size() > 0) {
logger.error("datasource name:{} has exist, can't create again.", name);
putMsg(result, Status.DATASOURCE_EXIST);
} else {
putMsg(result, Status.SUCCESS);
}
return result;
}
/**
* get connection
*
* @param dbType datasource type
* @param parameter parameter
* @return connection for datasource
*/
private Connection getConnection(DbType dbType, String parameter) {
Connection connection = null; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,638 | Improve the security of datasource management | **Is your feature request related to a problem? Please describe.**
Company database account management is relatively strict. We found that when the data source management is updated, the original password is actually brought out.
(公司数据库账号管理比较严格,我们发现目前数据源管理更新得时候实际上是把原始密码给带出来了。)
**Describe the solution you'd like**
The datasources / update-ui interface should not take out the password. The datasources / updateDataSource interface does not update this field without passing the password. You can call the query one more time when the server is updated.
(datasources/update-ui 接口不要将密码带出去,datasources/updateDataSource 接口不传 密码就不更新该字段,服务端更新时可以先多调用一次查询。)
| https://github.com/apache/dolphinscheduler/issues/2638 | https://github.com/apache/dolphinscheduler/pull/2844 | fbb8ff438ad0c0db1bfc78d33bbc73b2c7d40683 | 1c153454423f4b967f3fcd8fb906a4626799872f | "2020-05-08T08:42:20Z" | java | "2020-05-30T07:03:10Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/DataSourceService.java | BaseDataSource datasource = null;
try {
switch (dbType) {
case POSTGRESQL:
datasource = JSON.parseObject(parameter, PostgreDataSource.class);
Class.forName(Constants.ORG_POSTGRESQL_DRIVER);
break;
case MYSQL:
datasource = JSON.parseObject(parameter, MySQLDataSource.class);
Class.forName(Constants.COM_MYSQL_JDBC_DRIVER);
break;
case HIVE:
case SPARK:
if (CommonUtils.getKerberosStartupState()) {
System.setProperty(org.apache.dolphinscheduler.common.Constants.JAVA_SECURITY_KRB5_CONF,
getString(org.apache.dolphinscheduler.common.Constants.JAVA_SECURITY_KRB5_CONF_PATH));
Configuration configuration = new Configuration();
configuration.set(org.apache.dolphinscheduler.common.Constants.HADOOP_SECURITY_AUTHENTICATION, "kerberos");
UserGroupInformation.setConfiguration(configuration);
UserGroupInformation.loginUserFromKeytab(getString(org.apache.dolphinscheduler.common.Constants.LOGIN_USER_KEY_TAB_USERNAME),
getString(org.apache.dolphinscheduler.common.Constants.LOGIN_USER_KEY_TAB_PATH));
}
if (dbType == DbType.HIVE){
datasource = JSON.parseObject(parameter, HiveDataSource.class);
}else if (dbType == DbType.SPARK){
datasource = JSON.parseObject(parameter, SparkDataSource.class);
}
Class.forName(Constants.ORG_APACHE_HIVE_JDBC_HIVE_DRIVER);
break;
case CLICKHOUSE: |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,638 | Improve the security of datasource management | **Is your feature request related to a problem? Please describe.**
Company database account management is relatively strict. We found that when the data source management is updated, the original password is actually brought out.
(公司数据库账号管理比较严格,我们发现目前数据源管理更新得时候实际上是把原始密码给带出来了。)
**Describe the solution you'd like**
The datasources / update-ui interface should not take out the password. The datasources / updateDataSource interface does not update this field without passing the password. You can call the query one more time when the server is updated.
(datasources/update-ui 接口不要将密码带出去,datasources/updateDataSource 接口不传 密码就不更新该字段,服务端更新时可以先多调用一次查询。)
| https://github.com/apache/dolphinscheduler/issues/2638 | https://github.com/apache/dolphinscheduler/pull/2844 | fbb8ff438ad0c0db1bfc78d33bbc73b2c7d40683 | 1c153454423f4b967f3fcd8fb906a4626799872f | "2020-05-08T08:42:20Z" | java | "2020-05-30T07:03:10Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/DataSourceService.java | datasource = JSON.parseObject(parameter, ClickHouseDataSource.class);
Class.forName(Constants.COM_CLICKHOUSE_JDBC_DRIVER);
break;
case ORACLE:
datasource = JSON.parseObject(parameter, OracleDataSource.class);
Class.forName(Constants.COM_ORACLE_JDBC_DRIVER);
break;
case SQLSERVER:
datasource = JSON.parseObject(parameter, SQLServerDataSource.class);
Class.forName(Constants.COM_SQLSERVER_JDBC_DRIVER);
break;
case DB2:
datasource = JSON.parseObject(parameter, DB2ServerDataSource.class);
Class.forName(Constants.COM_DB2_JDBC_DRIVER);
break;
default:
break;
}
if(datasource != null){
connection = DriverManager.getConnection(datasource.getJdbcUrl(), datasource.getUser(), datasource.getPassword());
}
} catch (Exception e) {
logger.error(e.getMessage(),e);
}
return connection;
}
/**
* check connection
*
* @param type data source type |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,638 | Improve the security of datasource management | **Is your feature request related to a problem? Please describe.**
Company database account management is relatively strict. We found that when the data source management is updated, the original password is actually brought out.
(公司数据库账号管理比较严格,我们发现目前数据源管理更新得时候实际上是把原始密码给带出来了。)
**Describe the solution you'd like**
The datasources / update-ui interface should not take out the password. The datasources / updateDataSource interface does not update this field without passing the password. You can call the query one more time when the server is updated.
(datasources/update-ui 接口不要将密码带出去,datasources/updateDataSource 接口不传 密码就不更新该字段,服务端更新时可以先多调用一次查询。)
| https://github.com/apache/dolphinscheduler/issues/2638 | https://github.com/apache/dolphinscheduler/pull/2844 | fbb8ff438ad0c0db1bfc78d33bbc73b2c7d40683 | 1c153454423f4b967f3fcd8fb906a4626799872f | "2020-05-08T08:42:20Z" | java | "2020-05-30T07:03:10Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/DataSourceService.java | * @param parameter data source parameters
* @return true if connect successfully, otherwise false
*/
public boolean checkConnection(DbType type, String parameter) {
Boolean isConnection = false;
Connection con = getConnection(type, parameter);
if (con != null) {
isConnection = true;
try {
con.close();
} catch (SQLException e) {
logger.error("close connection fail at DataSourceService::checkConnection()", e);
}
}
return isConnection;
}
/**
* test connection
*
* @param loginUser login user
* @param id datasource id
* @return connect result code
*/
public boolean connectionTest(User loginUser, int id) {
DataSource dataSource = dataSourceMapper.selectById(id);
return checkConnection(dataSource.getType(), dataSource.getConnectionParams());
}
/**
* build paramters
* |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 2,638 | Improve the security of datasource management | **Is your feature request related to a problem? Please describe.**
Company database account management is relatively strict. We found that when the data source management is updated, the original password is actually brought out.
(公司数据库账号管理比较严格,我们发现目前数据源管理更新得时候实际上是把原始密码给带出来了。)
**Describe the solution you'd like**
The datasources / update-ui interface should not take out the password. The datasources / updateDataSource interface does not update this field without passing the password. You can call the query one more time when the server is updated.
(datasources/update-ui 接口不要将密码带出去,datasources/updateDataSource 接口不传 密码就不更新该字段,服务端更新时可以先多调用一次查询。)
| https://github.com/apache/dolphinscheduler/issues/2638 | https://github.com/apache/dolphinscheduler/pull/2844 | fbb8ff438ad0c0db1bfc78d33bbc73b2c7d40683 | 1c153454423f4b967f3fcd8fb906a4626799872f | "2020-05-08T08:42:20Z" | java | "2020-05-30T07:03:10Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/DataSourceService.java | * @param name data source name
* @param desc data source description
* @param type data source type
* @param host data source host
* @param port data source port
* @param database data source database name
* @param userName user name
* @param password password
* @param other other parameters
* @param principal principal
* @return datasource parameter
*/
public String buildParameter(String name, String desc, DbType type, String host,
String port, String database, String principal, String userName,
String password, DbConnectType connectType, String other) {
String address = buildAddress(type, host, port, connectType);
String jdbcUrl;
if (Constants.ORACLE.equals(type.name())
&& connectType == DbConnectType.ORACLE_SID) {
jdbcUrl = address + ":" + database;
} else {
jdbcUrl = address + "/" + database;
}
if (CommonUtils.getKerberosStartupState() &&
(type == DbType.HIVE || type == DbType.SPARK)){
jdbcUrl += ";principal=" + principal;
}
String separator = "";
if (Constants.MYSQL.equals(type.name())
|| Constants.POSTGRESQL.equals(type.name()) |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.