protected boolean checkTerm ( AppendRequest request , CompletableFuture < AppendResponse > future ) { RaftLogWriter writer = raft . getLogWriter ( ) ; if ( request . term ( ) < raft . getTerm ( ) ) { log . debug ( "Rejected {}: request term is less than the current term ({})" , request , raft . getTerm ( ) ) ; return failAppend ( writer . getLastIndex ( ) , future ) ; } return true ; }
Checks the leader s term of the given AppendRequest returning a boolean indicating whether to continue handling the request .