Implement handling of AppendEntries from a recipient perspective
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / ElectionTermImpl.java
index e918f75273483cd11ab73a68bdc7ab36db8a59cf..6a598be680b3607e96952a47edf7d03db7226fa0 100644 (file)
@@ -8,15 +8,13 @@
 
 package org.opendaylight.controller.cluster.raft;
 
-import java.util.concurrent.atomic.AtomicLong;
-
 public class ElectionTermImpl implements ElectionTerm{
     /**
      * Identifier of the actor whose election term information this is
      */
     private final String id;
 
-    private AtomicLong currentTerm;
+    private long currentTerm;
 
     private String votedFor;
 
@@ -24,13 +22,13 @@ public class ElectionTermImpl implements ElectionTerm{
         this.id = id;
 
         // TODO: Read currentTerm from some persistent state
-        currentTerm = new AtomicLong(0);
+        currentTerm = 0;
 
         // TODO: Read votedFor from some file
         votedFor = "";
     }
 
-    public AtomicLong getCurrentTerm() {
+    public long getCurrentTerm() {
         return currentTerm;
     }
 
@@ -38,7 +36,7 @@ public class ElectionTermImpl implements ElectionTerm{
         return votedFor;
     }
 
-    public void update(AtomicLong currentTerm, String votedFor){
+    public void update(long currentTerm, String votedFor){
         this.currentTerm = currentTerm;
         this.votedFor = votedFor;