Unverified Commit 9d1d0410 authored by kezhenxu94's avatar kezhenxu94 Committed by GitHub
Browse files

Merge branch 'dev' into issue/1463

parents f9669f17 21bd3c14
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -99,9 +99,9 @@ It is because of the shoulders of these open source projects that the birth of t
### Get Help
1. Submit an issue
1. Subscribe the mail list : https://dolphinscheduler.apache.org/en-us/docs/development/subscribe.html.  then send mail to dev@dolphinscheduler.apache.org
1. Slack channel: [![Slack Status](https://img.shields.io/badge/slack-join_chat-white.svg?logo=slack&style=social)](https://join.slack.com/share/zt-do3gvfhj-UUhrAX2GxkVX_~JJt1jpKA)
1. Contact WeChat(dailidong66). This is just for Mandarin(CN) discussion.

### License
Please refer to [LICENSE](https://github.com/apache/incubator-dolphinscheduler/blob/dev/LICENSE) file.
+1 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ services:
      - "2181:2181"
    environment:
      ZOO_MY_ID: 1
      ZOO_4LW_COMMANDS_WHITELIST: srvr,ruok,wchs,cons
  db:
    image: postgres
    container_name: postgres
+26 −6
Original line number Diff line number Diff line
@@ -124,14 +124,12 @@ public class ExecutorService extends BaseService{
            return result;
        }

        // check master server exists
        List<Server> masterServers = monitorService.getServerListFromZK(true);


        if (masterServers.size() == 0) {
            putMsg(result, Status.MASTER_NOT_EXISTS);
        // check master exists
        if (!checkMasterExists(result)) {
            return result;
        }


        /**
         * create command
         */
@@ -152,6 +150,22 @@ public class ExecutorService extends BaseService{
        return result;
    }

    /**
     * check whether master exists
     * @param result result
     * @return master exists return true , otherwise return false
     */
    private boolean checkMasterExists(Map<String, Object> result) {
        // check master server exists
        List<Server> masterServers = monitorService.getServerListFromZK(true);

        // no master
        if (masterServers.size() == 0) {
            putMsg(result, Status.MASTER_NOT_EXISTS);
            return false;
        }
        return true;
    }


    /**
@@ -195,6 +209,12 @@ public class ExecutorService extends BaseService{
            return checkResult;
        }

        // check master exists
        if (!checkMasterExists(result)) {
            return result;
        }


        ProcessInstance processInstance = processService.findProcessInstanceDetailById(processInstanceId);
        if (processInstance == null) {
            putMsg(result, Status.PROCESS_INSTANCE_NOT_EXIST, processInstanceId);
+7 −7
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@ public class ZooKeeperState {
	private final String host;
	private final int port;

	private int minLatency = -1, avgLatency = -1, maxLatency = -1;
	private float minLatency = -1, avgLatency = -1, maxLatency = -1;
	private long received = -1;
	private long sent = -1;
	private int outStanding = -1;
@@ -60,9 +60,9 @@ public class ZooKeeperState {
					String line = scannerForStat.nextLine();
					if (line.startsWith("Latency min/avg/max:")) {
						String[] latencys = getStringValueFromLine(line).split("/");
						minLatency = Integer.parseInt(latencys[0]);
						avgLatency = Integer.parseInt(latencys[1]);
						maxLatency = Integer.parseInt(latencys[2]);
						minLatency = Float.parseFloat(latencys[0]);
						avgLatency = Float.parseFloat(latencys[1]);
						maxLatency = Float.parseFloat(latencys[2]);
					} else if (line.startsWith("Received:")) {
						received = Long.parseLong(getStringValueFromLine(line));
					} else if (line.startsWith("Sent:")) {
@@ -165,15 +165,15 @@ public class ZooKeeperState {
		return port;
	}

	public int getMinLatency() {
	public float getMinLatency() {
		return minLatency;
	}

	public int getAvgLatency() {
	public float getAvgLatency() {
		return avgLatency;
	}

	public int getMaxLatency() {
	public float getMaxLatency() {
		return maxLatency;
	}

+3 −3
Original line number Diff line number Diff line
@@ -88,9 +88,9 @@ public class ZookeeperMonitor extends AbstractZKClient {
				long sent = state.getSent();
				long received = state.getReceived();
				String mode =  state.getMode();
				int minLatency =  state.getMinLatency();
				int avgLatency = state.getAvgLatency();
				int maxLatency = state.getMaxLatency();
				float minLatency =  state.getMinLatency();
				float avgLatency = state.getAvgLatency();
				float maxLatency = state.getMaxLatency();
				int nodeCount = state.getNodeCount();
				int status = ok ? 1 : 0;
				Date date = new Date();
Loading