@Override\r
public String getCommand(ExecProvider provider)\r
throws UnsupportedRuntimeException {\r
- String command = compbio.engine.client.Util.getCommand(provider, exec\r
- .getClass());\r
+ String command = compbio.engine.client.Util.getCommand(provider,\r
+ exec.getClass());\r
if (Util.isEmpty(command)) {\r
throw new UnsupportedRuntimeException(\r
"Executable "\r
+ this.exec.getClass().getSimpleName()\r
+ " is not supported by the current runtime environment! Current runtime environment is "\r
- + (SysPrefs.isWindows ? "Windows "\r
+ + (SysPrefs.isWindows\r
+ ? "Windows "\r
: "Linux/Unix/Mac"));\r
}\r
return command;\r
* @return\r
* @throws IOException\r
*/\r
- public static <V> LimitsManager<V> getRunnerLimits(\r
- Class<? extends Executable<V>> clazz) throws IOException {\r
+ public static <V> LimitsManager<V> getRunnerLimits(Class<V> clazz)\r
+ throws IOException {\r
String parametersFile = clazz.getSimpleName().toLowerCase()\r
+ ".limits.file";\r
LimitsManager<V> limits = (LimitsManager<V>) getRunnerConfiguration(\r
return limits;\r
}\r
\r
- static <V> Object getRunnerConfiguration(\r
- Class<? extends Executable<V>> clazz, Class<?> configurationHolder,\r
- String propertyName) throws IOException {\r
+ static <V> Object getRunnerConfiguration(Class<V> clazz,\r
+ Class<?> configurationHolder, String propertyName)\r
+ throws IOException {\r
\r
Object rconf = null;\r
FileInputStream confFileStream = null;\r
return Collections.emptyMap();\r
}\r
\r
- return EnvVariableProcessor.getEnvVariables(envProperty, this\r
- .getClass());\r
+ return EnvVariableProcessor.getEnvVariables(envProperty,\r
+ this.getClass());\r
}\r
\r
@Override\r
* \r
* @return subclasses must return their type\r
*/\r
- public abstract Class<Executable<T>> getType();\r
+ public abstract Class<T> getType();\r
\r
}\r
// Work directory could be null for cancelled or incomplete jobs, just\r
// ignore\r
if (!compbio.util.Util.isEmpty(workDirectory)) {\r
- writeFile(workDirectory, fileAndEventName, new Long(System\r
- .currentTimeMillis()).toString(), false);\r
+ writeFile(workDirectory, fileAndEventName,\r
+ new Long(System.currentTimeMillis()).toString(), false);\r
}\r
}\r
\r
String content, boolean override) {\r
File file = null;\r
if (compbio.util.Util.isEmpty(workDirectory)) {\r
- log\r
- .debug("Calling compbio.engine.Util.writeFile() with not work directory."\r
- + " Skipping writing statistics!");\r
+ log.debug("Calling compbio.engine.Util.writeFile() with not work directory."\r
+ + " Skipping writing statistics!");\r
return;\r
}\r
assert !compbio.util.Util.isEmpty(content) : "Content expected!";\r
return sfile.createNewFile();\r
}\r
} catch (IOException e) {\r
- log.error("Could not record stat marker file " + fileType\r
- + " into the directory " + workDirectory + " ! "\r
- + e.getMessage(), e.getCause());\r
+ log.error(\r
+ "Could not record stat marker file " + fileType\r
+ + " into the directory " + workDirectory + " ! "\r
+ + e.getMessage(), e.getCause());\r
}\r
return false;\r
}\r
String absolute = relativePath;\r
if (!PathValidator.isAbsolutePath(relativePath)) {\r
absolute = PropertyHelperManager.getLocalPath() + relativePath;\r
- Util.log\r
- .trace("Changing local path in enviromental variable to absolute: FROM "\r
- + relativePath + " TO " + absolute);\r
+ Util.log.trace("Changing local path in enviromental variable to absolute: FROM "\r
+ + relativePath + " TO " + absolute);\r
}\r
return absolute;\r
}\r
exec = ConfExecutable.newConfExecutable(rconf);\r
fileInStream.close();\r
} catch (FileNotFoundException e) {\r
- log.error("Could not find run configuration to load!"\r
- + e.getLocalizedMessage(), e.getCause());\r
+ log.error(\r
+ "Could not find run configuration to load!"\r
+ + e.getLocalizedMessage(), e.getCause());\r
throw new ResultNotAvailableException(\r
"Could not find run configuration to load!"\r
+ e.getMessage(), e.getCause());\r
} catch (IOException e) {\r
- log.error("IO Exception while reading run configuration file!"\r
- + e.getLocalizedMessage(), e.getCause());\r
+ log.error(\r
+ "IO Exception while reading run configuration file!"\r
+ + e.getLocalizedMessage(), e.getCause());\r
throw new ResultNotAvailableException(\r
- "Could not load run configuration!" + e.getMessage(), e\r
- .getCause());\r
+ "Could not load run configuration!" + e.getMessage(),\r
+ e.getCause());\r
} finally {\r
FileUtil.closeSilently(log, fileInStream);\r
}\r
* par.getOptionName() + "=" + par.getPossibleValues().get(0); } //\r
* separate options options.add(option); } return options; }\r
*/\r
- \r
- public static <T> LimitsManager<T> getLimits(Class<Executable<T>> clazz) {\r
+\r
+ public static <T> LimitsManager<T> getLimits(Class<T> clazz) {\r
LimitsManager<T> limits = null;\r
try {\r
limits = ConfExecutable.getRunnerLimits(clazz);\r
} catch (FileNotFoundException e) {\r
- Util.log.warn(\r
- "No limits are found for " + clazz + " executable! "\r
- + e.getLocalizedMessage(), e.getCause());\r
+ Util.log.warn("No limits are found for " + clazz + " executable! "\r
+ + e.getLocalizedMessage(), e.getCause());\r
// its ok, limit may not be initialized\r
} catch (IOException e) {\r
Util.log.warn("IO exception while attempting to read limits for "\r
\r
@SuppressWarnings("unchecked")\r
@Override\r
- public Class<Executable<AACon>> getType() {\r
- return (Class<Executable<AACon>>) this.getClass();\r
+ public Class<AACon> getType() {\r
+ return (Class<AACon>) this.getClass();\r
}\r
\r
public static String getStatFile() {\r
import compbio.data.sequence.ScoreManager;\r
import compbio.data.sequence.SequenceUtil;\r
import compbio.data.sequence.UnknownFileFormatException;\r
-import compbio.engine.client.Executable;\r
import compbio.engine.client.PipedExecutable;\r
import compbio.engine.client.SkeletalExecutable;\r
import compbio.metadata.ResultNotAvailableException;\r
\r
@SuppressWarnings("unchecked")\r
@Override\r
- public Class<Executable<Disembl>> getType() {\r
- return (Class<Executable<Disembl>>) this.getClass();\r
+ public Class<Disembl> getType() {\r
+ return (Class<Disembl>) this.getClass();\r
}\r
\r
}\r
import compbio.data.sequence.ScoreManager;\r
import compbio.data.sequence.SequenceUtil;\r
import compbio.data.sequence.UnknownFileFormatException;\r
-import compbio.engine.client.Executable;\r
import compbio.engine.client.PipedExecutable;\r
import compbio.engine.client.SkeletalExecutable;\r
import compbio.metadata.ResultNotAvailableException;\r
// super.setInput("");\r
}\r
\r
+ @Override\r
@SuppressWarnings("unchecked")\r
public ScoreManager getResults(String workDirectory)\r
throws ResultNotAvailableException {\r
\r
@SuppressWarnings("unchecked")\r
@Override\r
- public Class<Executable<GlobPlot>> getType() {\r
- return (Class<Executable<GlobPlot>>) this.getClass();\r
+ public Class<GlobPlot> getType() {\r
+ return (Class<GlobPlot>) this.getClass();\r
}\r
\r
}\r
\r
@SuppressWarnings("unchecked")\r
@Override\r
- public Class<Executable<Jronn>> getType() {\r
- return (Class<Executable<Jronn>>) this.getClass();\r
+ public Class<Jronn> getType() {\r
+ return (Class<Jronn>) this.getClass();\r
}\r
\r
public static String getStatFile() {\r
\r
import compbio.data.sequence.Alignment;\r
import compbio.data.sequence.UnknownFileFormatException;\r
-import compbio.engine.client.Executable;\r
import compbio.engine.client.SkeletalExecutable;\r
import compbio.metadata.ResultNotAvailableException;\r
import compbio.runner.Util;\r
\r
@SuppressWarnings("unchecked")\r
@Override\r
- public Class<Executable<ClustalW>> getType() {\r
- return (Class<Executable<ClustalW>>) this.getClass();\r
+ public Class<ClustalW> getType() {\r
+ return (Class<ClustalW>) this.getClass();\r
}\r
\r
}\r
\r
import compbio.data.sequence.Alignment;\r
import compbio.data.sequence.UnknownFileFormatException;\r
-import compbio.engine.client.Executable;\r
import compbio.engine.client.PipedExecutable;\r
import compbio.engine.client.SkeletalExecutable;\r
import compbio.metadata.ResultNotAvailableException;\r
\r
@SuppressWarnings("unchecked")\r
@Override\r
- public Class<Executable<Mafft>> getType() {\r
- return (Class<Executable<Mafft>>) this.getClass();\r
+ public Class<Mafft> getType() {\r
+ return (Class<Mafft>) this.getClass();\r
}\r
\r
/*\r
\r
import compbio.data.sequence.Alignment;\r
import compbio.data.sequence.UnknownFileFormatException;\r
-import compbio.engine.client.Executable;\r
import compbio.engine.client.SkeletalExecutable;\r
import compbio.metadata.ResultNotAvailableException;\r
import compbio.runner.Util;\r
\r
@SuppressWarnings("unchecked")\r
@Override\r
- public Class<Executable<Muscle>> getType() {\r
- return (Class<Executable<Muscle>>) this.getClass();\r
+ public Class<Muscle> getType() {\r
+ return (Class<Muscle>) this.getClass();\r
}\r
\r
}\r
\r
import compbio.data.sequence.Alignment;\r
import compbio.data.sequence.UnknownFileFormatException;\r
-import compbio.engine.client.Executable;\r
import compbio.engine.client.PipedExecutable;\r
import compbio.engine.client.SkeletalExecutable;\r
import compbio.metadata.ResultNotAvailableException;\r
\r
@SuppressWarnings("unchecked")\r
@Override\r
- public Class<Executable<Probcons>> getType() {\r
- return (Class<Executable<Probcons>>) this.getClass();\r
+ public Class<Probcons> getType() {\r
+ return (Class<Probcons>) this.getClass();\r
}\r
}\r
\r
@SuppressWarnings("unchecked")\r
@Override\r
- public Class<Executable<Tcoffee>> getType() {\r
- return (Class<Executable<Tcoffee>>) this.getClass();\r
+ public Class<Tcoffee> getType() {\r
+ return (Class<Tcoffee>) this.getClass();\r
}\r
}\r
\r
package compbio.runner.psiblast;\r
\r
-import compbio.engine.client.Executable;\r
import compbio.engine.client.SkeletalExecutable;\r
import compbio.metadata.ResultNotAvailableException;\r
\r
}\r
\r
@Override\r
- public Class<Executable<PsiBlast>> getType() {\r
+ public Class<PsiBlast> getType() {\r
// TODO Auto-generated method stub\r
return null;\r
}\r
conn.close();\r
}\r
\r
+ static void clearStatTable() throws SQLException {\r
+ Connection conn = getDBConnection();\r
+ String query = "delete from exec_stat";\r
+ Statement st = conn.createStatement();\r
+ st.executeUpdate(query);\r
+ st.close();\r
+ conn.commit();\r
+ conn.close();\r
+ }\r
+\r
void insertData(Set<JobStat> jobstatus) throws SQLException {\r
log.info("Inserting " + jobstatus.size()\r
+ " new records into the statistics database");\r
}\r
}\r
public static void main(String[] args) throws SQLException {\r
+ // This is called from Ant cleanStatTable task\r
+ clearStatTable();\r
// new StatDB().createStatTable();\r
// insertData(null);\r
/*\r
package compbio.stat.servlet;\r
\r
import java.io.IOException;\r
+import java.io.PrintWriter;\r
import java.sql.SQLException;\r
import java.util.Date;\r
import java.util.Map;\r
try {\r
StatDB db = new StatDB();\r
Date earliestRec = db.getEarliestRecord();\r
+ if (earliestRec == null) {\r
+ PrintWriter writer = resp.getWriter();\r
+ writer.println("No statistics found in the database. Please allow "\r
+ + "at least one hour after a server start for the statistics "\r
+ + "collector to collect the data. ");\r
+ writer.close();\r
+ return;\r
+ }\r
Map<Date, Totals> monthlyTotals = StatCollection\r
.getStats(earliestRec);\r
req.setAttribute("stat", monthlyTotals);\r