code: private static Observable<PingServiceHealth> pingQuery(
          final NetworkAddress hostname, final String bucket, final String password,
          final ClusterFacade core, final long timeout, final TimeUnit timeUnit) {
          final AtomicReference<CouchbaseRequest> request = new AtomicReference<CouchbaseRequest>();
          Observable<com.couchbase.client.core.message.query.PingResponse> response =
              Observable.defer(new Func0<Observable<com.couchbase.client.core.message.query.PingResponse>>() {
              @Override
              public Observable<com.couchbase.client.core.message.query.PingResponse> call() {
                  CouchbaseRequest r;
                  try {
                      r = new com.couchbase.client.core.message.query.PingRequest(
                          InetAddress.getByName(hostname.address()), bucket, password
                      );
                  } catch (Exception e) {
                      return Observable.error(e);
                  }
                  request.set(r);
                  return core.send(r);
              }
          }).timeout(timeout, timeUnit);
          return mapToServiceHealth(null, ServiceType.QUERY, response, request, timeout, timeUnit);
      }
docs: Pings the service and completes if successful - and fails if it didn't work
  for some reason (reason is in the exception).