From: Moiz Raja Date: Fri, 13 Mar 2015 10:26:21 +0000 (+0000) Subject: Merge "Use static Procedure callback for ApplyJournalEntries" X-Git-Tag: release/lithium~405 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=d7d67c58c7aacbb320f6d3d43918f80ccc2808d1;hp=81d69b64c20a8e17279a57920beab854922c668c Merge "Use static Procedure callback for ApplyJournalEntries" --- diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/RaftActor.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/RaftActor.java index 01787a8497..eaa005e3ef 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/RaftActor.java +++ b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/RaftActor.java @@ -87,6 +87,13 @@ public abstract class RaftActor extends AbstractUntypedPersistentActor { private static final long APPLY_STATE_DELAY_THRESHOLD_IN_NANOS = TimeUnit.MILLISECONDS.toNanos(50L); // 50 millis + private static final Procedure APPLY_JOURNAL_ENTRIES_PERSIST_CALLBACK = + new Procedure() { + @Override + public void apply(ApplyJournalEntries param) throws Exception { + } + }; + protected final Logger LOG = LoggerFactory.getLogger(getClass()); /** @@ -319,11 +326,8 @@ public abstract class RaftActor extends AbstractUntypedPersistentActor { if(LOG.isDebugEnabled()) { LOG.debug("{}: Persisting ApplyLogEntries with index={}", persistenceId(), applyEntries.getToIndex()); } - persistence().persist(applyEntries, new Procedure() { - @Override - public void apply(ApplyJournalEntries param) throws Exception { - } - }); + + persistence().persist(applyEntries, APPLY_JOURNAL_ENTRIES_PERSIST_CALLBACK); } else if(message instanceof ApplySnapshot ) { Snapshot snapshot = ((ApplySnapshot) message).getSnapshot();