object KubernetesUtils extends Logging
:: DeveloperApi ::
A utility class used for K8s operations internally and for implementing ExternalClusterManagers.
- Annotations
- @Unstable() @DeveloperApi()
- Alphabetic
- By Inheritance
- KubernetesUtils
- Logging
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def addOwnerReference(pod: Pod, resources: Seq[HasMetadata]): Unit
- Annotations
- @Since("3.1.1")
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def buildPodWithServiceAccount(serviceAccount: Option[String], pod: SparkPod): Option[Pod]
- Annotations
- @Since("3.0.0")
- def buildResourcesQuantities(componentName: String, sparkConf: SparkConf): Map[String, Quantity]
This function builds the Quantity objects for each resource in the Spark resource configs based on the component name(spark.driver.resource or spark.executor.resource).
This function builds the Quantity objects for each resource in the Spark resource configs based on the component name(spark.driver.resource or spark.executor.resource). It assumes we can use the Kubernetes device plugin format: vendor-domain/resource. It returns a set with a tuple of vendor-domain/resource and Quantity for each resource.
- Annotations
- @Since("3.0.0")
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def containerStatusDescription(containerStatus: ContainerStatus): Seq[(String, String)]
- Annotations
- @Since("3.0.0")
- def containersDescription(p: Pod, indent: Int = 1): String
- Annotations
- @Since("3.0.0")
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def formatPairsBundle(pairs: Seq[(String, String)], indent: Int = 1): String
- Annotations
- @Since("3.0.0")
- def formatPodState(pod: Pod): String
Given a pod, output a human readable representation of its state
Given a pod, output a human readable representation of its state
- pod
Pod
- returns
Human readable pod state
- Annotations
- @Since("3.0.0")
- def formatTime(time: String): String
- Annotations
- @Since("3.0.0")
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def initializeLogIfNecessary(isInterpreter: Boolean, silent: Boolean): Boolean
- Attributes
- protected
- Definition Classes
- Logging
- def initializeLogIfNecessary(isInterpreter: Boolean): Unit
- Attributes
- protected
- Definition Classes
- Logging
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isLocalAndResolvable(resource: String): Boolean
- Annotations
- @Since("3.0.0")
- def isTraceEnabled(): Boolean
- Attributes
- protected
- Definition Classes
- Logging
- def loadPodFromTemplate(kubernetesClient: KubernetesClient, templateFileName: String, containerName: Option[String], conf: SparkConf): SparkPod
- Annotations
- @Since("3.2.0")
- def log: Logger
- Attributes
- protected
- Definition Classes
- Logging
- def logDebug(msg: => String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logDebug(msg: => String): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logError(msg: => String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logError(msg: => String): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logInfo(msg: => String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logInfo(msg: => String): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logName: String
- Attributes
- protected
- Definition Classes
- Logging
- def logTrace(msg: => String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logTrace(msg: => String): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logWarning(msg: => String, throwable: Throwable): Unit
- Attributes
- protected
- Definition Classes
- Logging
- def logWarning(msg: => String): Unit
- Attributes
- protected
- Definition Classes
- Logging
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def parseMasterUrl(url: String): String
- Annotations
- @Since("2.4.0")
- def parsePrefixedKeyValuePairs(sparkConf: SparkConf, prefix: String): Map[String, String]
Extract and parse Spark configuration properties with a given name prefix and return the result as a Map.
Extract and parse Spark configuration properties with a given name prefix and return the result as a Map. Keys must not have more than one value.
- sparkConf
Spark configuration
- prefix
the given property name prefix
- returns
a Map storing the configuration property keys and values
- Annotations
- @Since("2.3.0")
- def renameMainAppResource(resource: String, conf: Option[SparkConf] = None, shouldUploadLocal: Boolean): String
- Annotations
- @Since("3.1.1")
- def requireBothOrNeitherDefined(opt1: Option[_], opt2: Option[_], errMessageWhenFirstIsMissing: String, errMessageWhenSecondIsMissing: String): Unit
- Annotations
- @Since("3.0.0")
- def requireNandDefined(opt1: Option[_], opt2: Option[_], errMessage: String): Unit
- Annotations
- @Since("2.3.0")
- def requireSecondIfFirstIsDefined(opt1: Option[_], opt2: Option[_], errMessageWhenSecondIsMissing: String): Unit
- Annotations
- @Since("3.0.0")
- def selectSparkContainer(pod: Pod, containerName: Option[String]): SparkPod
- Annotations
- @Since("3.0.0")
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def uniqueID(clock: Clock = systemClock): String
Generates a unique ID to be used as part of identifiers.
Generates a unique ID to be used as part of identifiers. The returned ID is a hex string of a 64-bit value containing the 40 LSBs from the current time + 24 random bits from a cryptographically strong RNG. (40 bits gives about 30 years worth of "unique" timestamps.)
This avoids using a UUID for uniqueness (too long), and relying solely on the current time (not unique enough).
- Annotations
- @Since("3.0.0")
- def uploadAndTransformFileUris(fileUris: Iterable[String], conf: Option[SparkConf] = None): Iterable[String]
Upload files and modify their uris
Upload files and modify their uris
- Annotations
- @Since("3.0.0")
- def uploadFileUri(uri: String, conf: Option[SparkConf] = None): String
- Annotations
- @Since("3.0.0")
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()