Return the fitted chunksize for expected_mb.
(expected_mb: int)
| 75 | |
| 76 | |
| 77 | def csformula(expected_mb: int) -> int: |
| 78 | """Return the fitted chunksize for expected_mb.""" |
| 79 | # For a basesize of 8 KB, this will return: |
| 80 | # 8 KB for datasets <= 1 MB |
| 81 | # 1 MB for datasets >= 10 TB |
| 82 | basesize = 8 * 1024 # 8 KB is a good minimum |
| 83 | return basesize * int(2 ** math.log10(expected_mb)) |
| 84 | |
| 85 | |
| 86 | def limit_es(expected_mb: int) -> int: |