private void init(Config config) { this.config = config; //parse eagle zk this.zkStateConfig.zkQuorum = config.getString("zookeeper.zkQuorum"); this.zkStateConfig.zkSessionTimeoutMs = config.getInt("zookeeper.zkSessionTimeoutMs"); this.zkStateConfig.zkRetryTimes = config.getInt("zookeeper.zkRetryTimes"); this.zkStateConfig.zkRetryInterval = config.getInt("zookeeper.zkRetryInterval"); this.zkStateConfig.zkLockPath = Utils.makeLockPath(ZK_ROOT_PREFIX + "/" + config.getString("siteId")); this.zkStateConfig.zkRoot = ZK_ROOT_PREFIX + "/" + config.getString("siteId") + JOB_SYMBOL; // parse eagle service endpoint this.eagleServiceConfig.eagleServiceHost = config.getString("service.host"); String port = config.getString("service.port"); this.eagleServiceConfig.eagleServicePort = Integer.parseInt(port); this.eagleServiceConfig.username = config.getString("service.username"); this.eagleServiceConfig.password = config.getString("service.password"); this.eagleServiceConfig.readTimeoutSeconds = config.getInt("service.readTimeOutSeconds"); //parse data source config this.endpointConfig.rmUrls = config.getString("endpointConfig.rmUrls").split(","); this.endpointConfig.site = config.getString("siteId"); this.endpointConfig.fetchRunningJobInterval = config.getInt("endpointConfig.fetchRunningJobInterval"); this.endpointConfig.parseJobThreadPoolSize = config.getInt("endpointConfig.parseJobThreadPoolSize"); this.endpointConfig.requestsNum = getConfigValue(config, "endpointConfig.requestsNum", 1); this.endpointConfig.limitPerRequest = getConfigValue(config, "endpointConfig.limitPerRequest", ""); this.endpointConfig.timeRangePerRequestInMin = getConfigValue(config, "endpointConfig.timeRangePerRequestInMin", 60); LOG.info("Successfully initialized MRRunningJobConfig"); LOG.info("site: " + this.endpointConfig.site); LOG.info("eagle.service.host: " + this.eagleServiceConfig.eagleServiceHost); LOG.info("eagle.service.port: " + this.eagleServiceConfig.eagleServicePort); }
this.zkStateConfig.zkRetryTimes = config.getInt("zookeeper.zkRetryTimes"); this.zkStateConfig.zkSessionTimeoutMs = config.getInt("zookeeper.zkSessionTimeoutMs"); this.zkStateConfig.zkLockPath = Utils.makeLockPath(DEFAULT_SPARK_JOB_RUNNING_ZOOKEEPER_ROOT + "/" + config.getString("siteId")); this.zkStateConfig.zkRoot = DEFAULT_SPARK_JOB_RUNNING_ZOOKEEPER_ROOT + "/" + config.getString("siteId") + JOB_SYMBOL; if (config.hasPath("zookeeper.zkRoot")) {
zkStateConfig.zkLockPath = Utils.makeLockPath(config.getString("dataSourceConfig.zkRoot") + "/" + config.getString("siteId")); zkStateConfig.zkRoot = config.getString("dataSourceConfig.zkRoot") + "/" + config.getString("siteId") + JOB_SYMBOL; zkStateConfig.zkSessionTimeoutMs = config.getInt("dataSourceConfig.zkSessionTimeoutMs");