public static final Transaction . PingStatus encode ( final Controller . PingTxnStatus . Status status , final String logString ) throws PingFailedException { Preconditions . checkNotNull ( status , "status" ) ; Exceptions . checkNotNullOrEmpty ( logString , "logString" ) ; Transaction . PingStatus result ; switch ( status ) { case OK : result = Transaction . PingStatus . OPEN ; break ; case COMMITTED : result = Transaction . PingStatus . COMMITTED ; break ; case ABORTED : result = Transaction . PingStatus . ABORTED ; break ; default : throw new PingFailedException ( "Ping transaction for " + logString + " failed with status " + status ) ; } return result ; }
Returns the status of Ping Transaction .