Esempio n. 1
0
    print("zk host list is null! please check the config file")
    sys.exit()

if not os.path.exists(log_path):
    print("logpath:%s not exist, please check the config file" % log_path)
    sys.exit()
if not os.path.exists(bak_path):
    print("bak_path:%s not exist, please check the config file" % log_path)
    sys.exit()
if not os.path.exists(bak_path):
    print("bak_path:%s not exist, please check the config file" % log_path)
    sys.exit()

# 创建zookeeper实例
zoo = Zookeeper(zk_host_list, None)
zoo.connect()
# work_node = zoo.get_node(zk_process_path)
# process_id = ''.join(work_node.split('_')[1:])
work_node = "process_" + process_id
pl.set_log(log_path, process_id)
flow = config.create_flow(process_id)
redo_node = zk_process_path + "/" + work_node + "/" + "redo"
redo_node_flag = zoo.check_exists(redo_node)
if redo_node_flag is not None:
    redo_info, stat = zoo.get_node_value(redo_node)
    redo_info = bytes.decode(redo_info)
    if redo_info is not None:
        output_dirs = config.output_dirs
        logging.info("redo info %s" % redo_info)
        zk_redo = ZkRedo(redo_info, process_id, input_dir, output_dirs,
                         bak_path)