ensembl-hive-java  2.6
org.ensembl.hive.BaseRunnable Class Referenceabstract
+ Inheritance diagram for org.ensembl.hive.BaseRunnable:
+ Collaboration diagram for org.ensembl.hive.BaseRunnable:

Public Member Functions

void setFileDescriptors (FileDescriptor inputDescriptor, FileDescriptor outputDescriptor) throws IOException
 
void processLifeCycle ()
 

Static Public Member Functions

static Long numericParamToLong (Object param)
 
static String numericParamToStr (Object param)
 

Static Public Attributes

static final String VERSION = "5.0"
 

Protected Member Functions

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 ()
 
void sendMessageAndWait (String event, Object content)
 
void sendEventMessage (String event, Object content)
 
Map< String, Object > readMessage ()
 
Map< String, Object > readMessageAndRespond ()
 
void sendOK ()
 

Static Protected Member Functions

static Map< String, Object > toMap (Object... o)
 

Static Protected Attributes

static final Map< String, Object > DEFAULT_PARAMS = new HashMap<>()
 

Detailed Description

Base class implementing the runnable lifecycle

Author
dstaines

Definition at line 48 of file BaseRunnable.java.

Member Function Documentation

◆ 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
paramsThe current Parameters structure of job
outputIdsCollection of hashes representing the parameters of the new jobs
Returns
Structure received from the parent

Definition at line 281 of file BaseRunnable.java.

+ Here is the caller graph for this function:

◆ 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
paramsThe current Parameters structure of job
outputIdsCollection of hashes representing the parameters of the new jobs
branchNameOrCodeBranch number
Returns
Structure received from the parent

Definition at line 295 of file BaseRunnable.java.

+ Here is the call graph for this function:

◆ fetchInput()

abstract void org.ensembl.hive.BaseRunnable.fetchInput ( Job  job)
abstractprotected

◆ getLog()

Logger org.ensembl.hive.BaseRunnable.getLog ( )
inlineprotected

Definition at line 108 of file BaseRunnable.java.

+ Here is the caller graph for this function:

◆ getParamDefaults()

Map<String, Object> org.ensembl.hive.BaseRunnable.getParamDefaults ( )
inlineprotected

◆ init()

void org.ensembl.hive.BaseRunnable.init ( )
inlineprotected

Definition at line 235 of file BaseRunnable.java.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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
paramThe source object. Currently only numeric and string types are handled
Returns
A Long with the same representation as
Parameters

Definition at line 429 of file BaseRunnable.java.

+ Here is the caller graph for this function:

◆ numericParamToStr()

static String org.ensembl.hive.BaseRunnable.numericParamToStr ( Object  param)
inlinestatic

Definition at line 445 of file BaseRunnable.java.

+ Here is the caller graph for this function:

◆ postCleanUp()

void org.ensembl.hive.BaseRunnable.postCleanUp ( Job  job)
inlineprotected

Definition at line 256 of file BaseRunnable.java.

+ Here is the caller graph for this function:

◆ postHealthcheck()

void org.ensembl.hive.BaseRunnable.postHealthcheck ( Job  job)
inlineprotected

Definition at line 253 of file BaseRunnable.java.

+ Here is the caller graph for this function:

◆ preCleanUp()

void org.ensembl.hive.BaseRunnable.preCleanUp ( Job  job)
inlineprotected

Definition at line 246 of file BaseRunnable.java.

+ Here is the caller graph for this function:

◆ processLifeCycle()

void org.ensembl.hive.BaseRunnable.processLifeCycle ( )
inline

Definition at line 138 of file BaseRunnable.java.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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 381 of file BaseRunnable.java.

+ Here is the caller graph for this function:

◆ readMessageAndRespond()

Map<String, Object> org.ensembl.hive.BaseRunnable.readMessageAndRespond ( )
inlineprotected

Definition at line 394 of file BaseRunnable.java.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ run()

abstract void org.ensembl.hive.BaseRunnable.run ( Job  job)
abstractprotected

◆ runLifeCycle()

void org.ensembl.hive.BaseRunnable.runLifeCycle ( Job  job,
boolean  executeWrites 
)
inlineprotected

Definition at line 213 of file BaseRunnable.java.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sendEventMessage()

void org.ensembl.hive.BaseRunnable.sendEventMessage ( String  event,
Object  content 
)
inlineprotected

Send an event-based message to the parent

Parameters
eventType of the event
contentContent of the event

Definition at line 348 of file BaseRunnable.java.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sendMessageAndWait()

void org.ensembl.hive.BaseRunnable.sendMessageAndWait ( String  event,
Object  content 
)
inlineprotected

Send a message and wait for OK from the parent

Parameters
eventType of the event
contentContent of the event

Definition at line 333 of file BaseRunnable.java.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sendOK()

void org.ensembl.hive.BaseRunnable.sendOK ( )
inlineprotected

Definition at line 400 of file BaseRunnable.java.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setFileDescriptors()

void org.ensembl.hive.BaseRunnable.setFileDescriptors ( FileDescriptor  inputDescriptor,
FileDescriptor  outputDescriptor 
) throws IOException
inline

Definition at line 132 of file BaseRunnable.java.

+ Here is the caller graph for this function:

◆ toMap()

static Map<String, Object> org.ensembl.hive.BaseRunnable.toMap ( Object...  o)
inlinestaticprotected

Utility method for building a hash from key-value pairs

Parameters
oA 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.

+ Here is the caller graph for this function:

◆ 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
messageThe message string
isErrorDirectly maps to the log_message.is_error columns

Definition at line 268 of file BaseRunnable.java.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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.

+ Here is the call graph for this function:

◆ writeOutput()

abstract void org.ensembl.hive.BaseRunnable.writeOutput ( Job  job)
abstractprotected

Member Data Documentation

◆ DEFAULT_PARAMS

final Map<String, Object> org.ensembl.hive.BaseRunnable.DEFAULT_PARAMS = new HashMap<>()
staticprotected

Definition at line 78 of file BaseRunnable.java.

◆ VERSION

final String org.ensembl.hive.BaseRunnable.VERSION = "5.0"
static

Definition at line 76 of file BaseRunnable.java.


The documentation for this class was generated from the following file: