manage standard local algorithms executions

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-analysis/EcologicalEngine@93133 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Gianpaolo Coro 2014-03-14 13:53:37 +00:00
parent a9579a12af
commit 678a68060d
4 changed files with 34 additions and 21 deletions

View File

@ -4,6 +4,7 @@ public enum INFRASTRUCTURE {
RAINY_CLOUD,
D4SCIENCE,
LOCAL
LOCAL,
EXTERNAL_WPS
}

View File

@ -24,7 +24,6 @@ public abstract class StandardLocalExternalAlgorithm implements Transducerer {
protected ResourceFactory resourceManager;
public LinkedHashMap<String, String> outputParameters = new LinkedHashMap<String, String>();
protected void addEnumerateInput(Object itemsList, String name, String description, String defaultvalue) {
inputs.add(new PrimitiveType(Enum.class.getName(), itemsList, PrimitiveTypes.ENUMERATED, name, description, defaultvalue));
}
@ -58,9 +57,16 @@ public abstract class StandardLocalExternalAlgorithm implements Transducerer {
public void compute() throws Exception {
AnalysisLogger.setLogger(config.getConfigPath() + AlgorithmConfiguration.defaultLoggerFile);
status = 0;
try {
process();
} catch (Exception e) {
e.printStackTrace();
AnalysisLogger.getLogger().debug("StandardLocalExternalAlgorithm->Error in processing");
throw e;
} finally {
status = 100;
}
}
protected void log(Object message) {
AnalysisLogger.getLogger().debug(message);

View File

@ -172,7 +172,10 @@ public class PeriodicityDetector {
power = MathFunctions.incrementPerc(power, (float)powers[i], counter);
counter++;
}
this.periodicityStrength=power;
if (this.periodicityStrength==-0.0)
this.periodicityStrength=0;
// reconstruct the F
double meanF = MathFunctions.mean(maxfrequencies);

View File

@ -177,6 +177,9 @@ public class DatabaseUtils {
for (int j=0;j<row.length;j++){
String preprow = row[j].replaceAll("^'", "").replaceAll("'$", "");
preprow=preprow.replace("'", ""+(char)96);
if (preprow.equalsIgnoreCase("NULL"))
sb.append(preprow);
else
sb.append("'"+preprow+"'");
if (j<row.length-1)
sb.append(",");