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:
parent
a9579a12af
commit
678a68060d
|
@ -4,6 +4,7 @@ public enum INFRASTRUCTURE {
|
||||||
|
|
||||||
RAINY_CLOUD,
|
RAINY_CLOUD,
|
||||||
D4SCIENCE,
|
D4SCIENCE,
|
||||||
LOCAL
|
LOCAL,
|
||||||
|
EXTERNAL_WPS
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,6 @@ public abstract class StandardLocalExternalAlgorithm implements Transducerer {
|
||||||
protected ResourceFactory resourceManager;
|
protected ResourceFactory resourceManager;
|
||||||
public LinkedHashMap<String, String> outputParameters = new LinkedHashMap<String, String>();
|
public LinkedHashMap<String, String> outputParameters = new LinkedHashMap<String, String>();
|
||||||
|
|
||||||
|
|
||||||
protected void addEnumerateInput(Object itemsList, String name, String description, String defaultvalue) {
|
protected void addEnumerateInput(Object itemsList, String name, String description, String defaultvalue) {
|
||||||
inputs.add(new PrimitiveType(Enum.class.getName(), itemsList, PrimitiveTypes.ENUMERATED, name, description, 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 {
|
public void compute() throws Exception {
|
||||||
AnalysisLogger.setLogger(config.getConfigPath() + AlgorithmConfiguration.defaultLoggerFile);
|
AnalysisLogger.setLogger(config.getConfigPath() + AlgorithmConfiguration.defaultLoggerFile);
|
||||||
status = 0;
|
status = 0;
|
||||||
|
try {
|
||||||
process();
|
process();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
AnalysisLogger.getLogger().debug("StandardLocalExternalAlgorithm->Error in processing");
|
||||||
|
throw e;
|
||||||
|
} finally {
|
||||||
status = 100;
|
status = 100;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected void log(Object message) {
|
protected void log(Object message) {
|
||||||
AnalysisLogger.getLogger().debug(message);
|
AnalysisLogger.getLogger().debug(message);
|
||||||
|
|
|
@ -172,7 +172,10 @@ public class PeriodicityDetector {
|
||||||
power = MathFunctions.incrementPerc(power, (float)powers[i], counter);
|
power = MathFunctions.incrementPerc(power, (float)powers[i], counter);
|
||||||
counter++;
|
counter++;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.periodicityStrength=power;
|
this.periodicityStrength=power;
|
||||||
|
if (this.periodicityStrength==-0.0)
|
||||||
|
this.periodicityStrength=0;
|
||||||
|
|
||||||
// reconstruct the F
|
// reconstruct the F
|
||||||
double meanF = MathFunctions.mean(maxfrequencies);
|
double meanF = MathFunctions.mean(maxfrequencies);
|
||||||
|
|
|
@ -177,6 +177,9 @@ public class DatabaseUtils {
|
||||||
for (int j=0;j<row.length;j++){
|
for (int j=0;j<row.length;j++){
|
||||||
String preprow = row[j].replaceAll("^'", "").replaceAll("'$", "");
|
String preprow = row[j].replaceAll("^'", "").replaceAll("'$", "");
|
||||||
preprow=preprow.replace("'", ""+(char)96);
|
preprow=preprow.replace("'", ""+(char)96);
|
||||||
|
if (preprow.equalsIgnoreCase("NULL"))
|
||||||
|
sb.append(preprow);
|
||||||
|
else
|
||||||
sb.append("'"+preprow+"'");
|
sb.append("'"+preprow+"'");
|
||||||
if (j<row.length-1)
|
if (j<row.length-1)
|
||||||
sb.append(",");
|
sb.append(",");
|
||||||
|
|
Loading…
Reference in New Issue