klsince commented on code in PR #10118:
URL: https://github.com/apache/pinot/pull/10118#discussion_r1070161149
##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/relocation/SegmentRelocator.java:
##########
@@ -91,10 +97,66 @@ public SegmentRelocator(PinotHelixResourceManager
pinotHelixResourceManager,
Math.min(taskIntervalInMs,
config.getSegmentRelocatorExternalViewCheckIntervalInMs());
_externalViewStabilizationTimeoutInMs =
Math.min(taskIntervalInMs,
config.getSegmentRelocatorExternalViewStabilizationTimeoutInMs());
+ if (config.isSegmentRelocatorRebalanceTablesSequentially()) {
+ _waitingTables = ConcurrentHashMap.newKeySet();
+ _waitingQueue = new LinkedBlockingQueue<>();
+ _executorService.submit(() -> {
+ LOGGER.info("Rebalance tables sequentially");
+ while (!Thread.currentThread().isInterrupted()) {
+ rebalanceWaitingTable(this::rebalanceTable);
+ }
+ return null;
+ });
+ } else {
+ _waitingTables = null;
+ _waitingQueue = null;
+ }
}
@Override
protected void processTable(String tableNameWithType) {
+ if (_waitingTables == null) {
+ LOGGER.debug("Rebalance table: {} immediately", tableNameWithType);
+ _executorService.submit(() -> rebalanceTable(tableNameWithType));
+ return;
+ }
+ putTableToWait(tableNameWithType);
+ }
+
+ @VisibleForTesting
+ synchronized void putTableToWait(String tableNameWithType) {
Review Comment:
neat
--
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]