Skip to content
This repository was archived by the owner on Jan 9, 2020. It is now read-only.

Commit 765455d

Browse files
committed
third round of PR comments
1 parent 04aa26f commit 765455d

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/HadoopConfBootstrap.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ private[spark] trait HadoopConfBootstrap {
4242
private[spark] class HadoopConfBootstrapImpl(
4343
hadoopConfConfigMapName: String,
4444
hadoopConfigFiles: Seq[File],
45-
hadoopUGI: HadoopUGIUtil) extends HadoopConfBootstrap with Logging{
45+
hadoopUGI: HadoopUGIUtil) extends HadoopConfBootstrap with Logging {
4646

4747
override def bootstrapMainContainerAndVolumes(
4848
originalPodWithMainContainer: PodWithMainContainer)

resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/HadoopUGIUtil.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ private[spark] class HadoopUGIUtil{
7474
@deprecated("Moved to core in 2.3", "2.3")
7575
def deserialize(tokenBytes: Array[Byte]): Credentials = {
7676
val creds = new Credentials()
77-
creds.readTokenStorageStream(new DataInputStream(new ByteArrayInputStream(tokenBytes)))
77+
val dataStream = new DataInputStream(new ByteArrayInputStream(tokenBytes))
78+
creds.readTokenStorageStream(dataStream)
79+
dataStream.close()
7880
creds
7981
}
8082
}

resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/KerberosTokenConfBootstrap.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ private[spark] trait KerberosTokenConfBootstrap {
3737
private[spark] class KerberosTokenConfBootstrapImpl(
3838
secretName: String,
3939
secretItemKey: String,
40-
userName: String) extends KerberosTokenConfBootstrap with Logging{
40+
userName: String) extends KerberosTokenConfBootstrap with Logging {
4141

4242
override def bootstrapMainContainerAndVolumes(
4343
originalPodWithMainContainer: PodWithMainContainer)

resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/submit/submitsteps/HadoopConfigBootstrapStep.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ private[spark] class HadoopConfigBootstrapStep(
5353
.endMetadata()
5454
.addToData(currentHadoopSpec.configMapProperties.asJava)
5555
.build()
56-
val executorSparkConf = driverSpec.driverSparkConf.clone()
56+
val driverSparkConfWithExecutorSetup = driverSpec.driverSparkConf.clone()
5757
.set(HADOOP_CONFIG_MAP_SPARK_CONF_NAME, hadoopConfigMapName)
5858
.setAll(currentHadoopSpec.additionalDriverSparkConf)
5959
driverSpec.copy(
6060
driverPod = currentHadoopSpec.driverPod,
6161
driverContainer = currentHadoopSpec.driverContainer,
62-
driverSparkConf = executorSparkConf,
62+
driverSparkConf = driverSparkConfWithExecutorSetup,
6363
otherKubernetesResources =
6464
driverSpec.otherKubernetesResources ++
6565
Seq(configMap) ++ currentHadoopSpec.dtSecret.toSeq

0 commit comments

Comments
 (0)