本文整理汇总了Python中heron.statemgrs.src.python.log.Log.error方法的典型用法代码示例。如果您正苦于以下问题:Python Log.error方法的具体用法?Python Log.error怎么用?Python Log.error使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类heron.statemgrs.src.python.log.Log
的用法示例。
在下文中一共展示了Log.error方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_all_zk_state_managers
# 需要导入模块: from heron.statemgrs.src.python.log import Log [as 别名]
# 或者: from heron.statemgrs.src.python.log.Log import error [as 别名]
def get_all_zk_state_managers(conf):
"""
Connects to all the zookeeper state_managers and returns
the connected state_managers instances.
"""
state_managers = []
state_locations = conf.get_state_locations_of_type("zookeeper")
for location in state_locations:
name = location['name']
hostport = location['hostport']
host = None
port = None
if ':' in hostport:
hostportlist = hostport.split(':')
if len(hostportlist) == 2:
host = hostportlist[0]
port = int(hostportlist[1])
if not host or not port:
raise Exception("Hostport for %s must be of the format 'host:port'." % (name))
tunnelhost = location['tunnelhost']
rootpath = location['rootpath']
LOG.info("Connecting to zk hostport: " + host + ":" + str(port) + " rootpath: " + rootpath)
state_manager = ZkStateManager(name, host, port, rootpath, tunnelhost)
try:
state_manager.start()
except Exception as e:
LOG.error("Exception while connecting to state_manager.")
traceback.print_exc()
state_managers.append(state_manager)
return state_managers
示例2: get_all_state_managers
# 需要导入模块: from heron.statemgrs.src.python.log import Log [as 别名]
# 或者: from heron.statemgrs.src.python.log.Log import error [as 别名]
def get_all_state_managers(conf):
"""
@param conf - An instance of Config class
Reads the config for requested state managers.
Instantiates them, start and then return them.
"""
state_managers = []
try:
state_managers.extend(get_all_zk_state_managers(conf))
state_managers.extend(get_all_file_state_managers(conf))
return state_managers
except Exception as ex:
LOG.error("Exception while getting state_managers.")
raise ex
示例3: get_all_file_state_managers
# 需要导入模块: from heron.statemgrs.src.python.log import Log [as 别名]
# 或者: from heron.statemgrs.src.python.log.Log import error [as 别名]
def get_all_file_state_managers(conf):
"""
Returns all the file state_managers.
"""
state_managers = []
state_locations = conf.get_state_locations_of_type("file")
for location in state_locations:
name = location['name']
rootpath = os.path.expanduser(location['rootpath'])
LOG.info("Connecting to file state with rootpath: " + rootpath)
state_manager = FileStateManager(name, rootpath)
try:
state_manager.start()
except Exception as e:
LOG.error("Exception while connecting to state_manager.")
traceback.print_exc()
state_managers.append(state_manager)
return state_managers
示例4: get_all_zk_state_managers
# 需要导入模块: from heron.statemgrs.src.python.log import Log [as 别名]
# 或者: from heron.statemgrs.src.python.log.Log import error [as 别名]
def get_all_zk_state_managers(conf):
"""
Connects to all the zookeeper state_managers and returns
the connected state_managers instances.
"""
state_managers = []
state_locations = conf.get_state_locations_of_type("zookeeper")
for location in state_locations:
name = location['name']
host = location['host']
port = location['port']
tunnelhost = location['tunnelhost']
rootpath = location['rootpath']
LOG.info("Connecting to zk hostport: " + host + ":" + str(port) + " rootpath: " + rootpath)
state_manager = ZkStateManager(name, host, port, rootpath, tunnelhost)
try:
state_manager.start()
except Exception as e:
LOG.error("Exception while connecting to state_manager.")
traceback.print_exc()
state_managers.append(state_manager)
return state_managers