Packages

c

org.apache.spark.resource

ResourceDiscoveryScriptPlugin

class ResourceDiscoveryScriptPlugin extends ResourceDiscoveryPlugin with Logging

Developer API

The default plugin that is loaded into a Spark application to control how custom resources are discovered. This executes the discovery script specified by the user and gets the json output back and constructs ResourceInformation objects from that. If the user specifies custom plugins, this is the last one to be executed and throws if the resource isn't discovered.

Annotations
@DeveloperApi()
Source
ResourceDiscoveryScriptPlugin.scala
Since

3.0.0

Linear Supertypes
Logging, ResourceDiscoveryPlugin, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ResourceDiscoveryScriptPlugin
  2. Logging
  3. ResourceDiscoveryPlugin
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new ResourceDiscoveryScriptPlugin()

Type Members

  1. implicit class LogStringContext extends AnyRef
    Definition Classes
    Logging

Value Members

  1. def discoverResource(request: ResourceRequest, sparkConf: SparkConf): Optional[ResourceInformation]

    Discover the addresses of the requested resource.

    Discover 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.

    request

    The ResourceRequest that to be discovered.

    sparkConf

    SparkConf

    returns

    An Optional containing a ResourceInformation object containing the resource name and the addresses of the resource. If it returns Optional#EMPTY other plugins will be called.

    Definition Classes
    ResourceDiscoveryScriptPluginResourceDiscoveryPlugin