Commit 95abf2f
committed
[SPARK-53010][MLLIB][YARN] Ban
### What changes were proposed in this pull request?
This PR aims to ban `com.google.common.base.Strings` in favor of Java's built-in method and `SparkStringUtils`.
### Why are the changes needed?
- `Strings.repeat`: Java 11+ supports **faster** `String.repeat` natively.
```scala
scala> spark.time("a".repeat(1_000_000_000).length)
Time taken: 83 ms
val res0: Int = 1000000000
scala> spark.time(com.google.common.base.Strings.repeat("a", 1_000_000_000).length)
Time taken: 397 ms
val res1: Int = 1000000000
```
- `Strings.isNullOrEmpty`: `SparkStringUtils` supports `isEmpty` already.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Pass the CIs.
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes #51713 from dongjoon-hyun/SPARK-53010.
Authored-by: Dongjoon Hyun <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>com.google.common.base.Strings
1 parent 783beb6 commit 95abf2f
File tree
4 files changed
+9
-5
lines changed- dev
- mllib/src/test/java/org/apache/spark/mllib/feature
- resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn
4 files changed
+9
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
| 188 | + | |
188 | 189 | | |
189 | 190 | | |
190 | 191 | | |
| |||
Lines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
25 | 23 | | |
26 | 24 | | |
27 | 25 | | |
| |||
35 | 33 | | |
36 | 34 | | |
37 | 35 | | |
38 | | - | |
| 36 | + | |
39 | 37 | | |
40 | 38 | | |
41 | 39 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
29 | 28 | | |
30 | 29 | | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
| 76 | + | |
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
511 | 511 | | |
512 | 512 | | |
513 | 513 | | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
514 | 519 | | |
0 commit comments