Class ResourceDiscoveryScriptPlugin
- All Implemented Interfaces:
- ResourceDiscoveryPlugin,- org.apache.spark.internal.Logging
- Since:
- 3.0.0
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.apache.spark.internal.Loggingorg.apache.spark.internal.Logging.LogStringContext, org.apache.spark.internal.Logging.SparkShellLoggingFilter
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptiondiscoverResource(ResourceRequest request, SparkConf sparkConf) Discover the addresses of the requested resource.Methods inherited from class java.lang.Objectequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.spark.internal.LogginginitializeForcefully, initializeLogIfNecessary, initializeLogIfNecessary, initializeLogIfNecessary$default$2, isTraceEnabled, log, logBasedOnLevel, logDebug, logDebug, logDebug, logDebug, logError, logError, logError, logError, logInfo, logInfo, logInfo, logInfo, logName, LogStringContext, logTrace, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, logWarning, MDC, org$apache$spark$internal$Logging$$log_, org$apache$spark$internal$Logging$$log__$eq, withLogContext
- 
Constructor Details- 
ResourceDiscoveryScriptPluginpublic ResourceDiscoveryScriptPlugin()
 
- 
- 
Method Details- 
discoverResourceDescription copied from interface:ResourceDiscoveryPluginDiscover the addresses of the requested resource.This method is called early in the initialization of the Spark Executor/Driver/Worker. This function is responsible for discovering the addresses of the resource which Spark will then use for scheduling and eventually providing to the user. Depending on the deployment mode and and configuration of custom resources, this could be called by the Spark Driver, the Spark Executors, in standalone mode the Workers, or all of them. The ResourceRequest has a ResourceID component that can be used to distinguish which component it is called from and what resource its being called for. This will get called once for each resource type requested and its the responsibility of this function to return enough addresses of that resource based on the request. If the addresses do not meet the requested amount, Spark will fail. If this plugin doesn't handle a particular resource, it should return an empty Optional and Spark will try other plugins and then last fall back to the default discovery script plugin. - Specified by:
- discoverResourcein interface- ResourceDiscoveryPlugin
- Parameters:
- request- The ResourceRequest that to be discovered.
- sparkConf- SparkConf
- Returns:
- An Optionalcontaining aResourceInformationobject containing the resource name and the addresses of the resource. If it returnsOptional.EMPTYother plugins will be called.
 
 
-