Re: [development] How to get Client ID or Client Name from Get object in coprocessor implementation

2018-04-26 Thread Xu Cang
Josh,
Thank you. The RPCServer.getRemoteIp() is what I was looking for.
Best,

On Thu, Apr 26, 2018 at 6:46 AM, Josh Elser  wrote:

> Xu,
>
> Can you be more specific about what you're asking for in a "clientID" or
> "clientName"?
>
> Or even better, look at the static methods on the class
> org.apache.hadoop.hbase.ipc.RpcServer. There are a number of getters
> which use ThreadLocal variables to provide context about the user who
> submitted the RPC with the current thread is processing.
>
>
> On 4/25/18 6:55 PM, Xu Cang wrote:
>
>> Hi,
>> I am trying to implement a coprocessor and one info I'd like to get is
>> clientID or clientName for each Get op. I haven't found a place I can
>> retrieve this. Is this possible?
>>
>> I am going to implement RegionObserver. The hook I refer to is this:
>>
>> void preGetOp(ObserverContext c, Get get,
>> List result)
>>
>>  From this preGetOp method, I have only observerContext and 'Get' objects.
>> Is client ID in any of these data structures? If not, are thee other ways
>> to get that info?
>>
>> Thanks,
>>
>> Xu
>>
>>


Re: [development] How to get Client ID or Client Name from Get object in coprocessor implementation

2018-04-26 Thread Josh Elser

Xu,

Can you be more specific about what you're asking for in a "clientID" or 
"clientName"?


Or even better, look at the static methods on the class 
org.apache.hadoop.hbase.ipc.RpcServer. There are a number of getters 
which use ThreadLocal variables to provide context about the user who 
submitted the RPC with the current thread is processing.


On 4/25/18 6:55 PM, Xu Cang wrote:

Hi,
I am trying to implement a coprocessor and one info I'd like to get is
clientID or clientName for each Get op. I haven't found a place I can
retrieve this. Is this possible?

I am going to implement RegionObserver. The hook I refer to is this:

void preGetOp(ObserverContext c, Get get,
List result)

 From this preGetOp method, I have only observerContext and 'Get' objects.
Is client ID in any of these data structures? If not, are thee other ways
to get that info?

Thanks,

Xu