hadoop-common-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kun Ren <ren.h...@gmail.com>
Subject Re: Get the methodName and parameters from the Call object in server.java
Date Tue, 03 May 2016 01:49:40 GMT
Thanks a lot for your reply. Yes, I thought this before, but I didn't use
this because  I will insert it into a queue when I intercept the request,
and sort them and do something, and then run the request,  it means that
the request will not be executed immediately, since I don't want to block
the handler thread, I do the interception in the listen.




On Mon, May 2, 2016 at 6:59 PM, Mingliang Liu <mliu@hortonworks.com> wrote:

> Will the NameNodeRpcServer.java a better place for your interception (for
> HDFS related operations)?
>
> Thanks,
>
> L
>
> > On May 2, 2016, at 3:09 PM, Kun Ren <ren.hdfs@gmail.com> wrote:
> >
> > 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
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message