private HostFailoverPolicy getFailoverPolicy ( String failoverOption ) { if ( failoverOption != null ) { if ( Constants . FAIL_FAST . equals ( failoverOption ) ) { return HostFailoverPolicy . FAIL_FAST ; } else if ( Constants . ON_FAIL_TRY_ALL_AVAILABLE . equals ( failoverOption ) ) { return HostFailoverPolicy . ON_FAIL_TRY_ALL_AVAILABLE ; } else if ( Constants . ON_FAIL_TRY_ONE_NEXT_AVAILABLE . equals ( failoverOption ) ) { return HostFailoverPolicy . ON_FAIL_TRY_ONE_NEXT_AVAILABLE ; } else { logger . warn ( "Invalid failover policy {}, using default {} " , failoverOption , HostFailoverPolicy . ON_FAIL_TRY_ALL_AVAILABLE . name ( ) ) ; return HostFailoverPolicy . ON_FAIL_TRY_ALL_AVAILABLE ; } } return HostFailoverPolicy . ON_FAIL_TRY_ALL_AVAILABLE ; }
Resolve failover policy for Cassandra thrift .