Commit 9482906
committed
[SPARK-41385][K8S] Replace deprecated
### What changes were proposed in this pull request?
This PR aims to replace the deprecated `Class.newInstance` with `Class.getConstructor.newInstance`.
### Why are the changes needed?
SPARK-25984 removed these instances at Spark 3.0.0.
SPARK-37145 introduced newly two instances at Spark 3.3.0.
```
$ git grep classForName | grep newInstance | grep -v getConstructor
resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/submit/KubernetesDriverBuilder.scala: val feature = Utils.classForName[Any](className).newInstance()
resource-managers/kubernetes/core/src/main/scala/org/apache/spark/scheduler/cluster/k8s/KubernetesExecutorBuilder.scala: val feature = Utils.classForName[Any](className).newInstance()
```
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Pass the CIs.
Closes #38909 from dongjoon-hyun/SPARK-41385.
Authored-by: Dongjoon Hyun <dhyun@apple.com>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>.newInstance() in K8s module1 parent a383dde commit 9482906
2 files changed
Lines changed: 2 additions & 2 deletions
File tree
- resource-managers/kubernetes/core/src/main/scala/org/apache/spark
- deploy/k8s/submit
- scheduler/cluster/k8s
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
0 commit comments