We are caching the created connection, and use ping often to ensure that the connection is still valid and would like it to fail quickly if not so we can create a new one.
With the Java High Level REST Client we can provide RequestOptions allowing us to set a short timeout for the ping.
This isn't possible at the moment. However there is a workaround: ping is a very simple API endpoint and it's easy to call it with the low level REST client used to create the Java API client:
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.