def _show_info(self): """ 显示swall信息 """ keeper = Keeper(self.config) valid_nodes = keeper.get_valid_nodes() info = {"config": self.config, "node_list": valid_nodes} print format_obj(info)
def main(self): """ init zookeeper """ self.parse_args() keeper = Keeper(self.config) if keeper.init_db(self.options.force): sys.stdout.write(c("init zookeeper db ok\n", 'g')) else: sys.stdout.write(c("init zookeeper db fail\n", 'r')) sys.stdout.flush()
def _show_info(self): """ 显示swall信息 """ keeper = Keeper(self.config) valid_nodes = keeper.get_valid_nodes() info = { "config": self.config, "node_list": valid_nodes } print format_obj(info)
def __init__(self, config, jid="", env="clear", timeout=60, retry_times=3): self.fs_conf = Conf(config["fs"]) self.main_conf = Conf(config["swall"]) self.keeper = Keeper(config) self.mq = MQ(config) self.jid = jid self.env = env self.timeout = timeout self.retry_times = retry_times
def __init__(self, config, jid="", env="clear", timeout=60, retry_times=3): #初始化下ZKDb的init方法 super(Job, self).__init__() self.fs_conf = Conf(config["fs"]) self.main_conf = Conf(config["swall"]) self.zookeeper_conf = Conf(config["zk"]) self.keeper = Keeper(config) self.jid = jid self.env = env self.timeout = timeout self.retry_times = retry_times