初始化
初始化先构造Pegasus对象,在使用init函数完成初始化:
class Pegasus(object):
"""
Pegasus client class.
"""
def __init__(self, meta_addrs=None, table_name='',
timeout=DEFAULT_TIMEOUT):
"""
:param meta_addrs: (list) pagasus meta servers list.
example: ['127.0.0.1:34601', '127.0.0.1:34602', '127.0.0.1:34603']
:param table_name: (str) table name/app name used in pegasus.
:param timeout: (int) default timeout in milliseconds when communicate with meta sever and replica server.
"""
def init(self):
"""
Initialize the client before you can use it.
:return: (DeferredList) True when initialized succeed, others when failed.
"""