Optimize Follower.isOutOfSync() 38/59038/2
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 15 Jun 2017 16:10:22 +0000 (18:10 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 15 Jun 2017 16:17:54 +0000 (18:17 +0200)
commitd3c5dc3b0f6bea3fa1c2f964353b87d1a9fcaef8
tree2db51ff96be869899c2ee6b4fe4b4d554883c8eb
parentbdb818fbfc5f015ab14883348f170cca8ce79128
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>
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/Follower.java

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.