Bug 5740: Remove Serializable where not necessary 74/57774/1
authorTom Pantelis <tompantelis@gmail.com>
Wed, 24 May 2017 13:40:52 +0000 (09:40 -0400)
committerTom Pantelis <tompantelis@gmail.com>
Wed, 24 May 2017 13:40:52 +0000 (09:40 -0400)
Some raft message classes are Serializable but they don't need to
be as they're only sent locally.

Change-Id: Ibd052b9a4589dd2476b30c51e301b3dd609df750
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/base/messages/ApplyState.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/base/messages/ElectionTimeout.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/base/messages/InitiateCaptureSnapshot.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/base/messages/Replicate.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/base/messages/SendHeartBeat.java

index 1f92d5f..498d8d3 100644 (file)
@@ -9,12 +9,13 @@
 package org.opendaylight.controller.cluster.raft.base.messages;
 
 import akka.actor.ActorRef;
-import java.io.Serializable;
 import org.opendaylight.controller.cluster.raft.ReplicatedLogEntry;
 import org.opendaylight.yangtools.concepts.Identifier;
 
-public class ApplyState implements Serializable {
-    private static final long serialVersionUID = 1L;
+/**
+ * Local message sent by a RaftActor to itself to signal state has been applied to the state machine.
+ */
+public class ApplyState {
     private final ActorRef clientActor;
     private final Identifier identifier;
     private final ReplicatedLogEntry replicatedLogEntry;
index 8dd49e1..606835e 100644 (file)
@@ -8,13 +8,10 @@
 
 package org.opendaylight.controller.cluster.raft.base.messages;
 
-import java.io.Serializable;
-
 /**
- * Message sent to indicate the current election term has timed out.
+ * Local message sent to indicate the current election term has timed out.
  */
-public final class ElectionTimeout implements Serializable {
-    private static final long serialVersionUID = 1L;
+public final class ElectionTimeout {
     public static final ElectionTimeout INSTANCE = new ElectionTimeout();
 
     private ElectionTimeout() {
index 1845f73..c58d863 100644 (file)
@@ -9,12 +9,10 @@
 package org.opendaylight.controller.cluster.raft.base.messages;
 
 import akka.actor.ActorRef;
-import java.io.Serializable;
 import org.opendaylight.controller.cluster.raft.ReplicatedLogEntry;
 import org.opendaylight.yangtools.concepts.Identifier;
 
-public class Replicate implements Serializable {
-    private static final long serialVersionUID = 1L;
+public class Replicate {
     private final ActorRef clientActor;
     private final Identifier identifier;
     private final ReplicatedLogEntry replicatedLogEntry;
index ba1c157..31d15dd 100644 (file)
@@ -8,13 +8,10 @@
 
 package org.opendaylight.controller.cluster.raft.base.messages;
 
-import java.io.Serializable;
-
 /**
  * This messages is sent via a schedule to the Leader to prompt it to send a heart beat to its followers.
  */
-public final class SendHeartBeat implements Serializable {
-    private static final long serialVersionUID = 1L;
+public final class SendHeartBeat {
     public static final SendHeartBeat INSTANCE = new SendHeartBeat();
 
     private SendHeartBeat() {

©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.