public boolean stopStandby ( ) { for ( int k = 0 ; k < mNumOfMasters ; k ++ ) { if ( ! mMasters . get ( k ) . isServing ( ) ) { try { LOG . info ( "master {} is a standby. stopping it..." , k ) ; mMasters . get ( k ) . stop ( ) ; LOG . info ( "master {} stopped." , k ) ; } catch ( Exception e ) { LOG . error ( e . getMessage ( ) , e ) ; return false ; } return true ; } } return false ; }
Iterates over the masters in the order of master creation stops the first standby master .