public class BasicDecider extends Plugin implements DeciderInterface
Modifier and Type | Class and Description |
---|---|
protected static class |
BasicDecider.FILE_STATUS
These file statuses reflect the discussion at https://wiki.oicr.on.ca/display/SEQWARE/BasicDecider+logic
|
protected static class |
BasicDecider.PREVIOUS_RUN_STATUS
We care about three types of status, an outright fail, other (pending, running, submitted, etc.), and completed
|
Constructor and Description |
---|
BasicDecider() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
checkFileDetails(ReturnValue returnValue,
FileMetadata fm)
Performs any additional checks on the file before adding it to the list of files to incorporate.
|
ReturnValue |
clean_up()
Perform post-task clean-up here.
|
protected String |
commaSeparateMy(Collection<String> list) |
protected BasicDecider.FILE_STATUS |
compareWorkflowRunFiles(Set<Integer> filesSWIDsHasRun,
Collection<String> filesToRun)
Tests if the files from the workflow run (filesHasRun) are the same as those found in the database (filesToRun).
|
protected ArrayList<String> |
constructCommand() |
protected BasicDecider.PREVIOUS_RUN_STATUS |
determineStatus(WorkflowRunStatus generateStatus)
Map a normal status to whether a workflow run completed, failed, or other (submitted, pending, etc.) (the states that we care about
for the decider)
|
ReturnValue |
do_run()
Performs the main tasks for the plugin.
|
ReturnValue |
do_summary()
Just returns a summary of what would be run.
|
ReturnValue |
do_test()
Perform any active system testing here.
|
protected ReturnValue |
doFinalCheck(String commaSeparatedFilePaths,
String commaSeparatedParentAccessions)
allow to user to do the final check and decide to run or cancel the decider e.g.
|
String |
get_description()
Generates a short description of the plugin, preferably one line.
|
Boolean |
getForceRunAll() |
FindAllTheFiles.Header |
getGroupingStrategy() |
FindAllTheFiles.Header |
getHeader()
Deprecated.
|
Boolean |
getMetadataWriteback() |
List<String> |
getMetaType() |
Set<String> |
getParentWorkflowAccessions() |
Boolean |
getTest() |
String |
getWorkflowAccession() |
Set<String> |
getWorkflowAccessionsToCheck() |
protected String |
handleGroupByAttribute(String attribute) |
ReturnValue |
init()
Plugin initialization code goes here.
|
protected static boolean |
isCountAsFail(BasicDecider.FILE_STATUS fileStatus,
BasicDecider.PREVIOUS_RUN_STATUS previousStatus)
We now use the guideline that we only count failures when they occur on the same number of files (with the same paths)
|
protected static boolean |
isDoRerun(BasicDecider.FILE_STATUS fileStatus,
BasicDecider.PREVIOUS_RUN_STATUS previousStatus)
See https://wiki.oicr.on.ca/display/SEQWARE/BasicDecider+logic
|
protected boolean |
isToRunContained(Set<Integer> filesSWIDsHasRun,
Collection<String> filesToRun)
Returns true if the filesToRun are totally contained by the files associated with the files in a given workflowRunAcc
|
protected Map<String,String> |
modifyIniFile(String commaSeparatedFilePaths,
String commaSeparatedParentAccessions) |
protected void |
printFileMetadata(ReturnValue file,
FileMetadata fm) |
protected boolean |
reportLaunch()
Report an actual launch of a workflow for testing purpose
|
protected boolean |
rerunWorkflowRun(Collection<String> filesToRun,
Collection<Integer> fileSWIDs)
Returns true only if there are more files to run than have been run on any workflow so far, or if the filesToRun have different
filepaths than those that have been run before.
|
Map<String,List<ReturnValue>> |
separateFiles(List<ReturnValue> vals,
String groupBy) |
void |
setForceRunAll(Boolean forceRunAll) |
void |
setGroupingStrategy(FindAllTheFiles.Header strategy) |
void |
setHeader(FindAllTheFiles.Header header)
Deprecated.
|
void |
setMetadataWriteback(Boolean metadataWriteback) |
void |
setMetaType(List<String> metaType) |
void |
setMetaws(Metadata metaws) |
void |
setParentWorkflowAccessions(Set<String> parentWorkflowAccessions) |
void |
setTest(Boolean test) |
void |
setWorkflowAccession(String workflowAccession) |
void |
setWorkflowAccessionsToCheck(Set<String> workflowAccessions) |
protected String |
spaceSeparateMy(Collection<String> list) |
get_syntax, parse_parameters, print, println, setConfig, setMetadata, setParams
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
get_syntax, parse_parameters, setConfig, setMetadata, setParams
protected Random random
public String get_description()
get_description
in interface DeciderInterface
get_description
in interface PluginInterface
get_description
in class Plugin
public ReturnValue init()
DeciderInterface
init
in interface DeciderInterface
init
in interface PluginInterface
public ReturnValue do_test()
DeciderInterface
do_test
in interface DeciderInterface
do_test
in interface PluginInterface
public ReturnValue do_run()
DeciderInterface
do_run
in interface DeciderInterface
do_run
in interface PluginInterface
protected boolean rerunWorkflowRun(Collection<String> filesToRun, Collection<Integer> fileSWIDs)
filesToRun
- fileSWIDs
- protected BasicDecider.PREVIOUS_RUN_STATUS determineStatus(WorkflowRunStatus generateStatus)
generateStatus
- protected boolean isToRunContained(Set<Integer> filesSWIDsHasRun, Collection<String> filesToRun)
filesSWIDsHasRun
- filesToRun
- the files to check to see if they are contained by the past runprotected BasicDecider.FILE_STATUS compareWorkflowRunFiles(Set<Integer> filesSWIDsHasRun, Collection<String> filesToRun)
filesSWIDsHasRun
- filesToRun
- protected void printFileMetadata(ReturnValue file, FileMetadata fm)
protected String commaSeparateMy(Collection<String> list)
protected String spaceSeparateMy(Collection<String> list)
protected boolean checkFileDetails(ReturnValue returnValue, FileMetadata fm)
returnValue
- The ReturnValue representing the Processing event. May have one or more files. The attributes table contains the
information from FindAllTheFiles.Header.fm
- the particular file that will be addedprotected Map<String,String> modifyIniFile(String commaSeparatedFilePaths, String commaSeparatedParentAccessions)
public Map<String,List<ReturnValue>> separateFiles(List<ReturnValue> vals, String groupBy)
public ReturnValue clean_up()
DeciderInterface
clean_up
in interface DeciderInterface
clean_up
in interface PluginInterface
public ReturnValue do_summary()
DeciderInterface
do_summary
in interface DeciderInterface
public Boolean getForceRunAll()
public void setForceRunAll(Boolean forceRunAll)
@Deprecated public FindAllTheFiles.Header getHeader()
public FindAllTheFiles.Header getGroupingStrategy()
@Deprecated public void setHeader(FindAllTheFiles.Header header)
header
- public void setGroupingStrategy(FindAllTheFiles.Header strategy)
public Boolean getMetadataWriteback()
public void setMetadataWriteback(Boolean metadataWriteback)
public void setParentWorkflowAccessions(Set<String> parentWorkflowAccessions)
public Boolean getTest()
public void setTest(Boolean test)
public String getWorkflowAccession()
public void setWorkflowAccession(String workflowAccession)
public void setWorkflowAccessionsToCheck(Set<String> workflowAccessions)
protected ReturnValue doFinalCheck(String commaSeparatedFilePaths, String commaSeparatedParentAccessions)
commaSeparatedFilePaths
- commaSeparatedParentAccessions
- protected boolean reportLaunch()
public void setMetaws(Metadata metaws)
protected static boolean isCountAsFail(BasicDecider.FILE_STATUS fileStatus, BasicDecider.PREVIOUS_RUN_STATUS previousStatus)
fileStatus
- previousStatus
- protected static boolean isDoRerun(BasicDecider.FILE_STATUS fileStatus, BasicDecider.PREVIOUS_RUN_STATUS previousStatus)
fileStatus
- previousStatus
- Copyright © 2015 SeqWare. All rights reserved.