Skip to content

Commit 6c6a260

Browse files
committed
[SPARK-49832] Make o.a.s.k8s.operator.utils.Utils argument naming consistent
### Why are the changes needed? This PR aims to make `o.a.s.k8s.operator.utils.Utils` argument naming consistent. ### Does this PR introduce _any_ user-facing change? `Utils` has a mixed style for `SparkApplication` and `SparkCluster` argument. We had better be consistent. - `SparkApplication` argument: https://github.com/apache/spark-kubernetes-operator/blob/cdad512990f25dcd1a289627c70e541df5960f62/spark-operator/src/main/java/org/apache/spark/k8s/operator/utils/Utils.java#L89 https://github.com/apache/spark-kubernetes-operator/blob/cdad512990f25dcd1a289627c70e541df5960f62/spark-operator/src/main/java/org/apache/spark/k8s/operator/utils/Utils.java#L99 - `SparkCluster ` argument: https://github.com/apache/spark-kubernetes-operator/blob/cdad512990f25dcd1a289627c70e541df5960f62/spark-operator/src/main/java/org/apache/spark/k8s/operator/utils/Utils.java#L111 https://github.com/apache/spark-kubernetes-operator/blob/cdad512990f25dcd1a289627c70e541df5960f62/spark-operator/src/main/java/org/apache/spark/k8s/operator/utils/Utils.java#L117 ### How was this patch tested? Pass the CIs. ### Was this patch authored or co-authored using generative AI tooling? No. Closes apache#141 from dongjoon-hyun/SPARK-49832. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
1 parent 5a90eed commit 6c6a260

File tree

1 file changed

+8
-8
lines changed
  • spark-operator/src/main/java/org/apache/spark/k8s/operator/utils

1 file changed

+8
-8
lines changed

spark-operator/src/main/java/org/apache/spark/k8s/operator/utils/Utils.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,26 +96,26 @@ public static Map<String, String> sparkAppResourceLabels(final String appName) {
9696
return labels;
9797
}
9898

99-
public static Map<String, String> driverLabels(final SparkApplication sparkApplication) {
100-
Map<String, String> labels = sparkAppResourceLabels(sparkApplication);
99+
public static Map<String, String> driverLabels(final SparkApplication app) {
100+
Map<String, String> labels = sparkAppResourceLabels(app);
101101
labels.put(Constants.LABEL_SPARK_ROLE_NAME, LABEL_SPARK_ROLE_DRIVER_VALUE);
102102
return labels;
103103
}
104104

105-
public static Map<String, String> executorLabels(final SparkApplication sparkApplication) {
106-
Map<String, String> labels = sparkAppResourceLabels(sparkApplication);
105+
public static Map<String, String> executorLabels(final SparkApplication app) {
106+
Map<String, String> labels = sparkAppResourceLabels(app);
107107
labels.put(Constants.LABEL_SPARK_ROLE_NAME, LABEL_SPARK_ROLE_EXECUTOR_VALUE);
108108
return labels;
109109
}
110110

111-
public static Map<String, String> sparkClusterResourceLabels(final SparkCluster master) {
111+
public static Map<String, String> sparkClusterResourceLabels(final SparkCluster cluster) {
112112
Map<String, String> labels = commonManagedResourceLabels();
113-
labels.put(Constants.LABEL_SPARK_CLUSTER_NAME, master.getMetadata().getName());
113+
labels.put(Constants.LABEL_SPARK_CLUSTER_NAME, cluster.getMetadata().getName());
114114
return labels;
115115
}
116116

117-
public static Map<String, String> clusterLabels(final SparkCluster sparkCluster) {
118-
Map<String, String> labels = sparkClusterResourceLabels(sparkCluster);
117+
public static Map<String, String> clusterLabels(final SparkCluster cluster) {
118+
Map<String, String> labels = sparkClusterResourceLabels(cluster);
119119
labels.put(Constants.LABEL_SPARK_ROLE_NAME, LABEL_SPARK_ROLE_CLUSTER_VALUE);
120120
return labels;
121121
}

0 commit comments

Comments
 (0)