/** @deprecated use {@link #getTimeoutMax()}. */ @Deprecated public int getMaxTimeout() { return RaftServerConfigKeys.Rpc.timeoutMax(properties).toIntExact(TimeUnit.MILLISECONDS); }
RaftServerImpl(RaftGroup group, StateMachine stateMachine, RaftServerProxy proxy) throws IOException { final RaftPeerId id = proxy.getId(); LOG.debug("{}: new RaftServerImpl for {}", id, group); this.groupId = group.getGroupId(); this.lifeCycle = new LifeCycle(id); this.stateMachine = stateMachine; final RaftProperties properties = proxy.getProperties(); minTimeoutMs = RaftServerConfigKeys.Rpc.timeoutMin(properties).toInt(TimeUnit.MILLISECONDS); maxTimeoutMs = RaftServerConfigKeys.Rpc.timeoutMax(properties).toInt(TimeUnit.MILLISECONDS); Preconditions.assertTrue(maxTimeoutMs > minTimeoutMs, "max timeout: %s, min timeout: %s", maxTimeoutMs, minTimeoutMs); this.proxy = proxy; this.state = new ServerState(id, group, properties, this, stateMachine); this.retryCache = initRetryCache(properties); this.jmxAdapter = new RaftServerJmxAdapter(); }
RaftServerImpl(RaftGroup group, StateMachine stateMachine, RaftServerProxy proxy) throws IOException { final RaftPeerId id = proxy.getId(); LOG.info("{}: new RaftServerImpl for {} with {}", id, group, stateMachine); this.groupId = group.getGroupId(); this.lifeCycle = new LifeCycle(id); this.stateMachine = stateMachine; this.role = new RoleInfo(id); final RaftProperties properties = proxy.getProperties(); minTimeoutMs = RaftServerConfigKeys.Rpc.timeoutMin(properties).toIntExact(TimeUnit.MILLISECONDS); maxTimeoutMs = RaftServerConfigKeys.Rpc.timeoutMax(properties).toIntExact(TimeUnit.MILLISECONDS); rpcSlownessTimeoutMs = RaftServerConfigKeys.Rpc.slownessTimeout(properties).toIntExact(TimeUnit.MILLISECONDS); Preconditions.assertTrue(maxTimeoutMs > minTimeoutMs, "max timeout: %s, min timeout: %s", maxTimeoutMs, minTimeoutMs); this.proxy = proxy; this.state = new ServerState(id, group, properties, this, stateMachine); this.retryCache = initRetryCache(properties); this.jmxAdapter = new RaftServerJmxAdapter(); }
public TimeDuration getTimeoutMax() { return RaftServerConfigKeys.Rpc.timeoutMax(properties); }
public int getMaxTimeout() { return RaftServerConfigKeys.Rpc.timeoutMax(properties).toInt(TimeUnit.MILLISECONDS); }