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

Basic Secure HDFS Support [514] #540

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ private[spark] trait HadoopConfBootstrap {
private[spark] class HadoopConfBootstrapImpl(
hadoopConfConfigMapName: String,
hadoopConfigFiles: Seq[File],
hadoopUGI: HadoopUGIUtil) extends HadoopConfBootstrap with Logging{
hadoopUGI: HadoopUGIUtil) extends HadoopConfBootstrap with Logging {

override def bootstrapMainContainerAndVolumes(
originalPodWithMainContainer: PodWithMainContainer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ private[spark] class HadoopUGIUtil{
@deprecated("Moved to core in 2.3", "2.3")
def deserialize(tokenBytes: Array[Byte]): Credentials = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here. Move to some other class?

val creds = new Credentials()
creds.readTokenStorageStream(new DataInputStream(new ByteArrayInputStream(tokenBytes)))
val dataStream = new DataInputStream(new ByteArrayInputStream(tokenBytes))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use Utils.tryWithResource.

creds.readTokenStorageStream(dataStream)
dataStream.close()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wraps close in a finally block.

creds
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ private[spark] trait KerberosTokenConfBootstrap {
private[spark] class KerberosTokenConfBootstrapImpl(
secretName: String,
secretItemKey: String,
userName: String) extends KerberosTokenConfBootstrap with Logging{
userName: String) extends KerberosTokenConfBootstrap with Logging {

override def bootstrapMainContainerAndVolumes(
originalPodWithMainContainer: PodWithMainContainer)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation is off here, indent in one more along with the line below.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ private[spark] class HadoopConfigBootstrapStep(
.endMetadata()
.addToData(currentHadoopSpec.configMapProperties.asJava)
.build()
val executorSparkConf = driverSpec.driverSparkConf.clone()
val driverSparkConfWithExecutorSetup = driverSpec.driverSparkConf.clone()
.set(HADOOP_CONFIG_MAP_SPARK_CONF_NAME, hadoopConfigMapName)
.setAll(currentHadoopSpec.additionalDriverSparkConf)
driverSpec.copy(
driverPod = currentHadoopSpec.driverPod,
driverContainer = currentHadoopSpec.driverContainer,
driverSparkConf = executorSparkConf,
driverSparkConf = driverSparkConfWithExecutorSetup,
otherKubernetesResources =
driverSpec.otherKubernetesResources ++
Seq(configMap) ++ currentHadoopSpec.dtSecret.toSeq
Expand Down