codings-dan commented on a change in pull request #614:
URL: https://github.com/apache/ratis/pull/614#discussion_r817629557
##########
File path:
ratis-server/src/main/java/org/apache/ratis/server/impl/RaftConfigurationImpl.java
##########
@@ -288,6 +284,11 @@ public long getLogEntryIndex() {
return peers.stream().filter(p ->
!containsInConf(p.getId())).collect(Collectors.toList());
}
+ /** @return the peers which are not contained in conf. */
+ Collection<RaftPeer> filterListenerNotContainedInConf(List<RaftPeer>
listeners) {
+ return listeners.stream().filter(p ->
!containsListenerInConf(p.getId())).collect(Collectors.toList());
+ }
+
Review comment:
will do
##########
File path:
ratis-server/src/main/java/org/apache/ratis/server/impl/ServerImplUtils.java
##########
@@ -70,11 +70,15 @@ private static RaftServerProxy newRaftServer(
return proxy;
}
- public static RaftConfiguration newRaftConfiguration(List<RaftPeer> conf,
long index, List<RaftPeer> oldConf) {
+ public static RaftConfiguration newRaftConfiguration(List<RaftPeer> conf,
List<RaftPeer> listener,
+ long index, List<RaftPeer> oldConf, List<RaftPeer> oldListener) {
final RaftConfigurationImpl.Builder b = RaftConfigurationImpl.newBuilder()
- .setConf(conf)
+ .setConf(conf, listener)
.setLogEntryIndex(index);
- Optional.ofNullable(oldConf).filter(p -> p.size() >
0).ifPresent(b::setOldConf);
+ if (Optional.ofNullable(oldListener).filter(p -> p.size() > 0).isPresent()
+ || Optional.ofNullable(oldConf).filter(p -> p.size() > 0).isPresent())
{
+ b.setOldConf(oldConf, oldListener);
+ }
Review comment:
done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]