|
static final String | VERSION = "3.1" |
|
|
Logger | getLog () |
|
void | runLifeCycle (Job job, boolean executeWrites) |
|
void | init () |
|
Map< String, Object > | getParamDefaults () |
|
void | preCleanUp (Job job) |
|
abstract void | fetchInput (Job job) |
|
abstract void | run (Job job) |
|
void | postHealthcheck (Job job) |
|
void | postCleanUp (Job job) |
|
abstract void | writeOutput (Job job) |
|
void | warning (String message, boolean isError) |
|
Map< String, Object > | dataflow (ParamContainer params, Collection< Object > outputIds) |
|
Map< String, Object > | dataflow (ParamContainer params, Collection< Object > outputIds, int branchNameOrCode) |
|
String | workerTempDirectory () |
|
String | getWorkerTemplateName () |
|
void | sendMessageAndWait (String event, Object content) |
|
void | sendEventMessage (String event, Object content) |
|
Map< String, Object > | readMessage () |
|
Map< String, Object > | readMessageAndRespond () |
|
void | sendOK () |
|
|
static Map< String, Object > | toMap (Object... o) |
|
Base class implementing the runnable lifecycle
- Author
- dstaines
Definition at line 48 of file BaseRunnable.java.
◆ dataflow() [1/2]
Map<String, Object> org.ensembl.hive.BaseRunnable.dataflow |
( |
ParamContainer |
params, |
|
|
Collection< Object > |
outputIds |
|
) |
| |
|
inlineprotected |
Dataflows the output_id(s) on a given branch (default 1). Returns whatever the Perl side returns
- Parameters
-
params | The current Parameters structure of job |
outputIds | Collection of hashes representing the parameters of the new jobs |
- Returns
- Structure received from the parent
Definition at line 281 of file BaseRunnable.java.
◆ dataflow() [2/2]
Map<String, Object> org.ensembl.hive.BaseRunnable.dataflow |
( |
ParamContainer |
params, |
|
|
Collection< Object > |
outputIds, |
|
|
int |
branchNameOrCode |
|
) |
| |
|
inlineprotected |
Dataflows the output_id(s) on a given branch (default 1). Returns whatever the Perl side returns
- Parameters
-
params | The current Parameters structure of job |
outputIds | Collection of hashes representing the parameters of the new jobs |
branchNameOrCode | Branch number |
- Returns
- Structure received from the parent
Definition at line 295 of file BaseRunnable.java.
◆ fetchInput()
abstract void org.ensembl.hive.BaseRunnable.fetchInput |
( |
Job |
job | ) |
|
|
abstractprotected |
◆ getLog()
Logger org.ensembl.hive.BaseRunnable.getLog |
( |
| ) |
|
|
inlineprotected |
◆ getParamDefaults()
Map<String, Object> org.ensembl.hive.BaseRunnable.getParamDefaults |
( |
| ) |
|
|
inlineprotected |
◆ getWorkerTemplateName()
String org.ensembl.hive.BaseRunnable.getWorkerTemplateName |
( |
| ) |
|
|
inlineprotected |
Override to provide a special template for the worker temporary directory
- Returns
- A String representing the template location for worker directories or null
Definition at line 333 of file BaseRunnable.java.
◆ init()
void org.ensembl.hive.BaseRunnable.init |
( |
| ) |
|
|
inlineprotected |
◆ numericParamToLong()
static Long org.ensembl.hive.BaseRunnable.numericParamToLong |
( |
Object |
param | ) |
|
|
inlinestatic |
Helper method for dealing with numbers that have been passed around through JSON and may be of different types
- Parameters
-
param | The source object. Currently only numeric and string types are handled |
- Returns
- A Long with the same representation as
- Parameters
-
Definition at line 439 of file BaseRunnable.java.
◆ numericParamToStr()
static String org.ensembl.hive.BaseRunnable.numericParamToStr |
( |
Object |
param | ) |
|
|
inlinestatic |
◆ postCleanUp()
void org.ensembl.hive.BaseRunnable.postCleanUp |
( |
Job |
job | ) |
|
|
inlineprotected |
◆ postHealthcheck()
void org.ensembl.hive.BaseRunnable.postHealthcheck |
( |
Job |
job | ) |
|
|
inlineprotected |
◆ preCleanUp()
void org.ensembl.hive.BaseRunnable.preCleanUp |
( |
Job |
job | ) |
|
|
inlineprotected |
◆ processLifeCycle()
void org.ensembl.hive.BaseRunnable.processLifeCycle |
( |
| ) |
|
|
inline |
◆ readMessage()
Map<String, Object> org.ensembl.hive.BaseRunnable.readMessage |
( |
| ) |
|
|
inlineprotected |
Read a JSON message from the parent
- Returns
- A Map structure representing the JSON string read from the parent
Definition at line 391 of file BaseRunnable.java.
◆ readMessageAndRespond()
Map<String, Object> org.ensembl.hive.BaseRunnable.readMessageAndRespond |
( |
| ) |
|
|
inlineprotected |
◆ run()
abstract void org.ensembl.hive.BaseRunnable.run |
( |
Job |
job | ) |
|
|
abstractprotected |
◆ runLifeCycle()
void org.ensembl.hive.BaseRunnable.runLifeCycle |
( |
Job |
job, |
|
|
boolean |
executeWrites |
|
) |
| |
|
inlineprotected |
◆ sendEventMessage()
void org.ensembl.hive.BaseRunnable.sendEventMessage |
( |
String |
event, |
|
|
Object |
content |
|
) |
| |
|
inlineprotected |
Send an event-based message to the parent
- Parameters
-
event | Type of the event |
content | Content of the event |
Definition at line 358 of file BaseRunnable.java.
◆ sendMessageAndWait()
void org.ensembl.hive.BaseRunnable.sendMessageAndWait |
( |
String |
event, |
|
|
Object |
content |
|
) |
| |
|
inlineprotected |
Send a message and wait for OK from the parent
- Parameters
-
event | Type of the event |
content | Content of the event |
Definition at line 343 of file BaseRunnable.java.
◆ sendOK()
void org.ensembl.hive.BaseRunnable.sendOK |
( |
| ) |
|
|
inlineprotected |
◆ setFileDescriptors()
void org.ensembl.hive.BaseRunnable.setFileDescriptors |
( |
FileDescriptor |
inputDescriptor, |
|
|
FileDescriptor |
outputDescriptor |
|
) |
| throws IOException |
|
inline |
◆ toMap()
static Map<String, Object> org.ensembl.hive.BaseRunnable.toMap |
( |
Object... |
o | ) |
|
|
inlinestaticprotected |
Utility method for building a hash from key-value pairs
- Parameters
-
o | A list with an even number of elemements |
- Returns
- A hash that associates its key to its next value in the list
Definition at line 86 of file BaseRunnable.java.
◆ warning()
void org.ensembl.hive.BaseRunnable.warning |
( |
String |
message, |
|
|
boolean |
isError |
|
) |
| |
|
inlineprotected |
Store a message in the log_message table with is_error indicating whether the warning is actually an error or not
- Parameters
-
message | The message string |
isError | Directly maps to the log_message.is_error columns |
Definition at line 268 of file BaseRunnable.java.
◆ workerTempDirectory()
String org.ensembl.hive.BaseRunnable.workerTempDirectory |
( |
| ) |
|
|
inlineprotected |
Returns the full path of the temporary directory created by the worker. Runnables can override this to return the name they would like to use
- Returns
- directory name
Definition at line 318 of file BaseRunnable.java.
◆ writeOutput()
abstract void org.ensembl.hive.BaseRunnable.writeOutput |
( |
Job |
job | ) |
|
|
abstractprotected |
◆ DEFAULT_PARAMS
final Map<String, Object> org.ensembl.hive.BaseRunnable.DEFAULT_PARAMS = new HashMap<>() |
|
staticprotected |
◆ VERSION
final String org.ensembl.hive.BaseRunnable.VERSION = "3.1" |
|
static |
The documentation for this class was generated from the following file: