rpuch commented on code in PR #1912:
URL: https://github.com/apache/ignite-3/pull/1912#discussion_r1161476054
##########
modules/raft/src/main/java/org/apache/ignite/raft/jraft/core/NodeImpl.java:
##########
@@ -571,9 +570,32 @@ public NodeImpl(
this.confCtx = new ConfigurationCtx(this);
this.wakingCandidate = null;
this.applyCommittedFuture = new CompletableFuture<>();
- this.ownFsmCallerExecutorDisruptorConfig =
ownFsmCallerExecutorDisruptorConfig;
+ this.ownFsmCallerExecutorDisruptorConfig = null;
}
+ public NodeImpl(
Review Comment:
Same thing: let's reuse one constructor in the other. This seems to be
especially important in this class, as the constructor has some non-trivial
logic, not just assignments to fields, and it seems scary to duplicate this
logic.
##########
modules/raft/src/main/java/org/apache/ignite/raft/jraft/RaftGroupService.java:
##########
@@ -76,26 +76,51 @@ public class RaftGroupService {
* @param nodeOptions Node options.
* @param rpcServer RPC server.
* @param nodeManager Node manager.
- * @param ownFsmCallerExecutorDisruptorConfig Configuration own striped
disruptor for FSMCaller service of raft node, {@code null}
- * means use shared disruptor.
*/
public RaftGroupService(
final String groupId,
final PeerId serverId,
final NodeOptions nodeOptions,
final RpcServer rpcServer,
- final NodeManager nodeManager,
- @Nullable RaftNodeDisruptorConfiguration
ownFsmCallerExecutorDisruptorConfig
+ final NodeManager nodeManager
) {
super();
this.groupId = groupId;
this.serverId = serverId;
this.nodeOptions = nodeOptions;
this.rpcServer = rpcServer;
this.nodeManager = nodeManager;
- this.ownFsmCallerExecutorDisruptorConfig =
ownFsmCallerExecutorDisruptorConfig;
+ this.ownFsmCallerExecutorDisruptorConfig = null;
}
+ /**
+ * @param groupId Group Id.
+ * @param serverId Server id.
+ * @param nodeOptions Node options.
+ * @param rpcServer RPC server.
+ * @param nodeManager Node manager.
+ * @param ownFsmCallerExecutorDisruptorConfig Configuration own
striped disruptor for FSMCaller service of raft node.
+ */
+ public RaftGroupService(
+ final String groupId,
+ final PeerId serverId,
+ final NodeOptions nodeOptions,
+ final RpcServer rpcServer,
+ final NodeManager nodeManager,
+ final RaftNodeDisruptorConfiguration
ownFsmCallerExecutorDisruptorConfig
+ ) {
+ super();
Review Comment:
Sorry, I did not express this clearly: the idea was to reuse one constructor
inside another. Looks like the only thing that prevents this is the `assert`,
but it doesn't seem to be too important. By removing it, we can remove the
duplication. WDYT?
--
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]