Connection timeout when resthighlevel client is called from spark mapPartitions method

Didnt used curl commands to test ; but have checked like if we do connection outside mapPartitions() and put sample request we get a response. If we do the same inside mapPartitions() it gives connection time out.

We use dataproc to submit spark ; since code in the driver gets response; when we do the same inside mapPartitions() it has to yield response.

Also we have referred this:

Declaring RestHighLevelClient as private , would lead to serialization issue; so we declared it as transient.