Merge "Fix raw references to Iterator"
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / example / TestDriver.java
index cb51a8951a54f158bac9b7bf1cab769662568fc3..de6169791ed4cb4405e6f47e85e0ed3535155fd1 100644 (file)
@@ -6,7 +6,6 @@ import com.google.common.base.Optional;
 import org.opendaylight.controller.cluster.example.messages.PrintRole;
 import org.opendaylight.controller.cluster.example.messages.PrintState;
 import org.opendaylight.controller.cluster.raft.ConfigParams;
-import org.opendaylight.controller.cluster.raft.client.messages.AddRaftPeer;
 
 import java.io.BufferedReader;
 import java.io.InputStreamReader;
@@ -35,7 +34,6 @@ public class TestDriver {
      * Commands
      *  bye
      *  createNodes:{num}
-     *  addNodes:{num}
      *  stopNode:{nodeName}
      *  reinstateNode:{nodeName}
      *  addClients:{num}
@@ -46,6 +44,11 @@ public class TestDriver {
      *  stopLoggingForClient:{nodeName}
      *  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
      */
@@ -66,11 +69,6 @@ public class TestDriver {
                 int n = Integer.parseInt(arr[1]);
                 td.createNodes(n);
 
-            } else if (command.startsWith("addNodes")) {
-                String[] arr = command.split(":");
-                int n = Integer.parseInt(arr[1]);
-                td.addNodes(n);
-
             } else if (command.startsWith("addClients")) {
                 String[] arr = command.split(":");
                 int n = Integer.parseInt(arr[1]);
@@ -134,32 +132,6 @@ public class TestDriver {
         }
     }
 
-    // add new nodes , pass in the count
-    public void addNodes(int num) {
-        Map<String, String> newPeers = new HashMap<>();
-        for (int i=0; i < num; i++)  {
-            nameCounter = nameCounter + 1;
-            newPeers.put("example-"+nameCounter, "akka://default/user/example-"+nameCounter);
-            allPeers.put("example-"+nameCounter, "akka://default/user/example-"+nameCounter);
-
-        }
-        Map<String, ActorRef> newActorRefs = new HashMap<String, ActorRef>(num);
-        for (Map.Entry<String, String> entry : newPeers.entrySet())  {
-            ActorRef exampleActor = createExampleActor(entry.getKey());
-            newActorRefs.put(entry.getKey(), exampleActor);
-
-            //now also add these new nodes as peers from the previous nodes
-            for (ActorRef actor : actorRefs.values()) {
-                actor.tell(new AddRaftPeer(entry.getKey(), entry.getValue()), null);
-            }
-
-            System.out.println("Added node:" + entry);
-        }
-
-        actorRefs.putAll(newActorRefs);
-    }
-
-
     // add num clients to all nodes in the system
     public void addClients(int num) {
         for(Map.Entry<String,ActorRef> actorRefEntry : actorRefs.entrySet()) {