uds5501 commented on code in PR #18314:
URL: https://github.com/apache/druid/pull/18314#discussion_r2235903084


##########
server/src/main/java/org/apache/druid/client/BrokerServerView.java:
##########
@@ -76,6 +80,12 @@ public class BrokerServerView implements TimelineServerView
   private final CountDownLatch initialized = new CountDownLatch(1);
   private final FilteredServerInventoryView baseView;
   private final BrokerViewOfCoordinatorConfig brokerViewOfCoordinatorConfig;
+  private final ConcurrentHashMap<RowKey, Long> totalSegmentAddCount = new 
ConcurrentHashMap<>();
+  private final ConcurrentHashMap<RowKey, Long> totalSegmentRemoveCount = new 
ConcurrentHashMap<>();
+  @GuardedBy("totalSegmentAddCount")
+  private Map<RowKey, Long> previousSegmentAddCount = new HashMap<>();
+  @GuardedBy("totalSegmentRemoveCount")
+  private Map<RowKey, Long> previousSegmentRemoveCount = new HashMap<>();

Review Comment:
   For now I have pushed a non event version to verify embedded tests.
   I am thinking if a simple `private final ConcurrentHashMap<RowKey, 
List<DiscoveryEvent>> discoveryEvents` will suffice for now, where `RowKey` has 
dataSource and server name.
   
   The `DiscoveryEvent` could be a simple enum with `ADDED` / `REMOVED` values. 
This map will be flushed on each `getSegmentDiscoveryEvents()` fetch.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to