aglinxinyuan opened a new issue, #5655: URL: https://github.com/apache/texera/issues/5655
## Background `ConfigParserUtil` in `common/config` (`amber.util.ConfigParserUtil`) currently lacks a unit-spec. It is the size-string parser used by `StorageConfig` (and friends) to translate `"5MB"`-style human-readable size literals into byte counts for S3 multipart configuration. ## Behavior to pin | Surface | Contract | | --- | --- | | `"1KB"` | parses to `1024L` | | `"1MB"` | parses to `1024L * 1024` | | `"1GB"` | parses to `1024L * 1024 * 1024` | | `"100MB"` | multiplies by the unit multiplier (104857600L) | | `"5GB"` | preserves Long precision (large values do not overflow) | | Multi-digit value with each unit | parses correctly (regex captures the full numeric prefix) | | Malformed input (missing unit, e.g. `"100"`) | throws `IllegalArgumentException` with a diagnostic message | | Malformed input (unsupported unit, e.g. `"5TB"`) | throws `IllegalArgumentException` | | Empty string | throws `IllegalArgumentException` | | Lowercase units (e.g. `"5mb"`) | throws `IllegalArgumentException` (the regex is anchored to `[KMG]B`) | | Whitespace inside the string (e.g. `"5 MB"`) | throws `IllegalArgumentException` | | Leading zeros (e.g. `"0010KB"`) | parses to `10 * 1024L` (no octal interpretation) | ## Scope - New spec file: `ConfigParserUtilSpec.scala` (matches the `<srcClassName>Spec.scala` convention). - No production-code changes. -- 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]
