Skip to content

Commit

Permalink
Fix create_rpc.py for msec_srpc_java.
Browse files Browse the repository at this point in the history
  • Loading branch information
msecowner committed Feb 21, 2017
1 parent 91973ac commit 21375d1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion msec_srpc_java/create_rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def ParseProtoFile(filename):
for item in service_list:
method_list = []
#print item[1]
p = re.compile(r'rpc\s+(\w+)\s*\((\w+)\)\s+returns\s+\((\w+)\)', re.S | re.M)
p = re.compile(r'rpc\s+(\w+)\s*\((\w+)\s*\)\s+returns\s+\((\w+)\s*\)', re.S | re.M)
mlist = p.findall(item[0])
for m in mlist:
method_list.append((item[1], TransMethodName(m[0]), m[1], m[2]))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,15 @@ public RpcResponse call() throws Exception {
return null;
}

Map<String, String> headers = new HashMap<String, String>();
headers.put("Coloring", "1");
AccessLog.doLog(AccessLog.LOG_LEVEL_DEBUG, headers, "system rpc log. request: " + rpcRequest.getParameter());
//Map<String, String> headers = new HashMap<String, String>();
//headers.put("Coloring", "1");
//AccessLog.doLog(AccessLog.LOG_LEVEL_DEBUG, headers, "system rpc log. request: " + rpcRequest.getParameter());

String serviceMethodName = rpcRequest.getServiceName() + "/" + rpcRequest.getMethodName();
log.info("Rpc Call: " + rpcContext.getClientAddr() + " ---> " +
rpcContext.getLocalAddr() + " " + serviceMethodName + " request: " + rpcRequest.getParameter());
AccessLog.doLog(AccessLog.LOG_LEVEL_INFO, "Rpc Call: " + rpcContext.getClientAddr() + " ---> " +
rpcContext.getLocalAddr() + " " + serviceMethodName + " request: " + rpcRequest.getParameter());
//AccessLog.doLog(AccessLog.LOG_LEVEL_INFO, "Rpc Call: " + rpcContext.getClientAddr() + " ---> " +
// rpcContext.getLocalAddr() + " " + serviceMethodName + " request: " + rpcRequest.getParameter());

ServiceFactory.ServiceMethodEntry serviceMethodEntry = ServiceFactory.getServiceMethodEntry(rpcRequest.getServiceName(), rpcRequest.getMethodName());
if (serviceMethodEntry != null) {
Expand All @@ -169,7 +169,7 @@ public RpcResponse call() throws Exception {

AccessMonitor.add("frm.rpc " + rpcRequest.getMethodName() + " succ count");
log.info("RPC invoke discrete method succeeded: " + invokeResultObj);
AccessLog.doLog(AccessLog.LOG_LEVEL_INFO, "Rpc Call timecost: " + (timeEnd - timeBegin) + "ms response: " + invokeResultObj);
//AccessLog.doLog(AccessLog.LOG_LEVEL_INFO, "Rpc Call timecost: " + (timeEnd - timeBegin) + "ms response: " + invokeResultObj);
} catch (InvocationTargetException ex) {
rpcResponse.setErrno(-1000);
rpcResponse.setError(ex);
Expand Down

0 comments on commit 21375d1

Please sign in to comment.