sanpwc commented on code in PR #4090:
URL: https://github.com/apache/ignite-3/pull/4090#discussion_r1705473067
##########
modules/table/src/testFixtures/java/org/apache/ignite/distributed/ItTxTestCluster.java:
##########
@@ -673,112 +696,72 @@ public TableViewInternal startTable(String tableName,
SchemaDescriptor schemaDes
mock(IndexMetaStorage.class)
);
- CompletableFuture<Void> partitionReadyFuture =
raftServers.get(assignment).startRaftGroupNode(
- new RaftNodeId(grpId, configuration.peer(assignment)),
- configuration,
- partitionListener,
- RaftGroupEventsListener.noopLsnr,
- topologyAwareRaftGroupServiceFactory
- ).thenAccept(
- raftSvc -> {
- PartitionReplicaListener listener =
newReplicaListener(
- mvPartStorage,
- raftSvc,
- txManagers.get(assignment),
- Runnable::run,
- partId,
- tableId,
- () -> Map.of(pkLocker.id(), pkLocker),
- pkStorage,
- Map::of,
- clockServices.get(assignment),
- safeTime,
- txStateStorage,
- transactionStateResolver,
- storageUpdateHandler,
- new
DummyValidationSchemasSource(schemaManager),
-
nodeResolver.getByConsistentId(assignment),
- new AlwaysSyncedSchemaSyncService(),
- catalogService,
- placementDriver,
- nodeResolver,
- cursorRegistries.get(assignment),
- schemaManager
- );
-
- replicaManagers.get(assignment).startReplica(
- new TablePartitionId(tableId, partId),
- storageIndexTracker,
- completedFuture(listener)
- );
- }
+ Function<RaftGroupService, ReplicaListener>
createReplicaListener = raftClient -> newReplicaListener(
+ mvPartStorage,
+ raftClient,
+ txManagers.get(assignment),
+ Runnable::run,
+ partId,
+ tableId,
+ () -> Map.of(pkLocker.id(), pkLocker),
+ pkStorage,
+ Map::of,
+ clockServices.get(assignment),
+ safeTime,
+ txStateStorage,
+ transactionStateResolver,
+ storageUpdateHandler,
+ new DummyValidationSchemasSource(schemaManager),
+ nodeResolver.getByConsistentId(assignment),
+ new AlwaysSyncedSchemaSyncService(),
+ catalogService,
+ placementDriver,
+ nodeResolver,
+ cursorRegistries.get(assignment),
+ schemaManager
);
+ CompletableFuture<Void> partitionReadyFuture =
replicaManagers.get(assignment)
+ .startReplica(
+ RaftGroupEventsListener.noopLsnr,
+ partitionListener,
+ false,
+ null,
+ createReplicaListener,
+ storageIndexTracker,
+ grpId,
+ configuration
+ )
+ .thenAccept(unused -> { });
Review Comment:
I'd rather make partitionReadyFutures `List<CompletableFuture<?>>`
--
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]