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, wait
initializeForcefully, initializeLogging, initializeLogIfNecessary, initializeLogIfNecessary, isTraceEnabled, log, logDebug, logDebug, logError, logError, logInfo, logInfo, logName, logTrace, logTrace, logWarning, logWarning
public 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 PluginContext
message
- Message to be sent.public SparkConf conf()
PluginContext
conf
in interface PluginContext
public String executorID()
PluginContext
executorID
in interface PluginContext
public String hostname()
PluginContext
hostname
in interface PluginContext
public com.codahale.metrics.MetricRegistry metricRegistry()
PluginContext
metricRegistry
in interface PluginContext
public void registerMetrics()
public void send(Object message)
PluginContext
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.
send
in interface PluginContext
message
- Message to be sent.