sashapolo commented on code in PR #1397:
URL: https://github.com/apache/ignite-3/pull/1397#discussion_r1046022516
##########
modules/raft/src/main/java/org/apache/ignite/internal/raft/Loza.java:
##########
@@ -171,62 +168,41 @@ public void stop() throws Exception {
@Override
public CompletableFuture<RaftGroupService> prepareRaftGroup(
ReplicationGroupId groupId,
- Collection<String> nodeConsistentIds,
+ @Nullable Peer serverPeer,
+ PeersAndLearners configuration,
Supplier<RaftGroupListener> lsnrSupplier
) throws NodeStoppingException {
- return prepareRaftGroup(groupId, nodeConsistentIds, lsnrSupplier,
RaftGroupOptions.defaults());
+ return prepareRaftGroup(groupId, serverPeer, configuration,
lsnrSupplier, () -> noopLsnr, RaftGroupOptions.defaults());
}
@Override
public CompletableFuture<RaftGroupService> prepareRaftGroup(
ReplicationGroupId groupId,
- Collection<String> nodeConsistentIds,
- Collection<String> learnerConsistentIds,
+ @Nullable Peer serverPeer,
+ PeersAndLearners configuration,
Supplier<RaftGroupListener> lsnrSupplier,
Supplier<RaftGroupEventsListener> raftGrpEvtsLsnrSupplier
) throws NodeStoppingException {
- return prepareRaftGroup(
- groupId, nodeConsistentIds, learnerConsistentIds,
lsnrSupplier, raftGrpEvtsLsnrSupplier, RaftGroupOptions.defaults()
- );
- }
-
- /**
- * Creates a raft group service providing operations on a raft group. If
{@code nodes} contains the current node, then raft group starts
- * on the current node.
- *
- * @param groupId Raft group id.
- * @param peerConsistentIds Consistent IDs of Raft peers.
- * @param lsnrSupplier Raft group listener supplier.
- * @param groupOptions Options to apply to the group.
- * @return Future representing pending completion of the operation.
- * @throws NodeStoppingException If node stopping intention was detected.
- */
- public CompletableFuture<RaftGroupService> prepareRaftGroup(
- ReplicationGroupId groupId,
- Collection<String> peerConsistentIds,
- Supplier<RaftGroupListener> lsnrSupplier,
- RaftGroupOptions groupOptions
- ) throws NodeStoppingException {
- return prepareRaftGroup(groupId, peerConsistentIds, List.of(),
lsnrSupplier, () -> noopLsnr, groupOptions);
+ return prepareRaftGroup(groupId, serverPeer, configuration,
lsnrSupplier, raftGrpEvtsLsnrSupplier, RaftGroupOptions.defaults());
}
/**
- * Creates a raft group service providing operations on a raft group. If
{@code peerConsistentIds} or {@code learnerConsistentIds}
- * contains the current node, then raft group starts on the current node.
+ * Optionally starts a Raft node and creates a Raft group service
providing operations on a Raft group.
*
- * @param groupId Raft group id.
- * @param peerConsistentIds Consistent IDs of Raft peers.
- * @param learnerConsistentIds Consistent IDs of Raft learners.
+ * @param groupId Raft group ID.
+ * @param serverPeer Local peer that will host the Raft node. If {@code
null} - no nodes will be started, but only the Raft client
+ * service.
+ * @param configuration Peers and Learners of the Raft group.
* @param lsnrSupplier Raft group listener supplier.
* @param raftGrpEvtsLsnrSupplier Raft group events listener supplier.
* @param groupOptions Options to apply to the group.
* @return Future representing pending completion of the operation.
* @throws NodeStoppingException If node stopping intention was detected.
*/
- public CompletableFuture<RaftGroupService> prepareRaftGroup(
+ private CompletableFuture<RaftGroupService> prepareRaftGroup(
ReplicationGroupId groupId,
- Collection<String> peerConsistentIds,
- Collection<String> learnerConsistentIds,
+ @Nullable Peer serverPeer,
+ PeersAndLearners configuration,
Supplier<RaftGroupListener> lsnrSupplier,
Supplier<RaftGroupEventsListener> raftGrpEvtsLsnrSupplier,
Review Comment:
I've created a ticket: https://issues.apache.org/jira/browse/IGNITE-18374
--
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]