hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kun Ren <ren.h...@gmail.com>
Subject Get the methodName and parameters from the Call object in server.java
Date Thu, 05 May 2016 18:17:53 GMT
Hi Genius,

 I want to intercept the requests in the processRpcRequest() method in the
listener component in server.java, for example if I want to intercept the
"mkdirs" and "append" request,  I just try to get the method name and
parameters before this line:
        callQueue.put(call);

Currently I use the following way to get the method name:
      rpcRequest = call.rpcRequest;
      RpcRequestWrapper request = (RpcRequestWrapper) rpcRequest;
      RequestHeaderProto rpcRequestProto = request.getRequestHeader();
      String methodName = rpcRequestProto.getMethodName();

Then the methodName is "mkdirs" if the request is "./bin/hdfs dfs -mkdir
input/test1", however I don't know how to get the parameter, like
"input/test1", does anyone know how to get the methodName and parameters
from the Call object?

Thanks a lot and very appreciate.

Mime
View raw message