refactor: introduce variables

Plus a rename

Co-Authored-By: Lada Kesseler <23501754+lexler@users.noreply.github.com>
This commit is contained in:
Danny Faught 2024-09-27 11:29:54 -07:00
parent 9f5d99a77a
commit 8c592323f3
No known key found for this signature in database
GPG Key ID: 28A992107D6E8DF4
1 changed files with 4 additions and 5 deletions

View File

@ -3557,11 +3557,10 @@ public class StorageService extends NotificationBroadcasterSupport implements IE
{
int minSamplesPerSplit = 4;
int maxSplitCount = numberOfKeys / minSamplesPerSplit + 1;
int splitCount = Math.max(1,
Math.min(
maxSplitCount,
(int) (totalRowCountEstimate / keysPerSplit)));
return splitCount;
int calculatedSplitCount = (int) (totalRowCountEstimate / keysPerSplit);
int splitCountMaxOrLess = Math.min(maxSplitCount, calculatedSplitCount);
int splitCountOneOrHigher = Math.max(1, splitCountMaxOrLess);
return splitCountOneOrHigher;
}
private List<Pair<Range<Token>, Long>> getSplits(List<Token> tokens, int splitCount, ColumnFamilyStore cfs)