@Override public ProxyProtocol newProtocol() { return MultiRaftProtocol.builder(name) .withRecoveryStrategy(Recovery.RECOVER) .withMaxRetries(5) .build(); }
/** * Sets the operation retry delay. * * @param retryDelayMillis the delay between operation retries in milliseconds * @return the proxy builder */ public MultiRaftProtocolBuilder withRetryDelayMillis(long retryDelayMillis) { return withRetryDelay(Duration.ofMillis(retryDelayMillis)); }
/** * Returns a new multi-Raft protocol builder. * * @return a new multi-Raft protocol builder */ public static MultiRaftProtocolBuilder builder() { return new MultiRaftProtocolBuilder(new MultiRaftProtocolConfig()); }
/** * Returns a new multi-Raft protocol builder. * * @param group the partition group * @return the multi-Raft protocol builder */ public static MultiRaftProtocolBuilder builder(String group) { return new MultiRaftProtocolBuilder(new MultiRaftProtocolConfig().setGroup(group)); }
/** * Sets the operation retry delay. * * @param retryDelay the delay between operation retries * @param timeUnit the delay time unit * @return the proxy builder * @throws NullPointerException if the time unit is null */ public MultiRaftProtocolBuilder withRetryDelay(long retryDelay, TimeUnit timeUnit) { return withRetryDelay(Duration.ofMillis(timeUnit.toMillis(retryDelay))); }