public RaftClient(RpcClientFactory rpcClientFactory, ClusterConfiguration configuration, LoggerFactory loggerFactory){ this.random = new Random(Calendar.getInstance().getTimeInMillis()); this.rpcClientFactory = rpcClientFactory; this.configuration = configuration; this.leaderId = configuration.getServers().get(this.random.nextInt(configuration.getServers().size())).getId(); this.randomLeader = true; this.logger = loggerFactory.getLogger(getClass()); this.timer = new Timer(); }
public RaftClient(RpcClientFactory rpcClientFactory, ClusterConfiguration configuration, LoggerFactory loggerFactory){ this.random = new Random(Calendar.getInstance().getTimeInMillis()); this.rpcClientFactory = rpcClientFactory; this.configuration = configuration; this.leaderId = configuration.getServers().get(this.random.nextInt(configuration.getServers().size())).getId(); this.randomLeader = true; this.logger = loggerFactory.getLogger(getClass()); this.timer = new Timer(); }
public RaftClient(RpcClientFactory rpcClientFactory, ClusterConfiguration configuration, LoggerFactory loggerFactory){ this.random = new Random(Calendar.getInstance().getTimeInMillis()); this.rpcClientFactory = rpcClientFactory; this.configuration = configuration; this.leaderId = configuration.getServers().get(this.random.nextInt(configuration.getServers().size())).getId(); this.randomLeader = true; this.logger = loggerFactory.getLogger(getClass()); this.timer = new Timer(); }
this.snapshotInProgress = new AtomicInteger(0); this.context = context; this.logger = context.getLoggerFactory().getLogger(this.getClass()); this.random = new Random(Calendar.getInstance().getTimeInMillis()); this.electionTimeoutTask = new Callable<Void>(){
this.snapshotInProgress = new AtomicInteger(0); this.context = context; this.logger = context.getLoggerFactory().getLogger(this.getClass()); this.random = new Random(Calendar.getInstance().getTimeInMillis()); this.electionTimeoutTask = new Callable<Void>(){
this.snapshotInProgress = new AtomicInteger(0); this.context = context; this.logger = context.getLoggerFactory().getLogger(this.getClass()); this.random = new Random(Calendar.getInstance().getTimeInMillis()); this.electionTimeoutTask = new Callable<Void>(){