From 1984e660ade65e692708722d21cbbbf76701151c Mon Sep 17 00:00:00 2001 From: Tom Pantelis Date: Tue, 6 Mar 2018 18:39:59 -0500 Subject: [PATCH] Fix checkstyle violations in sal-akka-raft-example Change-Id: Ie9da2e69c47efeb89312eaf3e513e83b7785b422 Signed-off-by: Tom Pantelis --- .../cluster/example/ClientActor.java | 8 +-- .../cluster/example/ExampleActor.java | 28 +++++----- .../example/ExampleConfigParamsImpl.java | 2 +- .../example/ExampleRoleChangeListener.java | 37 +++++++------- .../cluster/example/LogGenerator.java | 24 ++++----- .../controller/cluster/example/Main.java | 50 +++++++++--------- .../cluster/example/TestDriver.java | 51 +++++++++---------- .../cluster/example/messages/KeyValue.java | 10 ++-- .../example/messages/RegisterListener.java | 5 +- 9 files changed, 104 insertions(+), 111 deletions(-) diff --git a/opendaylight/md-sal/sal-akka-raft-example/src/main/java/org/opendaylight/controller/cluster/example/ClientActor.java b/opendaylight/md-sal/sal-akka-raft-example/src/main/java/org/opendaylight/controller/cluster/example/ClientActor.java index fe25c75ae2..d686c11b8d 100644 --- a/opendaylight/md-sal/sal-akka-raft-example/src/main/java/org/opendaylight/controller/cluster/example/ClientActor.java +++ b/opendaylight/md-sal/sal-akka-raft-example/src/main/java/org/opendaylight/controller/cluster/example/ClientActor.java @@ -17,11 +17,11 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class ClientActor extends UntypedActor { - protected final Logger LOG = LoggerFactory.getLogger(getClass()); + private static final Logger LOG = LoggerFactory.getLogger(ClientActor.class); private final ActorRef target; - public ClientActor(ActorRef target){ + public ClientActor(ActorRef target) { this.target = target; } @@ -30,9 +30,9 @@ public class ClientActor extends UntypedActor { } @Override public void onReceive(Object message) throws Exception { - if(message instanceof KeyValue) { + if (message instanceof KeyValue) { target.tell(message, getSelf()); - } else if(message instanceof KeyValueSaved){ + } else if (message instanceof KeyValueSaved) { LOG.info("KeyValue saved"); } } diff --git a/opendaylight/md-sal/sal-akka-raft-example/src/main/java/org/opendaylight/controller/cluster/example/ExampleActor.java b/opendaylight/md-sal/sal-akka-raft-example/src/main/java/org/opendaylight/controller/cluster/example/ExampleActor.java index 9eb8fd6ed1..11278ede10 100644 --- a/opendaylight/md-sal/sal-akka-raft-example/src/main/java/org/opendaylight/controller/cluster/example/ExampleActor.java +++ b/opendaylight/md-sal/sal-akka-raft-example/src/main/java/org/opendaylight/controller/cluster/example/ExampleActor.java @@ -38,7 +38,7 @@ import org.opendaylight.yangtools.concepts.Identifier; import org.opendaylight.yangtools.util.AbstractStringIdentifier; /** - * A sample actor showing how the RaftActor is to be extended + * A sample actor showing how the RaftActor is to be extended. */ public class ExampleActor extends RaftActor implements RaftActorRecoveryCohort, RaftActorSnapshotCohort { private static final class PayloadIdentifier extends AbstractStringIdentifier { @@ -69,23 +69,23 @@ public class ExampleActor extends RaftActor implements RaftActorRecoveryCohort, @Override protected void handleNonRaftCommand(Object message) { - if(message instanceof KeyValue){ - if(isLeader()) { + if (message instanceof KeyValue) { + if (isLeader()) { persistData(getSender(), new PayloadIdentifier(persistIdentifier++), (Payload) message, false); } else { - if(getLeader() != null) { + if (getLeader() != null) { getLeader().forward(message, getContext()); } } } else if (message instanceof PrintState) { - if(LOG.isDebugEnabled()) { + if (LOG.isDebugEnabled()) { LOG.debug("State of the node:{} has entries={}, {}", getId(), state.size(), getReplicatedLogState()); } } else if (message instanceof PrintRole) { - if(LOG.isDebugEnabled()) { + if (LOG.isDebugEnabled()) { if (getRaftState() == RaftState.Leader || getRaftState() == RaftState.IsolatedLeader) { final String followers = ((Leader)this.getCurrentBehavior()).printFollowerStates(); LOG.debug("{} = {}, Peers={}, followers={}", getId(), getRaftState(), @@ -122,22 +122,23 @@ public class ExampleActor extends RaftActor implements RaftActorRecoveryCohort, @Override protected void applyState(final ActorRef clientActor, final Identifier identifier, final Object data) { - if(data instanceof KeyValue){ + if (data instanceof KeyValue) { KeyValue kv = (KeyValue) data; state.put(kv.getKey(), kv.getValue()); - if(clientActor != null) { + if (clientActor != null) { clientActor.tell(new KeyValueSaved(), getSelf()); } } } @Override + @SuppressWarnings("checkstyle:IllegalCatch") public void createSnapshot(ActorRef actorRef, java.util.Optional installSnapshotStream) { try { if (installSnapshotStream.isPresent()) { SerializationUtils.serialize((Serializable) state, installSnapshotStream.get()); } - } catch (Exception e) { + } catch (RuntimeException e) { LOG.error("Exception in creating snapshot", e); } @@ -147,12 +148,9 @@ public class ExampleActor extends RaftActor implements RaftActorRecoveryCohort, @Override public void applySnapshot(Snapshot.State snapshotState) { state.clear(); - try { - state.putAll(((MapState)snapshotState).state); - } catch (Exception e) { - LOG.error("Exception in applying snapshot", e); - } - if(LOG.isDebugEnabled()) { + state.putAll(((MapState)snapshotState).state); + + if (LOG.isDebugEnabled()) { LOG.debug("Snapshot applied to state : {}", ((HashMap) state).size()); } } diff --git a/opendaylight/md-sal/sal-akka-raft-example/src/main/java/org/opendaylight/controller/cluster/example/ExampleConfigParamsImpl.java b/opendaylight/md-sal/sal-akka-raft-example/src/main/java/org/opendaylight/controller/cluster/example/ExampleConfigParamsImpl.java index 2faae48838..65d2109b30 100644 --- a/opendaylight/md-sal/sal-akka-raft-example/src/main/java/org/opendaylight/controller/cluster/example/ExampleConfigParamsImpl.java +++ b/opendaylight/md-sal/sal-akka-raft-example/src/main/java/org/opendaylight/controller/cluster/example/ExampleConfigParamsImpl.java @@ -10,7 +10,7 @@ package org.opendaylight.controller.cluster.example; import org.opendaylight.controller.cluster.raft.DefaultConfigParamsImpl; /** - * Implementation of ConfigParams for Example + * Implementation of ConfigParams for Example. */ public class ExampleConfigParamsImpl extends DefaultConfigParamsImpl { @Override diff --git a/opendaylight/md-sal/sal-akka-raft-example/src/main/java/org/opendaylight/controller/cluster/example/ExampleRoleChangeListener.java b/opendaylight/md-sal/sal-akka-raft-example/src/main/java/org/opendaylight/controller/cluster/example/ExampleRoleChangeListener.java index 6e89ca7110..0d11d7201d 100644 --- a/opendaylight/md-sal/sal-akka-raft-example/src/main/java/org/opendaylight/controller/cluster/example/ExampleRoleChangeListener.java +++ b/opendaylight/md-sal/sal-akka-raft-example/src/main/java/org/opendaylight/controller/cluster/example/ExampleRoleChangeListener.java @@ -23,30 +23,32 @@ import scala.concurrent.Await; import scala.concurrent.duration.FiniteDuration; /** - * This is a sample implementation of a Role Change Listener which is an actor, which registers itself to the ClusterRoleChangeNotifier + * This is a sample implementation of a Role Change Listener which is an actor, which registers itself + * to the ClusterRoleChangeNotifier. + * *

* The Role Change listener receives a SetNotifiers message with the notifiers to register itself with. + * *

- * It kicks of a scheduler which sents registration messages to the notifiers, till it gets a RegisterRoleChangeListenerReply + * It kicks of a scheduler which sends registration messages to the notifiers, till it gets a + * RegisterRoleChangeListenerReply. + * *

* If all the notifiers have been regsitered with, then it cancels the scheduler. * It starts the scheduler again when it receives a new registration - * */ -public class ExampleRoleChangeListener extends AbstractUntypedActor implements AutoCloseable{ +public class ExampleRoleChangeListener extends AbstractUntypedActor implements AutoCloseable { // the akka url should be set to the notifiers actor-system and domain. private static final String NOTIFIER_AKKA_URL = "akka://raft-test@127.0.0.1:2550/user/"; - private Map notifierRegistrationStatus = new HashMap<>(); + private final Map notifierRegistrationStatus = new HashMap<>(); private Cancellable registrationSchedule = null; - private static final FiniteDuration duration = new FiniteDuration(100, TimeUnit.MILLISECONDS); - private static final FiniteDuration schedulerDuration = new FiniteDuration(1, TimeUnit.SECONDS); - private final String memberName; - private static final String[] shardsToMonitor = new String[] {"example"}; + private static final FiniteDuration DURATION = new FiniteDuration(100, TimeUnit.MILLISECONDS); + private static final FiniteDuration SCHEDULER_DURATION = new FiniteDuration(1, TimeUnit.SECONDS); + private static final String[] SHARDS_TO_MONITOR = new String[] {"example"}; public ExampleRoleChangeListener(String memberName) { - scheduleRegistrationListener(schedulerDuration); - this.memberName = memberName; + scheduleRegistrationListener(SCHEDULER_DURATION); populateRegistry(memberName); } @@ -86,9 +88,8 @@ public class ExampleRoleChangeListener extends AbstractUntypedActor implements A } private void populateRegistry(String memberName) { - - for (String shard: shardsToMonitor) { - String notifier =(new StringBuilder()).append(NOTIFIER_AKKA_URL).append(memberName) + for (String shard: SHARDS_TO_MONITOR) { + String notifier = new StringBuilder().append(NOTIFIER_AKKA_URL).append(memberName) .append("/").append(memberName).append("-notifier").toString(); if (!notifierRegistrationStatus.containsKey(notifier)) { @@ -97,17 +98,18 @@ public class ExampleRoleChangeListener extends AbstractUntypedActor implements A } if (!registrationSchedule.isCancelled()) { - scheduleRegistrationListener(schedulerDuration); + scheduleRegistrationListener(SCHEDULER_DURATION); } } + @SuppressWarnings("checkstyle:IllegalCatch") private void sendRegistrationRequests() { for (Map.Entry entry : notifierRegistrationStatus.entrySet()) { if (!entry.getValue()) { try { LOG.debug("{} registering with {}", getSelf().path().toString(), entry.getKey()); ActorRef notifier = Await.result( - getContext().actorSelection(entry.getKey()).resolveOne(duration), duration); + getContext().actorSelection(entry.getKey()).resolveOne(DURATION), DURATION); notifier.tell(new RegisterRoleChangeListener(), getSelf()); @@ -133,7 +135,8 @@ public class ExampleRoleChangeListener extends AbstractUntypedActor implements A } } } else { - LOG.info("Unexpected, RegisterRoleChangeListenerReply received from notifier which is not known to Listener:{}", + LOG.info( + "Unexpected, RegisterRoleChangeListenerReply received from notifier which is not known to Listener:{}", senderId); } } diff --git a/opendaylight/md-sal/sal-akka-raft-example/src/main/java/org/opendaylight/controller/cluster/example/LogGenerator.java b/opendaylight/md-sal/sal-akka-raft-example/src/main/java/org/opendaylight/controller/cluster/example/LogGenerator.java index f40952300a..a3fe498e8d 100644 --- a/opendaylight/md-sal/sal-akka-raft-example/src/main/java/org/opendaylight/controller/cluster/example/LogGenerator.java +++ b/opendaylight/md-sal/sal-akka-raft-example/src/main/java/org/opendaylight/controller/cluster/example/LogGenerator.java @@ -9,23 +9,21 @@ package org.opendaylight.controller.cluster.example; import akka.actor.ActorRef; -import org.opendaylight.controller.cluster.example.messages.KeyValue; - import java.util.HashMap; import java.util.Map; import java.util.Random; +import org.opendaylight.controller.cluster.example.messages.KeyValue; /** * Created by kramesha on 7/16/14. */ public class LogGenerator { - private Map clientToLoggingThread = new HashMap<>(); + private final Map clientToLoggingThread = new HashMap<>(); public void startLoggingForClient(ActorRef client) { LoggingThread lt = new LoggingThread(client); clientToLoggingThread.put(client, lt); - Thread t = new Thread(lt); - t.start(); + new Thread(lt).start(); } public void stopLoggingForClient(ActorRef client) { @@ -35,25 +33,27 @@ public class LogGenerator { public class LoggingThread implements Runnable { - private ActorRef clientActor; + private final ActorRef clientActor; private volatile boolean stopLogging = false; public LoggingThread(ActorRef clientActor) { this.clientActor = clientActor; } + @Override + @SuppressWarnings("checkstyle:RegexpSingleLineJava") public void run() { - Random r = new Random(); + Random random = new Random(); while (true) { if (stopLogging) { System.out.println("Logging stopped for client:" + clientActor.path()); break; } String key = clientActor.path().name(); - int random = r.nextInt(100); - clientActor.tell(new KeyValue(key+"-key-" + random, "value-" + random), null); + int randomInt = random.nextInt(100); + clientActor.tell(new KeyValue(key + "-key-" + randomInt, "value-" + randomInt), null); try { - Thread.sleep((random%10) * 1000); + Thread.sleep(randomInt % 10 * 1000L); } catch (InterruptedException e) { e.printStackTrace(); } @@ -67,9 +67,5 @@ public class LogGenerator { public void startLogging() { stopLogging = false; } - - } - - } diff --git a/opendaylight/md-sal/sal-akka-raft-example/src/main/java/org/opendaylight/controller/cluster/example/Main.java b/opendaylight/md-sal/sal-akka-raft-example/src/main/java/org/opendaylight/controller/cluster/example/Main.java index 0e5d643a64..5c3b49f247 100644 --- a/opendaylight/md-sal/sal-akka-raft-example/src/main/java/org/opendaylight/controller/cluster/example/Main.java +++ b/opendaylight/md-sal/sal-akka-raft-example/src/main/java/org/opendaylight/controller/cluster/example/Main.java @@ -12,18 +12,17 @@ import akka.actor.ActorRef; import akka.actor.ActorSystem; import akka.actor.PoisonPill; import com.google.common.base.Optional; -import org.opendaylight.controller.cluster.example.messages.KeyValue; -import org.opendaylight.controller.cluster.raft.ConfigParams; - import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; +import org.opendaylight.controller.cluster.example.messages.KeyValue; +import org.opendaylight.controller.cluster.raft.ConfigParams; -public class Main { - private static final ActorSystem actorSystem = ActorSystem.create(); +public final class Main { + private static final ActorSystem ACTOR_SYSTEM = ActorSystem.create(); // Create three example actors private static Map allPeers = new HashMap<>(); @@ -33,23 +32,27 @@ public class Main { allPeers.put("example-3", "akka://default/user/example-3"); } - public static void main(String[] args) throws Exception{ + private Main() { + } + + @SuppressWarnings("checkstyle:RegexpSingleLineJava") + public static void main(String[] args) throws Exception { ActorRef example1Actor = - actorSystem.actorOf(ExampleActor.props("example-1", + ACTOR_SYSTEM.actorOf(ExampleActor.props("example-1", withoutPeer("example-1"), Optional.absent()), "example-1"); ActorRef example2Actor = - actorSystem.actorOf(ExampleActor.props("example-2", + ACTOR_SYSTEM.actorOf(ExampleActor.props("example-2", withoutPeer("example-2"), Optional.absent()), "example-2"); ActorRef example3Actor = - actorSystem.actorOf(ExampleActor.props("example-3", + ACTOR_SYSTEM.actorOf(ExampleActor.props("example-3", withoutPeer("example-3"), Optional.absent()), "example-3"); List examples = Arrays.asList(example1Actor, example2Actor, example3Actor); - ActorRef clientActor = actorSystem.actorOf(ClientActor.props(example1Actor)); + ActorRef clientActor = ACTOR_SYSTEM.actorOf(ClientActor.props(example1Actor)); BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); @@ -57,25 +60,24 @@ public class Main { System.out.println("s <1-3> to start a peer"); System.out.println("k <1-3> to kill a peer"); - while(true) { + while (true) { System.out.print("Enter command (0 to exit):"); try { - String s = br.readLine(); - String[] split = s.split(" "); - if(split.length > 1) { + String line = br.readLine(); + String[] split = line.split(" "); + if (split.length > 1) { String command = split[0]; String actor = split[1]; if ("k".equals(command)) { - int i = Integer.parseInt(actor); - examples.get(i - 1) - .tell(PoisonPill.getInstance(), null); + int num = Integer.parseInt(actor); + examples.get(num - 1).tell(PoisonPill.getInstance(), null); continue; } else if ("s".equals(command)) { - int i = Integer.parseInt(actor); - String actorName = "example-" + i; - examples.add(i - 1, - actorSystem.actorOf(ExampleActor.props(actorName, + int num = Integer.parseInt(actor); + String actorName = "example-" + num; + examples.add(num - 1, + ACTOR_SYSTEM.actorOf(ExampleActor.props(actorName, withoutPeer(actorName), Optional.absent()), actorName)); System.out.println("Created actor : " + actorName); @@ -83,11 +85,11 @@ public class Main { } } - int i = Integer.parseInt(s); - if(i == 0){ + int num = Integer.parseInt(line); + if (num == 0) { System.exit(0); } - clientActor.tell(new KeyValue("key " + i, "value " + i), null); + clientActor.tell(new KeyValue("key " + num, "value " + num), null); } catch (NumberFormatException nfe) { System.err.println("Invalid Format!"); } diff --git a/opendaylight/md-sal/sal-akka-raft-example/src/main/java/org/opendaylight/controller/cluster/example/TestDriver.java b/opendaylight/md-sal/sal-akka-raft-example/src/main/java/org/opendaylight/controller/cluster/example/TestDriver.java index 2a3db4d9a5..ab980f7783 100644 --- a/opendaylight/md-sal/sal-akka-raft-example/src/main/java/org/opendaylight/controller/cluster/example/TestDriver.java +++ b/opendaylight/md-sal/sal-akka-raft-example/src/main/java/org/opendaylight/controller/cluster/example/TestDriver.java @@ -29,9 +29,8 @@ import org.opendaylight.controller.cluster.raft.ConfigParams; * Each ExampleActor can have one or more ClientActors. Each ClientActor spawns * a thread and starts push logs to the actor its assigned to. */ +@SuppressWarnings("checkstyle:RegexpSingleLineJava") public class TestDriver { - - private static Map allPeers = new HashMap<>(); private static Map clientActorRefs = new HashMap<>(); private static Map actorRefs = new HashMap<>(); @@ -58,12 +57,10 @@ public class TestDriver { * printNodes * printState * + *

* Note: when run on IDE and on debug log level, the debug logs in * AbstractUptypedActor and AbstractUptypedPersistentActor would need to be commented out. * Also RaftActor handleCommand(), debug log which prints for every command other than AE/AER - * - * @param args - * @throws Exception */ public static void main(String[] args) throws Exception { @@ -79,26 +76,26 @@ public class TestDriver { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); - while(true) { + while (true) { String command = br.readLine(); if (command.startsWith("bye")) { System.exit(0); } else if (command.startsWith("createNodes")) { String[] arr = command.split(":"); - int n = Integer.parseInt(arr[1]); - td.createNodes(n); + int num = Integer.parseInt(arr[1]); + td.createNodes(num); } else if (command.startsWith("addClients")) { String[] arr = command.split(":"); - int n = Integer.parseInt(arr[1]); - td.addClients(n); + int num = Integer.parseInt(arr[1]); + td.addClients(num); } else if (command.startsWith("addClientsToNode")) { String[] arr = command.split(":"); String nodeName = arr[1]; - int n = Integer.parseInt(arr[1]); - td.addClientsToNode(nodeName, n); + int num = Integer.parseInt(arr[1]); + td.addClientsToNode(nodeName, num); } else if (command.startsWith("stopNode")) { String[] arr = command.split(":"); @@ -135,7 +132,7 @@ public class TestDriver { // create the listener using a separate actor system for each example actor private static void createClusterRoleChangeListener(List memberIds) { - System.out.println("memberIds="+memberIds); + System.out.println("memberIds=" + memberIds); for (String memberId : memberIds) { ActorRef listenerActor = listenerActorSystem.actorOf( ExampleRoleChangeListener.getProps(memberId), memberId + "-role-change-listener"); @@ -149,16 +146,15 @@ public class TestDriver { } public void createNodes(int num) { - for (int i=0; i < num; i++) { + for (int i = 0; i < num; i++) { nameCounter = nameCounter + 1; - allPeers.put("example-"+nameCounter, "akka://raft-test/user/example-"+nameCounter); + allPeers.put("example-" + nameCounter, "akka://raft-test/user/example-" + nameCounter); } for (String s : allPeers.keySet()) { ActorRef exampleActor = createExampleActor(s); actorRefs.put(s, exampleActor); - System.out.println("Created node:"+s); - + System.out.println("Created node:" + s); } createClusterRoleChangeListener(Lists.newArrayList(allPeers.keySet())); @@ -166,8 +162,8 @@ public class TestDriver { // add num clients to all nodes in the system public void addClients(int num) { - for(Map.Entry actorRefEntry : actorRefs.entrySet()) { - for (int i=0; i < num; i++) { + for (Map.Entry actorRefEntry : actorRefs.entrySet()) { + for (int i = 0; i < num; i++) { String clientName = "client-" + i + "-" + actorRefEntry.getKey(); ActorRef clientActor = actorSystem.actorOf( ClientActor.props(actorRefEntry.getValue()), clientName); @@ -180,7 +176,7 @@ public class TestDriver { // add num clients to a node public void addClientsToNode(String actorName, int num) { ActorRef actorRef = actorRefs.get(actorName); - for (int i=0; i < num; i++) { + for (int i = 0; i < num; i++) { String clientName = "client-" + i + "-" + actorName; clientActorRefs.put(clientName, actorSystem.actorOf(ClientActor.props(actorRef), clientName)); @@ -203,7 +199,7 @@ public class TestDriver { } public void reinstateNode(String actorName) { - String address = "akka://default/user/"+actorName; + String address = "akka://default/user/" + actorName; allPeers.put(actorName, address); ActorRef exampleActor = createExampleActor(actorName); @@ -213,15 +209,16 @@ public class TestDriver { } public void startAllLogging() { - if(!clientActorRefs.isEmpty()) { - for(Map.Entry client : clientActorRefs.entrySet()) { + if (!clientActorRefs.isEmpty()) { + for (Map.Entry client : clientActorRefs.entrySet()) { logGenerator.startLoggingForClient(client.getValue()); - System.out.println("Started logging for client:"+client.getKey()); + System.out.println("Started logging for client:" + client.getKey()); } } else { - System.out.println("There are no clients for any nodes. First create clients using commands- addClients: or addClientsToNode::"); + System.out.println( + "There are no clients for any nodes. First create clients using commands- addClients: or " + + "addClientsToNode::"); } - } public void startLoggingForClient(ActorRef client) { @@ -229,7 +226,7 @@ public class TestDriver { } public void stopAllLogging() { - for(Map.Entry client : clientActorRefs.entrySet()) { + for (Map.Entry client : clientActorRefs.entrySet()) { logGenerator.stopLoggingForClient(client.getValue()); } } diff --git a/opendaylight/md-sal/sal-akka-raft-example/src/main/java/org/opendaylight/controller/cluster/example/messages/KeyValue.java b/opendaylight/md-sal/sal-akka-raft-example/src/main/java/org/opendaylight/controller/cluster/example/messages/KeyValue.java index 8916d9f9e3..520188b8cd 100644 --- a/opendaylight/md-sal/sal-akka-raft-example/src/main/java/org/opendaylight/controller/cluster/example/messages/KeyValue.java +++ b/opendaylight/md-sal/sal-akka-raft-example/src/main/java/org/opendaylight/controller/cluster/example/messages/KeyValue.java @@ -19,7 +19,7 @@ public class KeyValue extends Payload implements Serializable { public KeyValue() { } - public KeyValue(String key, String value){ + public KeyValue(String key, String value) { this.key = key; this.value = value; } @@ -40,11 +40,9 @@ public class KeyValue extends Payload implements Serializable { this.value = value; } - @Override public String toString() { - return "KeyValue{" + - "key='" + key + '\'' + - ", value='" + value + '\'' + - '}'; + @Override + public String toString() { + return "KeyValue{" + "key='" + key + '\'' + ", value='" + value + '\'' + '}'; } @Override diff --git a/opendaylight/md-sal/sal-akka-raft-example/src/main/java/org/opendaylight/controller/cluster/example/messages/RegisterListener.java b/opendaylight/md-sal/sal-akka-raft-example/src/main/java/org/opendaylight/controller/cluster/example/messages/RegisterListener.java index 1f1e4d17e1..8baa2105f0 100644 --- a/opendaylight/md-sal/sal-akka-raft-example/src/main/java/org/opendaylight/controller/cluster/example/messages/RegisterListener.java +++ b/opendaylight/md-sal/sal-akka-raft-example/src/main/java/org/opendaylight/controller/cluster/example/messages/RegisterListener.java @@ -9,9 +9,8 @@ package org.opendaylight.controller.cluster.example.messages; /** - * Message sent by the Example Role Change Listener to itself for registering itself with the notifiers - * - * This message is sent by the scheduler + * Message sent by the Example Role Change Listener to itself for registering itself with the notifiers. + * This message is sent by the scheduler. */ public class RegisterListener { } -- 2.36.6