public class PluginContextImpl extends Object implements PluginContext, Logging
| Modifier and Type | Class and Description |
|---|---|
class |
PluginContextImpl.PluginMetricsSource |
| Constructor and Description |
|---|
PluginContextImpl(String pluginName,
org.apache.spark.rpc.RpcEnv rpcEnv,
org.apache.spark.metrics.MetricsSystem metricsSystem,
SparkConf conf,
String executorID) |
| Modifier and Type | Method and Description |
|---|---|
Object |
ask(Object message)
Send an RPC to the plugin's driver-side component.
|
SparkConf |
conf()
Configuration of the Spark application.
|
String |
executorID()
Executor ID of the process.
|
String |
hostname()
The host name which is being used by the Spark process for communication.
|
com.codahale.metrics.MetricRegistry |
metricRegistry()
Registry where to register metrics published by the plugin associated with this context.
|
void |
registerMetrics() |
void |
send(Object message)
Send a message to the plugin's driver-side component.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinitializeForcefully, initializeLogging, initializeLogIfNecessary, initializeLogIfNecessary, isTraceEnabled, log, logDebug, logDebug, logError, logError, logInfo, logInfo, logName, logTrace, logTrace, logWarning, logWarningpublic PluginContextImpl(String pluginName,
org.apache.spark.rpc.RpcEnv rpcEnv,
org.apache.spark.metrics.MetricsSystem metricsSystem,
SparkConf conf,
String executorID)
public Object ask(Object message)
PluginContext
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.
ask in interface PluginContextmessage - Message to be sent.public SparkConf conf()
PluginContextconf in interface PluginContextpublic String executorID()
PluginContextexecutorID in interface PluginContextpublic String hostname()
PluginContexthostname in interface PluginContextpublic com.codahale.metrics.MetricRegistry metricRegistry()
PluginContextmetricRegistry in interface PluginContextpublic void registerMetrics()
public void send(Object message)
PluginContextThis 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.
send in interface PluginContextmessage - Message to be sent.