public abstract class JavaModuleImpl extends ScriptModuleImpl implements JavaModule
Modifier and Type | Field and Description |
---|---|
protected static String |
BLJ_OPTIONS
Docker environment variable holding the Docker program switches: "BLJ_OPTIONS"
|
GZIP_EXT, LOG_EXT, PDF_EXT, RETURN, SH_EXT, TAB_DELIM, TSV_EXT, TXT_EXT
SCRIPT_BATCH_SIZE, SCRIPT_DEFAULT_HEADER, SCRIPT_NUM_THREADS, SCRIPT_PERMISSIONS, SCRIPT_TIMEOUT
MAIN_SCRIPT_PREFIX, OUTPUT_DIR, TEMP_DIR
Constructor and Description |
---|
JavaModuleImpl() |
Modifier and Type | Method and Description |
---|---|
List<List<String>> |
buildScript(List<File> files)
Java script only require 2 lines, one to run the blj_config to update our $PATH and gain access to environment
variables, and then the direct call to the BioLockJ.jar.
|
void |
executeTask()
JavaModules run pure Java code.
If in Docker mode and not in Direct mode, execute BioModule.executeTask() to build the
bash script.If not in Docker mode AND on the cluster AND Config ."pipeline.detachJavaModules"="Y" execute
BioModule.executeTask() to build the bash scriptOtherwise, execute runModule() to run the Java code to execute module functionality. |
protected String |
getSource()
Get the program source (either the jar path or main class biolockj.BioLockJ);
|
List<String> |
getWorkerScriptFunctions()
If in Docker mode, set "BLJ_OPTIONS" which will be reference in every worker script when running BioLockJ
in direct mode.
|
boolean |
isValidInputModule(BioModule module)
If module is a
SeqModule input must contain sequence data. |
protected void |
markStatus(String status)
This method sets the module status by saving the indicator file to the module root dir.
|
void |
moduleComplete()
This method will create the success flag file so the next module can run.
|
void |
moduleFailed()
This method will create the fail flag file so the pipeline can move on..
|
abstract void |
runModule()
This method executes the modules primary Java routine.
|
buildScriptForPairedReads, checkDependencies, getJobParams, getMainScript, getRuntimeParams, getScriptDir, getScriptErrors, getSummary, getTimeout, hasScripts
cacheInputFiles, cleanUp, compareTo, equals, findModuleInputFiles, getFileCache, getID, getInputFiles, getModuleDir, getOutputDir, getPostRequisiteModules, getPreRequisiteModules, getTempDir, init, toString, validateFileNameUnique
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
buildScriptForPairedReads, getJobParams, getMainScript, getScriptDir, getScriptErrors, getTimeout
checkDependencies, cleanUp, getID, getInputFiles, getModuleDir, getOutputDir, getPostRequisiteModules, getPreRequisiteModules, getSummary, getTempDir, init
protected static final String BLJ_OPTIONS
public List<List<String>> buildScript(List<File> files) throws Exception
buildScript
in interface ScriptModule
buildScript
in class ScriptModuleImpl
files
- Files in the input directory that contain only forward readsException
- if unable to generate script linespublic void executeTask() throws Exception
BioModule.executeTask()
to build the
bash script.Config
."pipeline.detachJavaModules"="Y" execute
BioModule.executeTask()
to build the bash scriptrunModule()
to run the Java code to execute module functionality.executeTask
in interface BioModule
executeTask
in class ScriptModuleImpl
Exception
- thrown if the module is unable to complete is taskpublic List<String> getWorkerScriptFunctions() throws Exception
getWorkerScriptFunctions
in interface ScriptModule
getWorkerScriptFunctions
in class ScriptModuleImpl
Exception
- if errors occurpublic boolean isValidInputModule(BioModule module)
SeqModule
input must contain sequence data.isValidInputModule
in interface BioModule
isValidInputModule
in class BioModuleImpl
module
- BioModule that ran before the current BioModulepublic void moduleComplete() throws Exception
JavaModule
moduleComplete
in interface JavaModule
Exception
- thrown if any runtime error occurspublic void moduleFailed() throws Exception
JavaModule
moduleFailed
in interface JavaModule
Exception
- thrown if any runtime error occurspublic abstract void runModule() throws Exception
JavaModule
runModule
in interface JavaModule
Exception
- thrown if any runtime error occursprotected final String getSource() throws Exception
Exception
- if unable to determine source