walterddr commented on issue #8246:
URL: https://github.com/apache/pinot/issues/8246#issuecomment-1066165696


   #8329 seems to work pretty well as a POC: here is my adjusted plan based on 
the POC
   
   Problem
   ===
   Currently there are many ad-hoc usage/utils that makes http call to Pinot 
components, to name a few
   - `ControllerTestUtils` that uses `URLConnection` to Controller 
     - also uses `HTTPClient` from Apache HTTP module for 2 of the multi-part 
request
   - FileUploadDownloadClient that uses Apache Common `HTTPClient` with 
SSLContext support
   - other standalone modules such as Pinot spark/flink connector that uses its 
own HTTPUtils
   
   There are discrepancies regarding (1) what's the format of the send data / 
return; (2) what type of return code throws exception or encapsulate the 
exception in the response code; (3) what default header is being used. 
   
   What's more, there are inefficiency in HTTPClient usage: in general 
HTTPClient should be used as a singleton and leverage the underlying resource 
reused benefit. 
   
   Proposal
   ===
   Propose to 
   1. add HTTPClient in pinot-common that provides generic get/post/put/delete 
method to RestAPI and parsing response objects/status code.
       - for advance usage such as file upload download, also provide the API 
to return closable http response stream.
   2. ControllerRequestClient that utilizes the HTTPClient singleton to make 
specific requests such as getSchema, getTableConfig, etc.
       - later on we can extend to Broker/Server APIs.
   3. Replace any http request utils with the client construct (with a static 
reference to the singelton HTTPClient)
   
   
   


-- 
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: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to