public static boolean isHostsAvailabilityError(Throwable e){
  while (e != null) {
    if (e instanceof NoHostAvailableException || e instanceof ReadTimeoutException)     return true;
    e=e.getCause();
  }
  return false;
}

public static boolean isHostsAvailabilityError ( Throwable e ) { while ( e != null ) { if ( e instanceof NoHostAvailableException || e instanceof ReadTimeoutException ) return true ; e = e . getCause ( ) ; } return false ; }
checks if cassandra host availability error occur , thus host became unavailable .
