sashapolo commented on code in PR #5134:
URL: https://github.com/apache/ignite-3/pull/5134#discussion_r1938943599


##########
modules/partition-replicator/src/main/java/org/apache/ignite/internal/partition/replicator/PartitionReplicaLifecycleManager.java:
##########
@@ -210,6 +212,8 @@ public class PartitionReplicaLifecycleManager extends
     /** Configuration of rebalance retries delay. */
     private final SystemDistributedConfigurationPropertyHolder<Integer> 
rebalanceRetryDelayConfiguration;
 
+    private final ConcurrentMap<ZonePartitionId, ZonePartitionRaftListener> 
zonePartitionRaftListeners = new ConcurrentHashMap<>();

Review Comment:
   I agree that this is somewhat of a encapsulation leek, but I think that code 
like this is even worse:
   
   ```
   var zonePartitionReplicaListener = (ZonePartitionReplicaListener) 
replicaFut.join().listener();
   
   zonePartitionReplicaListener.addTableReplicaListener(tablePartitionId, 
tablePartitionReplicaListenerFactory);
   ```
   
   In my case I would also have to add special methods to access these 
listeners. Moreover, the lifecycle of raft and replica listeners is closely 
related - they are always added and removed together, so I would even prefer to 
have both of them in this map, this will make much easier to manage them. 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]

Reply via email to