public class SparkEngine extends DDPEngine
NOTE: Only DDP pattern and I/O actors may be present in the workflow. Other actors must placed inside the composite pattern actors or in a different sub-workflow.
| Modifier and Type | Field and Description |
|---|---|
StringParameter |
driverMemory |
StringParameter |
masterHostAndPort |
Parameter |
numSameJVMWorkers |
static java.lang.String |
SPARK_ENGINE_NAME
The name of the spark engine.
|
_additionalJars, _classLoader, _configDirStr, _CONNECT_TIMEOUT, _container, _degreeOfParallelism, _director, _displayRedirectDir, _engineName, _jobArgumentsMap, _jobDir, _jobLock, _sameJVM, _serverStartStopLock, _subWorkflows, _writeSubWorkflowsToFiles| Constructor and Description |
|---|
SparkEngine(DDPDirector director) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
_addParameters()
Add parameters to the containing director.
|
protected void |
_addSubModelToContract(SingleInputPatternActor pactor,
Operator contract)
Write the sub-workflow of a SingleInputPatternActor either to a parameter
in the Spark job configuration or to a file.
|
protected boolean |
_checkFilesBeforeStartingServer()
Check the existence of the Spark assembly jar.
|
protected void |
_executeDDPJob()
Execute the DDP job.
|
protected SparkJob |
_getModelPlan()
Constructs a SparkJob from the model.
|
protected java.net.InetSocketAddress |
_parseOutputFromStartingServer(java.io.InputStream input)
Parse the output from the script that starts the server.
|
protected void |
_removeParameters()
Remove engine-specific parameters from the director.
|
void |
attributeChanged(Attribute attribute)
React to a parameter change.
|
java.lang.Object |
clone(Workspace workspace)
Clone the SparkEngine into the specified workspace.
|
void |
preinitialize()
Initialize fields from parameters.
|
static void |
shutdownServer() |
void |
stop()
Stop any running Spark jobs.
|
_checkConfigDir, _checkModel, _checkModelForNonDDPActors, _checkServer, _copyParameters, _createJobDirectory, _getJarList, _getParametersInHierarchy, _setPortTypes, clone, closeAllEffigies, createEffigy, fire, getDisplayRedirectDir, getModel, getName, getServerTypes, postfire, wrapuppublic StringParameter masterHostAndPort
public Parameter numSameJVMWorkers
public StringParameter driverMemory
public static final java.lang.String SPARK_ENGINE_NAME
public SparkEngine(DDPDirector director) throws IllegalActionException, NameDuplicationException
public void attributeChanged(Attribute attribute) throws IllegalActionException
attributeChanged in class DDPEngineIllegalActionExceptionpublic java.lang.Object clone(Workspace workspace) throws java.lang.CloneNotSupportedException
public void preinitialize() throws IllegalActionException
DDPEnginepreinitialize in class DDPEngineIllegalActionExceptionpublic static void shutdownServer() throws IllegalActionException
IllegalActionExceptionpublic void stop() throws IllegalActionException
stop in class DDPEngineIllegalActionExceptionprotected boolean _checkFilesBeforeStartingServer() throws IllegalActionException
_checkFilesBeforeStartingServer in class DDPEngineIllegalActionExceptionprotected void _executeDDPJob() throws IllegalActionException
DDPEngine_executeDDPJob in class DDPEngineIllegalActionExceptionprotected void _addParameters() throws IllegalActionException, NameDuplicationException
_addParameters in class DDPEngineIllegalActionExceptionNameDuplicationExceptionprotected void _removeParameters() throws IllegalActionException, NameDuplicationException
_removeParameters in class DDPEngineIllegalActionExceptionNameDuplicationExceptionprotected SparkJob _getModelPlan() throws IllegalActionException
IllegalActionExceptionprotected void _addSubModelToContract(SingleInputPatternActor pactor, Operator contract) throws IllegalActionException
IllegalActionExceptionprotected java.net.InetSocketAddress _parseOutputFromStartingServer(java.io.InputStream input) throws java.io.IOException, IllegalActionException
_parseOutputFromStartingServer in class DDPEnginejava.io.IOExceptionIllegalActionException