trait PluginContext extends AnyRef
:: DeveloperApi :: Context information and operations for plugins loaded by Spark.
An instance of this class is provided to plugins in their initialization method. It is safe for plugins to keep a reference to the instance for later use (for example, to send messages to the plugin's driver component).
Context instances are plugin-specific, so metrics and messages are tied each plugin. It is not possible for a plugin to directly interact with other plugins.
- Annotations
- @DeveloperApi()
- Source
- PluginContext.java
- Since
3.0.0
- Alphabetic
- By Inheritance
- PluginContext
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def ask(message: AnyRef): AnyRef
Send an RPC to the plugin's driver-side component.
Send an RPC to the plugin's driver-side component.
This method sends a message to the driver-side component of the plugin, and blocks until a reply arrives, or the configured RPC ask timeout (
spark.rpc.askTimeout
) elapses.If the driver replies with an error, an exception with the corresponding error will be thrown.
The message must be serializable.
- message
Message to be sent.
- returns
The reply from the driver-side component.
- abstract def conf(): SparkConf
Configuration of the Spark application.
- abstract def executorID(): String
Executor ID of the process.
Executor ID of the process. On the driver, this will identify the driver.
- abstract def hostname(): String
The host name which is being used by the Spark process for communication.
- abstract def metricRegistry(): MetricRegistry
Registry where to register metrics published by the plugin associated with this context.
- abstract def resources(): Map[String, ResourceInformation]
The custom resources (GPUs, FPGAs, etc) allocated to driver or executor.
- abstract def send(message: AnyRef): Unit
Send a message to the plugin's driver-side component.
Send a message to the plugin's driver-side component.
This method sends a message to the driver-side component of the plugin, without expecting a reply. It returns as soon as the message is enqueued for sending.
The message must be serializable.
- message
Message to be sent.
Concrete 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
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- 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()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)