You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
154688: mmaprototype: pass []roachpb.StoreID for computeMeansForStoreSet r=tbg a=wenyihu6
Epic: CRDB-55052
Release note: none
---
**mmaprototype: pass []roachpb.StoreID for computeMeansForStoreSet**
Previously, computeMeansForStoreSet took in a meansForStoreSet struct. Future
PRs will use this helper function to compute mean load summaries for stores
without having a storeIDPostingList handy. To avoid unnecessary construction of
a storeIDPostingList, the function signature now takes meansLoad and
[]roachpb.StoreID directly. This change lets future callers pass a simple slice
of stores. Since future callers may provide slices with duplicate store IDs, the
function now also de-duplicates them internally.
---
**mmaprototype: refactor computeMeansForStoreSet**
Previously, we updated computeMeansForStoreSet to take meansLoad and
[]roachpb.StoreID directly instead of a meansForStoreSet struct. This commit
updates the call sites that only require meansLoad to use it directly, removing
unnecessary use of meansForStoreSet.
---
**mmaprototype: pass in scratch stores for computeMeansForStoreSet**
Previously, computeMeansForStoreSet allocated a new map on every call to
deduplicate the provided stores list. This commit refactors it to reuse a
scratchStores map (similar to scratchNodes). The caller now allocates this map
once and stores it in the function scope or struct, reducing repeated
allocations.
---
**mmaprototype: return meansLoad directly for computeMeansForStoreSet**
Previously, computeMeansForStoreSet received *meansForStoreSet, which contained
information like stores needed to compute the mean. A recent commit changed it
to take *meansLoad, and computeMeansForStoreSet doesn’t actually use any fields
as provided information. This commit updates computeMeansForStoreSet to directly
construct and return a meanLoad instead.
Co-authored-by: wenyihu6 <[email protected]>
0 commit comments