vvivekiyer commented on issue #9194:
URL: https://github.com/apache/pinot/issues/9194#issuecomment-1213525988

   IMO, I would avoid using `instanceOf` to achieve this. Here's the 
[reason](https://armedia.com/blog/instanceof-avoid-in-code/) for the same.
   
   What I was suggesting is as follows: 
   Have a method called `getClientIp` in RequesterIdentity. The default 
implementation can be to return "unknown"/empty. Allow all the subclasses to 
have their own implementation for `getClientIp`. The implementation of 
`getClientIp` in `HttpRequesterIdentity` would borrow the code from 
[here](https://github.com/apache/pinot/blob/67344859c270b9e64638b6691d456e57a7570403/pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/BaseBrokerRequestHandler.java#L679).
 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to