public class WorkerCore extends UnicastRemoteObject implements Worker, RemoteListener
ref
Constructor and Description |
---|
WorkerCore(RunAccounting accounting) |
Modifier and Type | Method and Description |
---|---|
void |
deleteLocalResources()
Arrange for the deletion of any resources created during worker process
construction.
|
String |
getConfiguration() |
RemoteListener |
getDefaultListener() |
String |
getName() |
String |
getProperty(String propName)
Get the value of a particular property, which should be listed in the
RemoteListener.listProperties() method. |
String |
getType() |
RemoteStatus |
getWorkerStatus() |
boolean |
initWorker(LocalWorker local,
String executeWorkflowCommand,
byte[] workflow,
File workingDir,
File inputBaclava,
Map<String,File> inputFiles,
Map<String,String> inputValues,
Map<String,String> inputDelimiters,
File outputBaclava,
File securityDir,
char[] password,
boolean generateProvenance,
Map<String,String> environment,
String token,
List<String> runtime)
Fire up the workflow.
|
void |
killWorker()
Kills off the subprocess if it exists and is alive.
|
String[] |
listProperties() |
void |
setProperty(String propName,
String value)
Set the value of a particular property, which should be listed in the
RemoteListener.listProperties() method. |
void |
setURReceiver(UsageRecordReceiver receiver) |
void |
startWorker()
Move the worker out of the stopped state and back to operating.
|
void |
stopWorker()
Move the worker into the stopped state from the operating state.
|
clone, exportObject, exportObject, exportObject, unexportObject
getClientHost, getLog, setLog
public WorkerCore(@Nonnull RunAccounting accounting) throws RemoteException
accounting
- Object that looks after how many runs are executing.RemoteException
public boolean initWorker(@Nonnull LocalWorker local, @Nonnull String executeWorkflowCommand, @Nonnull byte[] workflow, @Nonnull File workingDir, @Nullable File inputBaclava, @Nonnull Map<String,File> inputFiles, @Nonnull Map<String,String> inputValues, @Nonnull Map<String,String> inputDelimiters, @Nullable File outputBaclava, @Nonnull File securityDir, @Nullable char[] password, boolean generateProvenance, @Nonnull Map<String,String> environment, @Nullable String token, @Nonnull List<String> runtime) throws IOException
initWorker
in interface Worker
executeWorkflowCommand
- The command to run to execute the workflow.workflow
- The workflow document to execute.workingDir
- What directory to use as the working directory.inputBaclava
- The baclava file to use for inputs, or null to use
the other input* arguments' values.inputFiles
- A mapping of input names to files that supply them. Note that
we assume that nothing mapped here will be mapped in
inputValues.inputValues
- A mapping of input names to values to supply to them. Note
that we assume that nothing mapped here will be mapped in
inputFiles.outputBaclava
- What baclava file to write the output from the workflow into,
or null to have it written into the out
subdirectory.token
- The name of the workflow run.local
- The reference to the factory class for this worker.inputDelimiters
- A mapping of input names to characters used to split them into
lists.securityDir
- The directory containing the keystore and truststore. Must
not be null.password
- The password to the keystore and truststore. Must not be
null.generateProvenance
- Whether to generate a run bundle containing provenance data.environment
- Any environment variables that need to be added to the
invokation.runtime
- List of configuration details for the forked runtime.IOException
- If any of quite a large number of things goes wrong.public void killWorker()
killWorker
in interface Worker
public void startWorker() throws Exception
startWorker
in interface Worker
Exception
- if it fails.public void stopWorker() throws Exception
stopWorker
in interface Worker
Exception
- if it fails.public RemoteStatus getWorkerStatus()
getWorkerStatus
in interface Worker
public String getConfiguration()
getConfiguration
in interface RemoteListener
public String getName()
getName
in interface RemoteListener
public String getProperty(String propName) throws RemoteException
RemoteListener
RemoteListener.listProperties()
method.getProperty
in interface RemoteListener
propName
- The name of the property to read.RemoteException
- If anything goes wrong with the communication.public String getType()
getType
in interface RemoteListener
public String[] listProperties()
listProperties
in interface RemoteListener
public void setProperty(String propName, String value) throws RemoteException
RemoteListener
RemoteListener.listProperties()
method.setProperty
in interface RemoteListener
propName
- The name of the property to write.value
- The value to set the property to.RemoteException
- If anything goes wrong with the communication.public RemoteListener getDefaultListener()
getDefaultListener
in interface Worker
public void setURReceiver(@Nonnull UsageRecordReceiver receiver)
setURReceiver
in interface Worker
receiver
- The destination where any final usage records are to be
written in order to log them back to the server.public void deleteLocalResources() throws ImplementationException
Worker
deleteLocalResources
in interface Worker
ImplementationException
- If anything goes wrong.Copyright © 2015–2018 The Apache Software Foundation. All rights reserved.