X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-akka-raft-example%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fexample%2FMain.java;fp=opendaylight%2Fmd-sal%2Fsal-akka-raft-example%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fexample%2FMain.java;h=ae8ea822956b96fbb678c17332ec27e7fe30088e;hb=20733d0406fb31b701e32ee74ee13dc8769a256c;hp=54ff92993a9ad23e2236b26c2944a28c944f9ba3;hpb=baf24349053f1097e311de0b6632a7463bff7b1b;p=controller.git 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 54ff92993a..ae8ea82295 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 @@ -5,13 +5,11 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - package org.opendaylight.controller.cluster.example; import akka.actor.ActorRef; import akka.actor.ActorSystem; import akka.actor.PoisonPill; -import com.google.common.base.Optional; import java.io.BufferedReader; import java.io.InputStreamReader; import java.nio.charset.Charset; @@ -19,8 +17,8 @@ import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Optional; import org.opendaylight.controller.cluster.example.messages.KeyValue; -import org.opendaylight.controller.cluster.raft.ConfigParams; public final class Main { private static final ActorSystem ACTOR_SYSTEM = ActorSystem.create(); @@ -37,18 +35,18 @@ public final class Main { } @SuppressWarnings("checkstyle:RegexpSingleLineJava") - public static void main(String[] args) throws Exception { + public static void main(final String[] args) throws Exception { ActorRef example1Actor = ACTOR_SYSTEM.actorOf(ExampleActor.props("example-1", - withoutPeer("example-1"), Optional.absent()), "example-1"); + withoutPeer("example-1"), Optional.empty()), "example-1"); ActorRef example2Actor = ACTOR_SYSTEM.actorOf(ExampleActor.props("example-2", - withoutPeer("example-2"), Optional.absent()), "example-2"); + withoutPeer("example-2"), Optional.empty()), "example-2"); ActorRef example3Actor = ACTOR_SYSTEM.actorOf(ExampleActor.props("example-3", - withoutPeer("example-3"), Optional.absent()), "example-3"); + withoutPeer("example-3"), Optional.empty()), "example-3"); List examples = Arrays.asList(example1Actor, example2Actor, example3Actor); @@ -82,8 +80,7 @@ public final class Main { String actorName = "example-" + num; examples.add(num - 1, ACTOR_SYSTEM.actorOf(ExampleActor.props(actorName, - withoutPeer(actorName), Optional.absent()), - actorName)); + withoutPeer(actorName), Optional.empty()), actorName)); System.out.println("Created actor : " + actorName); continue; } @@ -100,7 +97,7 @@ public final class Main { } } - private static Map withoutPeer(String peerId) { + private static Map withoutPeer(final String peerId) { Map without = new HashMap<>(allPeers); without.remove(peerId); return without;