Reduce/enhance logging in AbstractLeader 66/16366/1
authorTom Pantelis <tpanteli@brocade.com>
Wed, 11 Mar 2015 22:31:25 +0000 (18:31 -0400)
committerTom Pantelis <tpanteli@brocade.com>
Wed, 11 Mar 2015 22:31:25 +0000 (18:31 -0400)
commita3eb9709c251d4bbeb4cbba1f68f86b6f2775b73
tree03d55d52379fe3409c1c8f439acb4c27c325ac8c
parentfba74fb93e947ecde93ef6685ef6303d2a8bb947
Reduce/enhance logging in AbstractLeader

If you turn on debug logging for Shard, the "Checking sendAppendEntries
for follower..." message is logged by sendUpdatesToFollower on every
AppendEntriesReply heartbeat even when no data was sent to the follower.
This bombards the karaf.log. To avoid this, we need this only logged if
something changed for the follower. So, I changed the FollwerLogInformation
setMatchIndex and setNextIndex methods to return a boolean if changed
which handleAppendEntriesReply checks to see if either were updated. If
neither changed, it passes true to sendUpdatesToFollower for isHeartbeat
so the message isn't logged.

I also made a few other minor logging changes.

Change-Id: Ib1f2109092b3656c3cc3dfdd2cd7b4641a3f890b
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/FollowerLogInformation.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/FollowerLogInformationImpl.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/AbstractLeader.java