morningman commented on code in PR #16574:
URL: https://github.com/apache/doris/pull/16574#discussion_r1102669638
##########
fe/fe-core/src/main/java/org/apache/doris/qe/Coordinator.java:
##########
@@ -1768,12 +1797,56 @@ public TScanRangeLocation
selectBackendsByRoundRobin(List<TScanRangeLocation> lo
return location;
}
+ private void computeScanRangeAssignmentByConsistentHash(
+ ScanNode scanNode,
+ final List<TScanRangeLocations> locations,
+ FragmentScanRangeAssignment assignment,
+ Map<TNetworkAddress, Long> assignedBytesPerHost,
+ Map<TNetworkAddress, Long> replicaNumPerHost) throws Exception {
+ Collection<Backend> aliveBEs =
idToBackend.values().stream().filter(SimpleScheduler::isAvailable)
+ .collect(Collectors.toList());
+ if (aliveBEs.isEmpty()) {
+ throw new UserException("No available backends");
+ }
+ int virtualNumber = Math.max(Math.min(512 / aliveBEs.size(), 32), 2);
+ ConsistentHash<TScanRangeLocations, Backend> consistentHash = new
ConsistentHash<>(
Review Comment:
TODO: I think we can move this ConsistentHash to `SystemInfoService`.
No need to create one for every query
--
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]