KubernetesVolumeUtils¶
KubernetesVolumeUtils utility is used to parseVolumesWithPrefix.
parseVolumesWithPrefix¶
parseVolumesWithPrefix(
sparkConf: SparkConf,
prefix: String): Seq[KubernetesVolumeSpec]
parseVolumesWithPrefix creates KubernetesVolumeSpecs based on the configuration properties (in the given SparkConf) with the prefix.
parseVolumesWithPrefix requests the SparkConf to get all properties with the given prefix.
parseVolumesWithPrefix extracts volume types and names (from the keys of the properties) and for every pair creates a KubernetesVolumeSpec with the following:
volumeNamemountPathbased on[volumeType].[volumeName].mount.pathkey (in the properties)mountSubPathbased on[volumeType].[volumeName].mount.subPathkey (in the properties) if available or defaults to an empty pathmountReadOnlybased on[volumeType].[volumeName].mount.readOnlykey (in the properties) if available orfalsevolumeConfwith a KubernetesVolumeSpecificConf based on the properties and thevolumeTypeandvolumeNameof the volume
parseVolumesWithPrefix is used when:
KubernetesDriverConfis requested for volumesKubernetesExecutorConfis requested for volumesKubernetesConfutility is used to create a KubernetesDriverConf
getVolumeTypesAndNames¶
getVolumeTypesAndNames(
properties: Map[String, String]): Set[(String, String)]
getVolumeTypesAndNames extracts volume types and names.
getVolumeTypesAndNames splits the keys (in the given properties key-value collection) by . to volume type and name pairs.
parseVolumeSpecificConf¶
parseVolumeSpecificConf(
options: Map[String, String],
volumeType: String,
volumeName: String): KubernetesVolumeSpecificConf
parseVolumeSpecificConf extracts volume configuration given the volume type and name.
parseVolumeSpecificConf creates a KubernetesVolumeSpecificConf based on the given volumeType.
parseVolumeSpecificConf throws an IllegalArgumentException for unsupported volumeType:
Kubernetes Volume type `[volumeType]` is not supported