|
ensembl-hive-python3
2.3
|
This is the counterpart of GuestProcess. More...
Inheritance diagram for eHive.Process.BaseRunnable:Public Member Functions | |
| def | __init__ (self, read_fileno, write_fileno) |
| def | warning (self, message, is_error=False) |
| Store a message in the log_message table with is_error indicating whether the warning is actually an error or not. More... | |
| def | dataflow (self, output_ids, branch_name_or_code=1) |
| Dataflows the output_id(s) on a given branch (default 1). More... | |
| def | worker_temp_directory (self) |
| Returns the full path of the temporary directory created by the worker. More... | |
| def | param_defaults (self) |
| Returns the defaults parameters for this runnable. More... | |
| def | param_required (self, param_name) |
| Returns the value of the parameter "param_name" or raises an exception if anything wrong happens. More... | |
| def | param (self, param_name, args) |
| When called as a setter: sets the value of the parameter "param_name". More... | |
| def | param_exists (self, param_name) |
| Returns True or False, whether the parameter exists (it doesn't mean it can be successfully substituted) More... | |
| def | param_is_defined (self, param_name) |
| Returns True or False, whether the parameter exists, can be successfully substituted, and is not None. More... | |
Public Attributes | |
| debug | |
| input_job | |
| autoflow | |
Private Member Functions | |
| def | __print_debug (self, args) |
| def | __send_message (self, event, content) |
| seralizes the message in JSON and send it to the parent process More... | |
| def | __send_response (self, response) |
| Sends a response message to the parent process. More... | |
| def | __read_message (self) |
| Read a message from the parent and parse it. More... | |
| def | __send_message_and_wait_for_OK (self, event, content) |
| Send a message and expects a response to be 'OK'. More... | |
| def | __process_life_cycle (self) |
| Simple loop: wait for job parameters, do the job's life-cycle. More... | |
| def | __job_life_cycle (self, config) |
| Job's life-cycle. More... | |
| def | __run_method_if_exists (self, method) |
| method is one of "pre_cleanup", "fetch_input", "run", "write_output", "post_cleanup". More... | |
| def | __traceback (self, skipped_traces) |
| Remove "skipped_traces" lines from the stack trace (the eHive part) More... | |
Private Attributes | |
| __read_pipe | |
| __write_pipe | |
| __pid | |
| __created_worker_temp_directory | |
| __params | |
This is the counterpart of GuestProcess.
Note that most of the methods are private to be hidden in the derived classes.
This class can be used as a base-class for people to redefine fetch_input(), run() and/or write_output() (and/or pre_cleanup(), post_cleanup()). Jobs are supposed to raise CompleteEarlyException in case they complete before reaching. They can also raise JobFailedException to indicate a general failure
Definition at line 50 of file Process.py.
| def eHive.Process.BaseRunnable.__init__ | ( | self, | |
| read_fileno, | |||
| write_fileno | |||
| ) |
Definition at line 55 of file Process.py.
|
private |
Job's life-cycle.
See GuestProcess for a description of the protocol to communicate with the parent
Definition at line 131 of file Process.py.
Here is the call graph for this function:
|
private |
|
private |
Simple loop: wait for job parameters, do the job's life-cycle.
Definition at line 117 of file Process.py.
Here is the call graph for this function:
|
private |
Read a message from the parent and parse it.
Definition at line 95 of file Process.py.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
method is one of "pre_cleanup", "fetch_input", "run", "write_output", "post_cleanup".
We only the call the method if it exists to save a trip to the database.
Definition at line 188 of file Process.py.
Here is the call graph for this function:
|
private |
seralizes the message in JSON and send it to the parent process
Definition at line 71 of file Process.py.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Send a message and expects a response to be 'OK'.
Definition at line 109 of file Process.py.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Sends a response message to the parent process.
Definition at line 85 of file Process.py.
Here is the call graph for this function:
|
private |
Remove "skipped_traces" lines from the stack trace (the eHive part)
Definition at line 195 of file Process.py.
| def eHive.Process.BaseRunnable.dataflow | ( | self, | |
| output_ids, | |||
branch_name_or_code = 1 |
|||
| ) |
Dataflows the output_id(s) on a given branch (default 1).
Returns whatever the Perl side returns
Definition at line 213 of file Process.py.
Here is the caller graph for this function:| def eHive.Process.BaseRunnable.param | ( | self, | |
| param_name, | |||
| args | |||
| ) |
When called as a setter: sets the value of the parameter "param_name".
When called as a getter: returns the value of the parameter "param_name". It does not raise an exception if the parameter (or another one in the substitution stack) is undefined
Definition at line 254 of file Process.py.
Here is the caller graph for this function:| def eHive.Process.BaseRunnable.param_defaults | ( | self | ) |
Returns the defaults parameters for this runnable.
Definition at line 236 of file Process.py.
Here is the caller graph for this function:| def eHive.Process.BaseRunnable.param_exists | ( | self, | |
| param_name | |||
| ) |
Returns True or False, whether the parameter exists (it doesn't mean it can be successfully substituted)
Definition at line 268 of file Process.py.
Here is the caller graph for this function:| def eHive.Process.BaseRunnable.param_is_defined | ( | self, | |
| param_name | |||
| ) |
Returns True or False, whether the parameter exists, can be successfully substituted, and is not None.
Definition at line 273 of file Process.py.
Here is the call graph for this function:| def eHive.Process.BaseRunnable.param_required | ( | self, | |
| param_name | |||
| ) |
Returns the value of the parameter "param_name" or raises an exception if anything wrong happens.
The exception is marked as non-transient.
Definition at line 242 of file Process.py.
Here is the caller graph for this function:| def eHive.Process.BaseRunnable.warning | ( | self, | |
| message, | |||
is_error = False |
|||
| ) |
Store a message in the log_message table with is_error indicating whether the warning is actually an error or not.
Definition at line 208 of file Process.py.
Here is the call graph for this function:
Here is the caller graph for this function:| def eHive.Process.BaseRunnable.worker_temp_directory | ( | self | ) |
Returns the full path of the temporary directory created by the worker.
Runnables can implement "worker_temp_directory_name()" to return the name they would like to use
Definition at line 224 of file Process.py.
Here is the call graph for this function:
|
private |
Definition at line 120 of file Process.py.
|
private |
Definition at line 135 of file Process.py.
|
private |
Definition at line 59 of file Process.py.
|
private |
Definition at line 57 of file Process.py.
|
private |
Definition at line 58 of file Process.py.
| eHive.Process.BaseRunnable.autoflow |
Definition at line 215 of file Process.py.
| eHive.Process.BaseRunnable.debug |
Definition at line 60 of file Process.py.
| eHive.Process.BaseRunnable.input_job |
Definition at line 138 of file Process.py.