fix some spelling mistakes

This commit is contained in:
gqxie 2018-12-19 16:57:27 +08:00
parent d40ce1fbc1
commit a4c2ffe82a
3 changed files with 6 additions and 6 deletions

View File

@ -21,7 +21,7 @@ import java.util.concurrent.*;
* @author nacos * @author nacos
*/ */
public class GlobalExecutor { public class GlobalExecutor {
public static final long HEARTBEAT_INTVERAL_MS = TimeUnit.SECONDS.toMillis(5L); public static final long HEARTBEAT_INTERVAL_MS = TimeUnit.SECONDS.toMillis(5L);
public static final long LEADER_TIMEOUT_MS = TimeUnit.SECONDS.toMillis(15L); public static final long LEADER_TIMEOUT_MS = TimeUnit.SECONDS.toMillis(15L);
@ -29,7 +29,7 @@ public class GlobalExecutor {
public static final long TICK_PERIOD_MS = TimeUnit.MILLISECONDS.toMillis(500L); public static final long TICK_PERIOD_MS = TimeUnit.MILLISECONDS.toMillis(500L);
public static final long ADDRESS_SERVER_UPDATE_INTVERAL_MS = TimeUnit.SECONDS.toMillis(5L); public static final long ADDRESS_SERVER_UPDATE_INTERVAL_MS = TimeUnit.SECONDS.toMillis(5L);
private static ScheduledExecutorService executorService = new ScheduledThreadPoolExecutor(2, new ThreadFactory() { private static ScheduledExecutorService executorService = new ScheduledThreadPoolExecutor(2, new ThreadFactory() {
@Override @Override

View File

@ -120,7 +120,7 @@ public class RaftCore {
GlobalExecutor.register(new MasterElection()); GlobalExecutor.register(new MasterElection());
GlobalExecutor.register1(new HeartBeat()); GlobalExecutor.register1(new HeartBeat());
GlobalExecutor.register(new AddressServerUpdater(), GlobalExecutor.ADDRESS_SERVER_UPDATE_INTVERAL_MS); GlobalExecutor.register(new AddressServerUpdater(), GlobalExecutor.ADDRESS_SERVER_UPDATE_INTERVAL_MS);
if (peers.size() > 0) { if (peers.size() > 0) {
if (lock.tryLock(INIT_LOCK_TIME_SECONDS, TimeUnit.SECONDS)) { if (lock.tryLock(INIT_LOCK_TIME_SECONDS, TimeUnit.SECONDS)) {
@ -132,7 +132,7 @@ public class RaftCore {
} }
Loggers.RAFT.info("timer started: leader timeout ms: " + GlobalExecutor.LEADER_TIMEOUT_MS Loggers.RAFT.info("timer started: leader timeout ms: " + GlobalExecutor.LEADER_TIMEOUT_MS
+ "; heart-beat timeout ms: " + GlobalExecutor.HEARTBEAT_INTVERAL_MS); + "; heart-beat timeout ms: " + GlobalExecutor.HEARTBEAT_INTERVAL_MS);
} }
public static List<RaftListener> getListeners() { public static List<RaftListener> getListeners() {

View File

@ -34,7 +34,7 @@ public class RaftPeer {
public volatile long leaderDueMs = RandomUtils.nextLong(0, GlobalExecutor.LEADER_TIMEOUT_MS); public volatile long leaderDueMs = RandomUtils.nextLong(0, GlobalExecutor.LEADER_TIMEOUT_MS);
public volatile long heartbeatDueMs = RandomUtils.nextLong(0, GlobalExecutor.HEARTBEAT_INTVERAL_MS); public volatile long heartbeatDueMs = RandomUtils.nextLong(0, GlobalExecutor.HEARTBEAT_INTERVAL_MS);
public State state = State.FOLLOWER; public State state = State.FOLLOWER;
@ -43,7 +43,7 @@ public class RaftPeer {
} }
public void resetHeartbeatDue() { public void resetHeartbeatDue() {
heartbeatDueMs = GlobalExecutor.HEARTBEAT_INTVERAL_MS; heartbeatDueMs = GlobalExecutor.HEARTBEAT_INTERVAL_MS;
} }
public enum State { public enum State {