public CheckPointState nextState ( boolean recovering ) { CheckPointState nextState ; switch ( state ) { case PREPARING : nextState = recovering ? new CheckPointState ( txid - 1 , State . COMMITTED ) : new CheckPointState ( txid , State . COMMITTING ) ; break ; case COMMITTING : nextState = new CheckPointState ( txid , State . COMMITTED ) ; break ; case COMMITTED : nextState = recovering ? this : new CheckPointState ( txid + 1 , State . PREPARING ) ; break ; default : throw new IllegalStateException ( "Unknown state " + state ) ; } return nextState ; }
Get the next state based on this checkpoint state .