Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
default = settings.ARROW_MASTER_DEFAULT_PARAMS
control_conf = {}
log_conf = {}
control_conf['heartbeat_interval'] = settings.check_and_load_existence(
user_confdict, default, '["control"]["heartbeat_interval"]'
)
control_conf['master_ip'] = settings.check_and_load_existence(
user_confdict, default, '["control"]["master_ip"]'
)
control_conf['master_port'] = settings.check_and_load_existence(
user_confdict, default, '["control"]["master_port"]'
)
control_conf['queue_exec_thdnum'] = settings.check_and_load_existence(
user_confdict, default, '["control"]["queue_exec_thdnum"]'
)
control_conf['queue_delay_exe_thdnum'] = settings.check_and_load_existence(
user_confdict, default, '["control"]["queue_delay_exe_thdnum"]'
)
control_conf['port'] = settings.check_and_load_existence(
user_confdict, default, '["control"]["port"]'
)
control_conf['interface'] = settings.check_and_load_existence(
user_confdict, default, '["control"]["interface"]'
)
log_conf = settings.check_and_load_existence(
user_confdict, default, '["log"]["path"]'
)
self._conf_dict['control'] = control_conf
self._conf_dict['log'] = log_conf
"""
load conf into memory.
If user conf does not have the conf item, arrow will use
default values in arrow.common.settings(.py)
"""
if not os.path.exists(conf_file):
raise IOError('conf file not found:%s' % conf_file)
self._conf_dict = {}
user_confdict = conf.Configure2Dict(conf_file).get_dict()
default = settings.ARROW_MASTER_DEFAULT_PARAMS
self._conf_dict['control'] = {}
settings.check_and_load_existence(
user_confdict, default, '["control"]'
)
self._conf_dict['control']['queue_exec_thdnum'] = \
settings.check_and_load_existence(
user_confdict, default, '["control"]["queue_exec_thdnum"]'
)
self._conf_dict['control']['queue_delay_exe_thdnum'] = \
settings.check_and_load_existence(
user_confdict, default, '["control"]["queue_delay_exe_thdnum"]'
)
self._conf_dict['control']['queue_exec_thdnum'] = \
settings.check_and_load_existence(
user_confdict, default, '["control"]["queue_exec_thdnum"]'
)
self._conf_dict['control']['local_datadir'] = \
settings.check_and_load_existence(
user_confdict, default, '["control"]["local_datadir"]'
)
self._conf_dict['control']['check_heartbeat_interval'] = \
def _load_conf(self, conf_file):
"""load agent conf"""
if not os.path.exists(conf_file):
raise IOError('conf file not found:%s' % conf_file)
self._conf_dict = {}
user_confdict = conf.Configure2Dict(conf_file).get_dict()
default = settings.ARROW_MASTER_DEFAULT_PARAMS
control_conf = {}
log_conf = {}
control_conf['heartbeat_interval'] = settings.check_and_load_existence(
user_confdict, default, '["control"]["heartbeat_interval"]'
)
control_conf['master_ip'] = settings.check_and_load_existence(
user_confdict, default, '["control"]["master_ip"]'
)
control_conf['master_port'] = settings.check_and_load_existence(
user_confdict, default, '["control"]["master_port"]'
)
control_conf['queue_exec_thdnum'] = settings.check_and_load_existence(
user_confdict, default, '["control"]["queue_exec_thdnum"]'
)
control_conf['queue_delay_exe_thdnum'] = settings.check_and_load_existence(
user_confdict, default, '["control"]["queue_delay_exe_thdnum"]'
)
control_conf['port'] = settings.check_and_load_existence(
user_confdict, default, '["control"]["port"]'
def _load_conf(self, conf_file):
"""
load conf into memory.
If user conf does not have the conf item, arrow will use
default values in arrow.common.settings(.py)
"""
if not os.path.exists(conf_file):
raise IOError('conf file not found:%s' % conf_file)
self._conf_dict = {}
user_confdict = conf.Configure2Dict(conf_file).get_dict()
default = settings.ARROW_MASTER_DEFAULT_PARAMS
self._conf_dict['control'] = {}
settings.check_and_load_existence(
user_confdict, default, '["control"]'
)
self._conf_dict['control']['queue_exec_thdnum'] = \
settings.check_and_load_existence(
user_confdict, default, '["control"]["queue_exec_thdnum"]'
)
self._conf_dict['control']['queue_delay_exe_thdnum'] = \
settings.check_and_load_existence(
user_confdict, default, '["control"]["queue_delay_exe_thdnum"]'
)
self._conf_dict['control']['queue_exec_thdnum'] = \
settings.check_and_load_existence(
user_confdict, default, '["control"]["queue_exec_thdnum"]'
)
self._conf_dict['control']['local_datadir'] = \
settings.check_and_load_existence(
)
self._conf_dict['control']['queue_exec_thdnum'] = \
settings.check_and_load_existence(
user_confdict, default, '["control"]["queue_exec_thdnum"]'
)
self._conf_dict['control']['local_datadir'] = \
settings.check_and_load_existence(
user_confdict, default, '["control"]["local_datadir"]'
)
self._conf_dict['control']['check_heartbeat_interval'] = \
settings.check_and_load_existence(
user_confdict, default, '["control"]["check_heartbeat_interval"]'
)
self._conf_dict['control']['judge_agent_dead_in_sec'] = \
settings.check_and_load_existence(
user_confdict, default, '["control"]["judge_agent_dead_in_sec"]'
)
self._conf_dict['control']['keep_lost'] = \
settings.check_and_load_existence(
user_confdict, default, '["control"]["keep_lost"]'
)
self._conf_dict['control']['port'] = \
settings.check_and_load_existence(
user_confdict, default, '["control"]["port"]'
)
"""
if not os.path.exists(conf_file):
raise IOError('conf file not found:%s' % conf_file)
self._conf_dict = {}
user_confdict = conf.Configure2Dict(conf_file).get_dict()
default = settings.ARROW_MASTER_DEFAULT_PARAMS
self._conf_dict['control'] = {}
settings.check_and_load_existence(
user_confdict, default, '["control"]'
)
self._conf_dict['control']['queue_exec_thdnum'] = \
settings.check_and_load_existence(
user_confdict, default, '["control"]["queue_exec_thdnum"]'
)
self._conf_dict['control']['queue_delay_exe_thdnum'] = \
settings.check_and_load_existence(
user_confdict, default, '["control"]["queue_delay_exe_thdnum"]'
)
self._conf_dict['control']['queue_exec_thdnum'] = \
settings.check_and_load_existence(
user_confdict, default, '["control"]["queue_exec_thdnum"]'
)
self._conf_dict['control']['local_datadir'] = \
settings.check_and_load_existence(
user_confdict, default, '["control"]["local_datadir"]'
)
self._conf_dict['control']['check_heartbeat_interval'] = \
settings.check_and_load_existence(
user_confdict, default, '["control"]["check_heartbeat_interval"]'
)
self._conf_dict['control']['judge_agent_dead_in_sec'] = \
)
self._conf_dict['control']['queue_delay_exe_thdnum'] = \
settings.check_and_load_existence(
user_confdict, default, '["control"]["queue_delay_exe_thdnum"]'
)
self._conf_dict['control']['queue_exec_thdnum'] = \
settings.check_and_load_existence(
user_confdict, default, '["control"]["queue_exec_thdnum"]'
)
self._conf_dict['control']['local_datadir'] = \
settings.check_and_load_existence(
user_confdict, default, '["control"]["local_datadir"]'
)
self._conf_dict['control']['check_heartbeat_interval'] = \
settings.check_and_load_existence(
user_confdict, default, '["control"]["check_heartbeat_interval"]'
)
self._conf_dict['control']['judge_agent_dead_in_sec'] = \
settings.check_and_load_existence(
user_confdict, default, '["control"]["judge_agent_dead_in_sec"]'
)
self._conf_dict['control']['keep_lost'] = \
settings.check_and_load_existence(
user_confdict, default, '["control"]["keep_lost"]'
)
self._conf_dict['control']['port'] = \
settings.check_and_load_existence(
user_confdict, default, '["control"]["port"]'
)
)
control_conf['queue_exec_thdnum'] = settings.check_and_load_existence(
user_confdict, default, '["control"]["queue_exec_thdnum"]'
)
control_conf['queue_delay_exe_thdnum'] = settings.check_and_load_existence(
user_confdict, default, '["control"]["queue_delay_exe_thdnum"]'
)
control_conf['port'] = settings.check_and_load_existence(
user_confdict, default, '["control"]["port"]'
)
control_conf['interface'] = settings.check_and_load_existence(
user_confdict, default, '["control"]["interface"]'
)
log_conf = settings.check_and_load_existence(
user_confdict, default, '["log"]["path"]'
)
self._conf_dict['control'] = control_conf
self._conf_dict['log'] = log_conf
def _load_conf(self, conf_file):
"""load agent conf"""
if not os.path.exists(conf_file):
raise IOError('conf file not found:%s' % conf_file)
self._conf_dict = {}
user_confdict = conf.Configure2Dict(conf_file).get_dict()
default = settings.ARROW_MASTER_DEFAULT_PARAMS
control_conf = {}
log_conf = {}
control_conf['heartbeat_interval'] = settings.check_and_load_existence(
user_confdict, default, '["control"]["heartbeat_interval"]'
)
control_conf['master_ip'] = settings.check_and_load_existence(
user_confdict, default, '["control"]["master_ip"]'
)
control_conf['master_port'] = settings.check_and_load_existence(
user_confdict, default, '["control"]["master_port"]'
)
control_conf['queue_exec_thdnum'] = settings.check_and_load_existence(
user_confdict, default, '["control"]["queue_exec_thdnum"]'
)
control_conf['queue_delay_exe_thdnum'] = settings.check_and_load_existence(
user_confdict, default, '["control"]["queue_delay_exe_thdnum"]'
)
control_conf['port'] = settings.check_and_load_existence(
user_confdict, default, '["control"]["port"]'
)
control_conf['interface'] = settings.check_and_load_existence(
user_confdict, default, '["control"]["interface"]'