does the cluster sort here actually reorder anything? its compare never says one cluster comes first, so the order looks random and which cluster gets split depends on that
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
研究方向
找出 pull request 14000 討論中展示的 sortByClusterSize 方法,並追蹤其回傳的 map 在哪裡決定要拆分哪個叢集。檢查比較器如何處理叢集大小,以及最終順序是否具決定性;當順序反映預期的叢集優先級,且受影響的行為受到測試涵蓋時,即為完成。
由索引模型根據 Issue 內容生成。
描述
does the cluster sort here actually reorder anything? its compare never says one cluster comes first, so the order looks random and which cluster gets split depends on that
Originally posted by @Damans227 in https://github.com/apache/cloudstack/pull/14000#discussion_r4184044883
public static LinkedHashMap<Long, List<HostVO>> sortByClusterSize(final Map<Long, List<HostVO>> hostToClusterMap) {
List<Long> keys = new ArrayList<Long>();
keys.addAll(hostToClusterMap.keySet());
Collections.sort(keys, new Comparator<Long>() {
@Override
public int compare(Long o1, Long o2) {
List<HostVO> v1 = hostToClusterMap.get(o1);
List<HostVO> v2 = hostToClusterMap.get(o2);
if (v1 == null) {
return (v2 == null) ? 0 : 1;
}
if (v1.size() < v2.size()) {
return 1;
} else {
return 0;
}
}
});
LinkedHashMap<Long, List<HostVO>> sortedMap = new LinkedHashMap<Long, List<HostVO>>();
for (Long key : keys) {
sortedMap.put(key, hostToClusterMap.get(key));
}
return sortedMap;
}
- 主要語言
- Java
- 星號
- 3.1k
- 分支
- 1.4k
- 平均合併
- 6 天 20 小時
- 30 天內合併 PR
- 17
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
apache/cloudstack 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 72/100
apache/cloudstack#14645 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
apache/cloudstack#14633 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
apache/cloudstack#14631 ·
維護者通常 1 天內回覆
-
Remote access VPN users are disconnected on every LB, ACL, port forward or firewall change (xl2tpd restarted on every iptables pass)可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉
難度 2/5 1-3 小時 新手友好度 72/100
apache/cloudstack#14545 · 1 則留言 ·
維護者通常 1 天內回覆
-
[Hardening] F-21: Base64-Encoded User Data Containing Plain Text Passwords in DB.可能已有人在做 @DaanHoogland 於 4 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 72/100
apache/cloudstack#14530 · 5 則留言 ·
維護者通常 1 天內回覆
查看 apache/cloudstack 的全部 Issue
相似的 Issue
-
type: dependency-upgrade
難度 2/5 1-3 小時 新手友好度 61/100
spring-projects/spring-graphql#1556 ·
-
hermes-queue
難度 1/5 1 小時以內 新手友好度 91/100
chrisalunlloyd2-sudo/mindpalace#373 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 76/100
維護者通常 1 天內回覆
-
bug priority: lowest
難度 2/5 1-3 小時 新手友好度 62/100
SkriptLang/Skript#8953 · 1 則留言 ·
維護者通常 1 天內回覆
-
quality-assurance
難度 2/5 1-3 小時 新手友好度 62/100
Paul-Austin-Oswego-CSC480-HCI521/gift-app#228 ·
維護者通常 1 天內回覆