public long [ ] matchIndices ( ) { // Leader index is appended at the end of array in AppendSuccessResponseHandlerTask // That's why we add one more empty slot. long [ ] indices = new long [ followerStates . size ( ) + 1 ] ; int ix = 0 ; for ( FollowerState state : followerStates . values ( ) ) { indices [ ix ++ ] = state . matchIndex ( ) ; } return indices ; }
Returns an array of match indices for all followers . Additionally an empty slot is added at the end of indices array for leader itself .