private void checkHealth()
{
try
{
HealthCheckDecoder healthCheck = healthCheckFactory.makeDecoder();
// See: doGetConnection() - this will purge closed
// connections from the available queue and either
// return/create a new one (meaning the node is up) or throw
// an exception if a connection can't be made.
Channel c = doGetConnection();
Promise<RiakMessage> promise;
if (c.pipeline().names().contains(Constants.SSL_HANDLER))
{
c.pipeline().addAfter(Constants.SSL_HANDLER, Constants.HEALTHCHECK_CODEC, healthCheck);
}
else
{
c.pipeline().addBefore(Constants.MESSAGE_CODEC, Constants.HEALTHCHECK_CODEC, healthCheck);
}
logger.debug("healthCheck added to pipeline.");
try
{
promise = healthCheck.getPromise();
promise.await();
if (promise.isSuccess())
{
if (state == State.HEALTH_CHECKING)
{