snleee commented on a change in pull request #5782:
URL: https://github.com/apache/incubator-pinot/pull/5782#discussion_r465576350
##########
File path:
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/PinotHelixResourceManager.java
##########
@@ -2366,6 +2404,23 @@ public void endReplaceSegments(String tableNameWithType,
String segmentLineageEn
tableNameWithType, segmentLineageEntryId);
}
+ private Set<String> getOnlineSegmentsFromExternalView(String
tableNameWithType) {
+ ExternalView externalView = getTableExternalView(tableNameWithType);
+ if (externalView != null) {
+ Set<String> partitionSet = externalView.getPartitionSet();
+ Set<String> onlineSegments = new
HashSet<>(HashUtil.getHashMapCapacity(partitionSet.size()));
+ for (String partition : partitionSet) {
+ Map<String, String> instanceStateMap =
externalView.getStateMap(partition);
+ if (instanceStateMap.containsValue(SegmentStateModel.ONLINE) ||
instanceStateMap
+ .containsValue(SegmentStateModel.CONSUMING)) {
+ onlineSegments.add(partition);
+ }
+ }
+ return onlineSegments;
Review comment:
fixed
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]