Optimize Follower.isOutOfSync() 49/59049/1
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 15 Jun 2017 16:10:22 +0000 (18:10 +0200)
committerTom Pantelis <tompantelis@gmail.com>
Thu, 15 Jun 2017 20:12:38 +0000 (20:12 +0000)
commit0d7da5cfabbf4f7e7aeaa6d83cf86dcfd2c924f7
treeed5d31c1107f2bf534075abf0b432a31c4228989
parent758b6995d878eec225fdd959913b5495576649c2
Optimize Follower.isOutOfSync()

This is a fast-path method which does a few duplicate checks
and calculations that may end up being unnecessary.

Restructure it so we check each partial condition just once
and compute required inputs only when we are going to need them.

Change-Id: I67a0089693a2ba1cd8c06c43504266534090545b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit d3c5dc3b0f6bea3fa1c2f964353b87d1a9fcaef8)
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/Follower.java