示例#1
0
def getConf(confname):
    value = ftred.runCmd(redis_pool_map["config"], "GET", confname)
    if value != None:
        value = json.loads(value)
        if isinstance(value, dict):
            value = MultiDict(value)
        if isinstance(value, list):
            value = MultiList(value)
    return value
示例#2
0
_redis_pool_count = 0

# key:mysql_connection name  value:mysql_connection
# {"tydata0":...,...}
mysql_pool_map = {}

# key:serverid  value:server struct
# {"CO01":{...}, "CO02":{...}, ... }
server_map = {}

# key:target serverid   value:udp query protocol
client_query_udp_map = {}

# key:server_type  value:[server_id1, server_id2...]
# {"CO":["CO01","CO02"], "UT":["UT01","UT02], ...}
server_type_map = MultiDict()

# key:cmd, value:server_type
# {"quick_start":"RO"}
# cmd_route_map = {}  move to the second layer

# key:data key name, value:...
global_config = {}

# 用于服务间的内部通信,对于普通进程,存储了AgentID标识的Agent连接
# 对于Agent进程,存储了和其他Agent之间以及连接的Service的连接protocol
# key:server_id, value:tcp protocol
serverid_protocol_map = {}


def initFromRedis(svrid, conf):