git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/application/perform-service@176734 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
ff1dcee328
commit
d84b1a45bd
12
pom.xml
12
pom.xml
|
@ -160,6 +160,18 @@
|
||||||
<version>1.6</version>
|
<version>1.6</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- STORAGE -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.gcube.contentmanagement</groupId>
|
||||||
|
<artifactId>storage-manager-core</artifactId>
|
||||||
|
<version>[2.0.0-SNAPSHOT, 3.0.0-SNAPSHOT)</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.gcube.contentmanagement</groupId>
|
||||||
|
<artifactId>storage-manager-wrapper</artifactId>
|
||||||
|
<version>[2.0.0-SNAPSHOT, 3.0.0-SNAPSHOT)</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- TEST -->
|
<!-- TEST -->
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
@ -5,15 +5,18 @@ import java.io.FileInputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
|
import java.util.Map.Entry;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.servlet.ServletContext;
|
import javax.servlet.ServletContext;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
import org.gcube.application.perform.service.engine.impl.ImportedTableManager;
|
import org.gcube.application.perform.service.engine.impl.PerformanceManagerImpl;
|
||||||
import org.gcube.application.perform.service.engine.impl.SchemaDefinition;
|
import org.gcube.application.perform.service.engine.impl.SchemaDefinition;
|
||||||
import org.gcube.application.perform.service.engine.model.InternalException;
|
import org.gcube.application.perform.service.engine.model.InternalException;
|
||||||
import org.gcube.application.perform.service.engine.model.importer.AnalysisType;
|
import org.gcube.application.perform.service.engine.model.importer.AnalysisType;
|
||||||
|
import org.gcube.application.perform.service.engine.model.importer.ImportedTable;
|
||||||
import org.gcube.smartgears.ContextProvider;
|
import org.gcube.smartgears.ContextProvider;
|
||||||
import org.gcube.smartgears.context.application.ApplicationContext;
|
import org.gcube.smartgears.context.application.ApplicationContext;
|
||||||
import org.gcube.smartgears.handlers.application.ApplicationLifecycleEvent.Start;
|
import org.gcube.smartgears.handlers.application.ApplicationLifecycleEvent.Start;
|
||||||
|
@ -39,6 +42,12 @@ public class PerformServiceLifecycleManager extends ApplicationLifecycleHandler
|
||||||
String webinfPath=ctx.getRealPath("/WEB-INF");
|
String webinfPath=ctx.getRealPath("/WEB-INF");
|
||||||
|
|
||||||
initSchema(webinfPath);
|
initSchema(webinfPath);
|
||||||
|
log.info("Loaded configuration schema : ");
|
||||||
|
for(Entry<AnalysisType,Set<ImportedTable>> entry:PerformanceManagerImpl.getAnalysisConfiguration().entrySet()) {
|
||||||
|
log.info("Tables registered for {} ",entry.getKey());
|
||||||
|
for(ImportedTable t:entry.getValue())
|
||||||
|
log.info("Table {} : {} [Analysis : {}]",t.getSchema().getRelatedDescription(),t.getTableName(),t.getSchema().getAnalysisEnabled());
|
||||||
|
}
|
||||||
|
|
||||||
}catch(Exception ex) {
|
}catch(Exception ex) {
|
||||||
throw new RuntimeException("Unable to init",ex);
|
throw new RuntimeException("Unable to init",ex);
|
||||||
|
@ -76,7 +85,9 @@ public class PerformServiceLifecycleManager extends ApplicationLifecycleHandler
|
||||||
fis=new FileInputStream(schemaFile);
|
fis=new FileInputStream(schemaFile);
|
||||||
props.load(fis);
|
props.load(fis);
|
||||||
SchemaDefinition schema=new SchemaDefinition(type,props);
|
SchemaDefinition schema=new SchemaDefinition(type,props);
|
||||||
ImportedTableManager.importSchema(schema,webinfPath);
|
PerformanceManagerImpl.importSchema(schema,webinfPath);
|
||||||
|
}catch(Throwable t) {
|
||||||
|
log.warn("SKPPING CONFIGURATION FILE "+schemaFile.getPath(),t);
|
||||||
}finally {
|
}finally {
|
||||||
if(fis!=null) fis.close();
|
if(fis!=null) fis.close();
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,5 +30,11 @@ public interface ServiceConstants {
|
||||||
|
|
||||||
public static interface Performance{
|
public static interface Performance{
|
||||||
public static final String PATH="performance";
|
public static final String PATH="performance";
|
||||||
|
public static final String FARM_ID_PARAMETER="farmid";
|
||||||
|
public static final String AREA_PARAMETER="area";
|
||||||
|
public static final String QUARTER_PARAMETER ="quarter";
|
||||||
|
public static final String SPECIES_ID_PARAMETER="speciesid";
|
||||||
|
public static final String BATCH_TYPE_PARAMETER="batch_type";
|
||||||
|
public static final String PERIOD_PARAMETER="period";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,17 @@
|
||||||
package org.gcube.application.perform.service.engine;
|
package org.gcube.application.perform.service.engine;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import org.gcube.application.perform.service.engine.model.CSVExportRequest;
|
import org.gcube.application.perform.service.engine.model.CSVExportRequest;
|
||||||
|
import org.gcube.application.perform.service.engine.model.InternalException;
|
||||||
|
import org.gcube.application.perform.service.engine.model.InvalidRequestException;
|
||||||
import org.gcube.application.perform.service.engine.model.importer.ImportRoutineDescriptor;
|
import org.gcube.application.perform.service.engine.model.importer.ImportRoutineDescriptor;
|
||||||
|
|
||||||
public interface PerformanceManager {
|
public interface PerformanceManager {
|
||||||
|
|
||||||
public String generateCSV(CSVExportRequest request);
|
public Map<String,String> generateCSV(CSVExportRequest request)throws SQLException, InvalidRequestException, InternalException, IOException;
|
||||||
|
|
||||||
public void loadOutputData(ImportRoutineDescriptor desc);
|
public void loadOutputData(ImportRoutineDescriptor desc)throws SQLException, InvalidRequestException, InternalException, IOException;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package org.gcube.application.perform.service.engine.impl;
|
package org.gcube.application.perform.service.engine.impl;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -15,9 +16,13 @@ public class ExportCSVQuery extends Query {
|
||||||
private String fieldList;
|
private String fieldList;
|
||||||
private String tablename;
|
private String tablename;
|
||||||
|
|
||||||
public ExportCSVQuery(String query, DBField[] fields) {
|
private CSVExportRequest theRequest;
|
||||||
|
private SchemaDefinition schema;
|
||||||
|
|
||||||
|
public ExportCSVQuery(String query, DBField[] fields, CSVExportRequest theRequest, SchemaDefinition schema) {
|
||||||
super(query, fields);
|
super(query, fields);
|
||||||
// TODO Auto-generated constructor stub
|
this.theRequest=theRequest;
|
||||||
|
this.schema=schema;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -25,12 +30,54 @@ public class ExportCSVQuery extends Query {
|
||||||
mappings.put(field, mapping);
|
mappings.put(field, mapping);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSelectionFilters(CSVExportRequest req) {
|
|
||||||
throw new RuntimeException("Impememt this");
|
|
||||||
}
|
|
||||||
|
|
||||||
private String getConditionString() {
|
private String getConditionString() {
|
||||||
throw new RuntimeException("Impememt this");
|
|
||||||
|
ArrayList<String> orGroups=new ArrayList<String>();
|
||||||
|
|
||||||
|
// AREA
|
||||||
|
if(theRequest.getAreas().size()>0) {
|
||||||
|
StringBuilder areas=new StringBuilder();
|
||||||
|
for(String area:theRequest.getAreas()) {
|
||||||
|
areas.append(String.format("%1$s= '%2$s' OR", schema.getAreaField(),area));
|
||||||
|
}
|
||||||
|
orGroups.add(areas.substring(0,areas.lastIndexOf("OR")));
|
||||||
|
}
|
||||||
|
|
||||||
|
// QUARTER
|
||||||
|
if(theRequest.getQuarters().size()>0) {
|
||||||
|
StringBuilder quarterString=new StringBuilder();
|
||||||
|
for(String q:theRequest.getQuarters()) {
|
||||||
|
quarterString.append(String.format("%1$s= '%2$s' OR", schema.getQuarterField(),q));
|
||||||
|
}
|
||||||
|
orGroups.add(quarterString.substring(0,quarterString.lastIndexOf("OR")));
|
||||||
|
}
|
||||||
|
|
||||||
|
// SPECIES ID
|
||||||
|
if(theRequest.getSpeciesIds().size()>0) {
|
||||||
|
StringBuilder speciesString=new StringBuilder();
|
||||||
|
for(String s:theRequest.getSpeciesIds()) {
|
||||||
|
speciesString.append(String.format("%1$s= '%2$s' OR", schema.getSpeciesField(),s));
|
||||||
|
}
|
||||||
|
orGroups.add(speciesString.substring(0,speciesString.lastIndexOf("OR")));
|
||||||
|
}
|
||||||
|
|
||||||
|
// PERIOD
|
||||||
|
if(theRequest.getPeriods().size()>0) {
|
||||||
|
StringBuilder periodString=new StringBuilder();
|
||||||
|
for(String p:theRequest.getPeriods()) {
|
||||||
|
periodString.append(String.format("%1$s= '%2$s' OR", schema.getPeriodField(),p));
|
||||||
|
}
|
||||||
|
orGroups.add(periodString.substring(0,periodString.lastIndexOf("OR")));
|
||||||
|
}
|
||||||
|
|
||||||
|
StringBuilder toReturn=new StringBuilder();
|
||||||
|
for(String orGroup:orGroups) {
|
||||||
|
toReturn.append(orGroup+ " AND ");
|
||||||
|
}
|
||||||
|
|
||||||
|
return toReturn.substring(0, toReturn.lastIndexOf("AND"));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTablename(String tablename) {
|
public void setTablename(String tablename) {
|
||||||
|
@ -47,8 +94,6 @@ public class ExportCSVQuery extends Query {
|
||||||
@Override
|
@Override
|
||||||
public String getQuery() {
|
public String getQuery() {
|
||||||
|
|
||||||
StringBuilder q=new StringBuilder("SELECT ");
|
|
||||||
|
|
||||||
String selectedFields=fieldList;
|
String selectedFields=fieldList;
|
||||||
|
|
||||||
for(Entry<String,Map<String,String>> mapping:mappings.entrySet()) {
|
for(Entry<String,Map<String,String>> mapping:mappings.entrySet()) {
|
||||||
|
|
|
@ -1,173 +0,0 @@
|
||||||
package org.gcube.application.perform.service.engine.impl;
|
|
||||||
|
|
||||||
import java.io.FileReader;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.Reader;
|
|
||||||
import java.sql.Connection;
|
|
||||||
import java.sql.PreparedStatement;
|
|
||||||
import java.sql.SQLException;
|
|
||||||
import java.sql.Types;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Map.Entry;
|
|
||||||
|
|
||||||
import javax.servlet.ServletContext;
|
|
||||||
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
import org.apache.commons.csv.CSVFormat;
|
|
||||||
import org.apache.commons.csv.CSVParser;
|
|
||||||
import org.apache.commons.csv.CSVRecord;
|
|
||||||
import org.gcube.application.perform.service.engine.DataBaseManager;
|
|
||||||
import org.gcube.application.perform.service.engine.dm.DMUtils;
|
|
||||||
import org.gcube.application.perform.service.engine.model.CSVExportRequest;
|
|
||||||
import org.gcube.application.perform.service.engine.model.DBField;
|
|
||||||
import org.gcube.application.perform.service.engine.model.DBQueryDescriptor;
|
|
||||||
import org.gcube.application.perform.service.engine.model.InternalException;
|
|
||||||
import org.gcube.application.perform.service.engine.model.InvalidRequestException;
|
|
||||||
import org.gcube.application.perform.service.engine.model.importer.AnalysisType;
|
|
||||||
import org.gcube.application.perform.service.engine.model.importer.ImportRoutineDescriptor;
|
|
||||||
import org.gcube.application.perform.service.engine.model.importer.ImportedTable;
|
|
||||||
import org.gcube.data.analysis.dataminermanagercl.shared.data.computations.ComputationId;
|
|
||||||
import org.gcube.smartgears.ContextProvider;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
public class ImportedTableManager {
|
|
||||||
|
|
||||||
private static final Logger log= LoggerFactory.getLogger(ImportedTableManager.class);
|
|
||||||
|
|
||||||
// private static HashMap<String,ImportedTable> tables;
|
|
||||||
|
|
||||||
private static Map<AnalysisType,Set<ImportedTable>> analysisConfiguration=new HashMap<>();
|
|
||||||
|
|
||||||
public static void importSchema(SchemaDefinition schema,String csvBasePath) throws IOException, SQLException, InternalException {
|
|
||||||
log.info("Loading schema {} ",schema);
|
|
||||||
|
|
||||||
String actualCSVPath=csvBasePath+"/"+schema.getCsvPath();
|
|
||||||
|
|
||||||
log.debug("CSV path : {} ",actualCSVPath);
|
|
||||||
|
|
||||||
ArrayList<DBField> csvFieldsDefinition=getCSVFieldsDefinition(actualCSVPath);
|
|
||||||
|
|
||||||
AnalysisType analysisType=schema.getRelatedAnalysis();
|
|
||||||
|
|
||||||
String tablename=(analysisType.getId()+schema.getRelatedDescription()).toLowerCase().replaceAll(" ", "_");
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ImportedTable table=new ImportedTable(
|
|
||||||
tablename, new DBField(Types.BIGINT, schema.getRoutineIdFieldName()),
|
|
||||||
schema.getFarmUUIDField(),
|
|
||||||
schema.getAssociationUUIDField(),
|
|
||||||
schema.getCompanyUUIDField(),
|
|
||||||
schema.getBatchUUIDField(),
|
|
||||||
csvFieldsDefinition);
|
|
||||||
|
|
||||||
table.create();
|
|
||||||
|
|
||||||
|
|
||||||
if(!analysisConfiguration.containsKey(analysisType))
|
|
||||||
analysisConfiguration.put(schema.getRelatedAnalysis(), new HashSet<>());
|
|
||||||
analysisConfiguration.get(schema.getRelatedAnalysis()).add(table);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public Set<ImportedTable> getAnalysisSet(CSVExportRequest request){
|
|
||||||
throw new RuntimeException("Implement ME");
|
|
||||||
}
|
|
||||||
|
|
||||||
public void loadImportedData(ImportRoutineDescriptor desc) throws IOException, SQLException, InternalException {
|
|
||||||
log.info("Importing output for {} ",desc);
|
|
||||||
ComputationId computation=DMUtils.getComputation(desc);
|
|
||||||
Map<String,String> outputs=DMUtils.getOutputFiles(computation);
|
|
||||||
Connection conn=DataBaseManager.get().getConnection();
|
|
||||||
try {
|
|
||||||
for(Entry<String,String> entry:outputs.entrySet()) {
|
|
||||||
parse(entry.getValue(),entry.getKey(),desc,conn);
|
|
||||||
}
|
|
||||||
log.info("IMPORTED ALL FILES for {} ",desc);
|
|
||||||
conn.commit();
|
|
||||||
}finally {
|
|
||||||
conn.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private static final long parse(String path, String description, ImportRoutineDescriptor routine, Connection conn) throws IOException, SQLException, InvalidRequestException {
|
|
||||||
Reader in = new FileReader(path);
|
|
||||||
CSVParser parser= CSVFormat.DEFAULT.withFirstRecordAsHeader().parse(in);
|
|
||||||
|
|
||||||
AnalysisType type=new AnalysisType(routine);
|
|
||||||
|
|
||||||
try {
|
|
||||||
log.debug("Parsing file {} : {} ",description,path);
|
|
||||||
// Extract CSV Schema
|
|
||||||
ArrayList<String> csvSchema=new ArrayList<String>();
|
|
||||||
for(Entry<String,Integer> entry : parser.getHeaderMap().entrySet()) {
|
|
||||||
csvSchema.add(entry.getValue(), entry.getKey());
|
|
||||||
}
|
|
||||||
|
|
||||||
log.debug("CSV Schema is {} ",csvSchema);
|
|
||||||
|
|
||||||
long counter=0l;
|
|
||||||
//Get the right table
|
|
||||||
for(ImportedTable table:analysisConfiguration.get(type)) {
|
|
||||||
if(table.matchesSchema(csvSchema)) {
|
|
||||||
log.debug("Mathing table is {} ",table.getTableName());
|
|
||||||
Query query=table.getInsertQuery();
|
|
||||||
PreparedStatement psInsert=query.prepare(conn);
|
|
||||||
log.debug("Reading csvLines");
|
|
||||||
for(CSVRecord record:parser) {
|
|
||||||
DBQueryDescriptor desc=table.getSetRow(record.toMap(), routine.getId());
|
|
||||||
query.fill(psInsert, desc);
|
|
||||||
counter+=psInsert.executeUpdate();
|
|
||||||
}
|
|
||||||
log.debug("Inserted {} lines into {} for routine {} [FARM ID {}]",counter,table.getTableName(),routine.getId(),routine.getFarmId());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return counter;
|
|
||||||
}finally {
|
|
||||||
parser.close();
|
|
||||||
in.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// ************************** SCHEMA PARSING
|
|
||||||
private static final String FLOAT_REGEX="\\d*\\.\\d*";
|
|
||||||
private static final String INTEGER_REGEX="\\d*";
|
|
||||||
|
|
||||||
|
|
||||||
private static ArrayList<DBField> getCSVFieldsDefinition(String csvFile) throws IOException{
|
|
||||||
|
|
||||||
Reader in = null;
|
|
||||||
CSVParser parser= null;
|
|
||||||
try {
|
|
||||||
in=new FileReader(csvFile);
|
|
||||||
parser=CSVFormat.DEFAULT.withFirstRecordAsHeader().parse(in);
|
|
||||||
Map<String,Integer> headers=parser.getHeaderMap();
|
|
||||||
ArrayList<DBField> toReturn = new ArrayList<>(headers.size());
|
|
||||||
|
|
||||||
CSVRecord record=parser.getRecords().get(0);
|
|
||||||
|
|
||||||
for(Entry<String,Integer> header:headers.entrySet()) {
|
|
||||||
String value=record.get(header.getKey());
|
|
||||||
int type=Types.VARCHAR;
|
|
||||||
if(value.matches(FLOAT_REGEX)) type=Types.REAL;
|
|
||||||
else if(value.matches(INTEGER_REGEX)) type=Types.BIGINT;
|
|
||||||
toReturn.add(new DBField(type, header.getKey()));
|
|
||||||
}
|
|
||||||
return toReturn;
|
|
||||||
|
|
||||||
}finally{
|
|
||||||
if(in!=null) in.close();
|
|
||||||
if(parser!=null) parser.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,46 +1,200 @@
|
||||||
package org.gcube.application.perform.service.engine.impl;
|
package org.gcube.application.perform.service.engine.impl;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileReader;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.Reader;
|
||||||
|
import java.sql.Connection;
|
||||||
|
import java.sql.PreparedStatement;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
import java.sql.Types;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Map.Entry;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
import org.apache.commons.csv.CSVFormat;
|
||||||
|
import org.apache.commons.csv.CSVParser;
|
||||||
|
import org.apache.commons.csv.CSVRecord;
|
||||||
|
import org.gcube.application.perform.service.engine.DataBaseManager;
|
||||||
import org.gcube.application.perform.service.engine.PerformanceManager;
|
import org.gcube.application.perform.service.engine.PerformanceManager;
|
||||||
import org.gcube.application.perform.service.engine.dm.DMUtils;
|
import org.gcube.application.perform.service.engine.dm.DMUtils;
|
||||||
import org.gcube.application.perform.service.engine.model.CSVExportRequest;
|
import org.gcube.application.perform.service.engine.model.CSVExportRequest;
|
||||||
|
import org.gcube.application.perform.service.engine.model.DBField;
|
||||||
|
import org.gcube.application.perform.service.engine.model.DBQueryDescriptor;
|
||||||
|
import org.gcube.application.perform.service.engine.model.InternalException;
|
||||||
|
import org.gcube.application.perform.service.engine.model.InvalidRequestException;
|
||||||
|
import org.gcube.application.perform.service.engine.model.importer.AnalysisType;
|
||||||
import org.gcube.application.perform.service.engine.model.importer.ImportRoutineDescriptor;
|
import org.gcube.application.perform.service.engine.model.importer.ImportRoutineDescriptor;
|
||||||
|
import org.gcube.application.perform.service.engine.model.importer.ImportedTable;
|
||||||
|
import org.gcube.application.perform.service.engine.utils.StorageUtils;
|
||||||
import org.gcube.data.analysis.dataminermanagercl.shared.data.computations.ComputationId;
|
import org.gcube.data.analysis.dataminermanagercl.shared.data.computations.ComputationId;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
public class PerformanceManagerImpl implements PerformanceManager{
|
public class PerformanceManagerImpl implements PerformanceManager{
|
||||||
|
|
||||||
|
|
||||||
|
private static final Logger log= LoggerFactory.getLogger(PerformanceManagerImpl.class);
|
||||||
|
|
||||||
|
|
||||||
|
private static Map<AnalysisType,Set<ImportedTable>> analysisConfiguration=new HashMap<>();
|
||||||
|
|
||||||
@Override
|
public static Map<AnalysisType, Set<ImportedTable>> getAnalysisConfiguration() {
|
||||||
public String generateCSV(CSVExportRequest request) {
|
return analysisConfiguration;
|
||||||
throw new RuntimeException("Not yet implemented");
|
|
||||||
|
|
||||||
|
|
||||||
// request.type -> set of tables
|
|
||||||
// for each table -> get CSV (farmid, selection)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void loadOutputData(ImportRoutineDescriptor desc) {
|
public Map<String, String> generateCSV(CSVExportRequest request) throws InvalidRequestException, SQLException, InternalException, IOException {
|
||||||
// TODO Auto-generated method stub
|
log.trace("Serving {} ",request);
|
||||||
ComputationId id= DMUtils.getComputation(desc);
|
HashMap<String,String> toReturn=new HashMap<>();
|
||||||
Map<String,String> outputFiles=DMUtils.getOutputFiles(id);
|
Set<ImportedTable> tables=getAnalysisSet(request);
|
||||||
|
log.debug("Found {} tables in configuration",tables.size());
|
||||||
|
for(ImportedTable t:tables) {
|
||||||
|
SchemaDefinition schema=t.getSchema();
|
||||||
|
if(schema.getAnalysisEnabled()) {
|
||||||
|
log.debug("Exporting {} : {} ",schema.getRelatedDescription(),t.getTableName());
|
||||||
|
File csv=t.exportCSV(request);
|
||||||
|
String storageId=StorageUtils.putOntoStorage(csv);
|
||||||
|
|
||||||
|
toReturn.put(t.getSchema().getRelatedDescription(), storageId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return toReturn;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void loadOutputData(ImportRoutineDescriptor desc) throws IOException, SQLException, InternalException {
|
||||||
|
log.info("Importing output for {} ",desc);
|
||||||
|
ComputationId computation=DMUtils.getComputation(desc);
|
||||||
|
Map<String,String> outputs=DMUtils.getOutputFiles(computation);
|
||||||
|
Connection conn=DataBaseManager.get().getConnection();
|
||||||
|
try {
|
||||||
|
for(Entry<String,String> entry:outputs.entrySet()) {
|
||||||
|
parse(entry.getValue(),entry.getKey(),desc,conn);
|
||||||
|
}
|
||||||
|
log.info("IMPORTED ALL FILES for {} ",desc);
|
||||||
|
conn.commit();
|
||||||
|
}finally {
|
||||||
|
conn.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static void importSchema(SchemaDefinition schema,String csvBasePath) throws IOException, SQLException, InternalException {
|
||||||
|
log.info("Loading schema {} ",schema);
|
||||||
|
|
||||||
|
String actualCSVPath=csvBasePath+"/"+schema.getCsvPath();
|
||||||
|
|
||||||
|
log.debug("CSV path : {} ",actualCSVPath);
|
||||||
|
|
||||||
|
ArrayList<DBField> csvFieldsDefinition=getCSVFieldsDefinition(actualCSVPath);
|
||||||
|
|
||||||
|
AnalysisType analysisType=schema.getRelatedAnalysis();
|
||||||
|
|
||||||
|
String tablename=(analysisType.getId()+schema.getRelatedDescription()).toLowerCase().replaceAll(" ", "_");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ImportedTable table=new ImportedTable(
|
||||||
|
tablename, schema,
|
||||||
|
csvFieldsDefinition);
|
||||||
|
|
||||||
|
table.create();
|
||||||
|
|
||||||
|
|
||||||
|
if(!analysisConfiguration.containsKey(analysisType))
|
||||||
|
analysisConfiguration.put(schema.getRelatedAnalysis(), new HashSet<>());
|
||||||
|
analysisConfiguration.get(schema.getRelatedAnalysis()).add(table);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static Set<ImportedTable> getAnalysisSet(CSVExportRequest request) throws InvalidRequestException{
|
||||||
|
AnalysisType type=request.getType();
|
||||||
|
if(!analysisConfiguration.containsKey(type))
|
||||||
|
throw new InvalidRequestException("Analysis Configuration not found for "+type);
|
||||||
|
return analysisConfiguration.get(request.getType());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private static final long parse(String path, String description, ImportRoutineDescriptor routine, Connection conn) throws IOException, SQLException, InvalidRequestException {
|
||||||
|
Reader in = new FileReader(path);
|
||||||
|
CSVParser parser= CSVFormat.DEFAULT.withFirstRecordAsHeader().parse(in);
|
||||||
|
|
||||||
|
AnalysisType type=new AnalysisType(routine);
|
||||||
|
|
||||||
|
try {
|
||||||
|
log.debug("Parsing file {} : {} ",description,path);
|
||||||
|
// Extract CSV Schema
|
||||||
|
ArrayList<String> csvSchema=new ArrayList<String>();
|
||||||
|
for(Entry<String,Integer> entry : parser.getHeaderMap().entrySet()) {
|
||||||
|
csvSchema.add(entry.getValue(), entry.getKey());
|
||||||
|
}
|
||||||
|
|
||||||
|
log.debug("CSV Schema is {} ",csvSchema);
|
||||||
|
|
||||||
|
long counter=0l;
|
||||||
|
//Get the right table
|
||||||
|
for(ImportedTable table:analysisConfiguration.get(type)) {
|
||||||
|
if(table.matchesSchema(csvSchema)) {
|
||||||
|
log.debug("Matching table is {} ",table.getTableName());
|
||||||
|
Query query=table.getInsertQuery();
|
||||||
|
PreparedStatement psInsert=query.prepare(conn);
|
||||||
|
log.debug("Reading csvLines");
|
||||||
|
for(CSVRecord record:parser) {
|
||||||
|
DBQueryDescriptor desc=table.getSetRow(record.toMap(), routine.getId());
|
||||||
|
query.fill(psInsert, desc);
|
||||||
|
counter+=psInsert.executeUpdate();
|
||||||
|
}
|
||||||
|
log.debug("Inserted {} lines into {} for routine {} [FARM ID {}]",counter,table.getTableName(),routine.getId(),routine.getFarmId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return counter;
|
||||||
|
}finally {
|
||||||
|
parser.close();
|
||||||
|
in.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************** SCHEMA PARSING
|
||||||
|
private static final String FLOAT_REGEX="\\d*\\.\\d*";
|
||||||
|
private static final String INTEGER_REGEX="\\d*";
|
||||||
|
|
||||||
|
|
||||||
|
private static ArrayList<DBField> getCSVFieldsDefinition(String csvFile) throws IOException{
|
||||||
|
|
||||||
|
Reader in = null;
|
||||||
|
CSVParser parser= null;
|
||||||
|
try {
|
||||||
|
in=new FileReader(csvFile);
|
||||||
|
parser=CSVFormat.DEFAULT.withFirstRecordAsHeader().parse(in);
|
||||||
|
Map<String,Integer> headers=parser.getHeaderMap();
|
||||||
|
ArrayList<DBField> toReturn = new ArrayList<>(headers.size());
|
||||||
|
|
||||||
|
CSVRecord record=parser.getRecords().get(0);
|
||||||
|
|
||||||
|
for(Entry<String,Integer> header:headers.entrySet()) {
|
||||||
|
String value=record.get(header.getKey());
|
||||||
|
int type=Types.VARCHAR;
|
||||||
|
if(value.matches(FLOAT_REGEX)) type=Types.REAL;
|
||||||
|
else if(value.matches(INTEGER_REGEX)) type=Types.BIGINT;
|
||||||
|
toReturn.add(new DBField(type, header.getKey()));
|
||||||
|
}
|
||||||
|
return toReturn;
|
||||||
|
|
||||||
|
}finally{
|
||||||
|
if(in!=null) in.close();
|
||||||
|
if(parser!=null) parser.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,8 @@ public class SchemaDefinition {
|
||||||
private static final String COMPANY="company";
|
private static final String COMPANY="company";
|
||||||
private static final String ROUTINE_ID="routine";
|
private static final String ROUTINE_ID="routine";
|
||||||
private static final String CSV="csv";
|
private static final String CSV="csv";
|
||||||
|
private static final String ENABLE_ANALYSIS="enable_analysis";
|
||||||
|
|
||||||
|
|
||||||
public String getRelatedDescription() {
|
public String getRelatedDescription() {
|
||||||
return relatedDescription;
|
return relatedDescription;
|
||||||
|
@ -40,6 +42,28 @@ public class SchemaDefinition {
|
||||||
public void setCsvPath(String csvPath) {
|
public void setCsvPath(String csvPath) {
|
||||||
this.csvPath = csvPath;
|
this.csvPath = csvPath;
|
||||||
}
|
}
|
||||||
|
public Boolean getAnalysisEnabled() {
|
||||||
|
return analysisEnabled;
|
||||||
|
}
|
||||||
|
public String getRoutineIdFieldName() {
|
||||||
|
return routineIdFieldName;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getAreaField() {
|
||||||
|
return areaField;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPeriodField() {
|
||||||
|
return periodField;
|
||||||
|
}
|
||||||
|
public String getQuarterField() {
|
||||||
|
return quarterField;
|
||||||
|
}
|
||||||
|
public String getSpeciesField() {
|
||||||
|
return speciesField;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public SchemaDefinition(AnalysisType relatedAnalysis, Properties props) {
|
public SchemaDefinition(AnalysisType relatedAnalysis, Properties props) {
|
||||||
super();
|
super();
|
||||||
|
@ -51,7 +75,14 @@ public class SchemaDefinition {
|
||||||
this.batchUUIDField = props.getProperty(BATCH);
|
this.batchUUIDField = props.getProperty(BATCH);
|
||||||
this.companyUUIDField = props.getProperty(COMPANY);
|
this.companyUUIDField = props.getProperty(COMPANY);
|
||||||
this.routineIdFieldName=props.getProperty(ROUTINE_ID);
|
this.routineIdFieldName=props.getProperty(ROUTINE_ID);
|
||||||
|
this.analysisEnabled=Boolean.parseBoolean(props.getProperty(ENABLE_ANALYSIS, "false"));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private String relatedDescription;
|
private String relatedDescription;
|
||||||
private AnalysisType relatedAnalysis;
|
private AnalysisType relatedAnalysis;
|
||||||
|
|
||||||
|
@ -61,10 +92,12 @@ public class SchemaDefinition {
|
||||||
private String batchUUIDField;
|
private String batchUUIDField;
|
||||||
private String companyUUIDField;
|
private String companyUUIDField;
|
||||||
|
|
||||||
|
private Boolean analysisEnabled;
|
||||||
|
|
||||||
private String routineIdFieldName;
|
private String routineIdFieldName;
|
||||||
|
|
||||||
public String getRoutineIdFieldName() {
|
private String areaField="area";
|
||||||
return routineIdFieldName;
|
private String periodField="period";
|
||||||
}
|
private String quarterField="quarter";
|
||||||
|
private String speciesField="species";
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package org.gcube.application.perform.service.engine.model;
|
package org.gcube.application.perform.service.engine.model;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import org.gcube.application.perform.service.engine.model.importer.AnalysisType;
|
import org.gcube.application.perform.service.engine.model.importer.AnalysisType;
|
||||||
|
@ -7,7 +9,32 @@ import org.gcube.application.perform.service.engine.model.importer.AnalysisType;
|
||||||
public class CSVExportRequest {
|
public class CSVExportRequest {
|
||||||
|
|
||||||
private AnalysisType type;
|
private AnalysisType type;
|
||||||
private Set<Long> farmIds;
|
private Set<Long> farmIds=new HashSet<>();
|
||||||
|
|
||||||
|
private Set<String> quarters=new HashSet<>();
|
||||||
|
private Set<String> areas=new HashSet<>();
|
||||||
|
private Set<String> speciesIds=new HashSet<>();
|
||||||
|
private Set<String> periods=new HashSet<>();
|
||||||
|
|
||||||
|
public Set<String> getAreas() {
|
||||||
|
return areas;
|
||||||
|
}
|
||||||
|
public Set<String> getQuarters() {
|
||||||
|
return quarters;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Set<String> getPeriods() {
|
||||||
|
return periods;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Set<String> getSpeciesIds() {
|
||||||
|
return speciesIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CSVExportRequest(AnalysisType type) {
|
||||||
|
super();
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
public AnalysisType getType() {
|
public AnalysisType getType() {
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
@ -17,8 +44,35 @@ public class CSVExportRequest {
|
||||||
public Set<Long> getFarmIds() {
|
public Set<Long> getFarmIds() {
|
||||||
return farmIds;
|
return farmIds;
|
||||||
}
|
}
|
||||||
public void setFarmIds(Set<Long> farmIds) {
|
public CSVExportRequest setFarmIds(Set<Long> farmIds) {
|
||||||
this.farmIds = farmIds;
|
this.farmIds = farmIds;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CSVExportRequest addFarmId(Long farmid) {
|
||||||
|
farmIds.add(farmid);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CSVExportRequest addAreas(Collection<String> toAdd) {
|
||||||
|
areas.addAll(toAdd);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CSVExportRequest addQuarters(Collection<String> toAdd) {
|
||||||
|
quarters.addAll(toAdd);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CSVExportRequest addSpecies(Collection<String> toAdd) {
|
||||||
|
speciesIds.addAll(toAdd);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public CSVExportRequest addPeriods(Collection<String> toAdd) {
|
||||||
|
periods.addAll(toAdd);
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,7 @@ import org.gcube.application.perform.service.engine.impl.ExportCSVQuery;
|
||||||
import org.gcube.application.perform.service.engine.impl.ImporterImpl;
|
import org.gcube.application.perform.service.engine.impl.ImporterImpl;
|
||||||
import org.gcube.application.perform.service.engine.impl.Queries;
|
import org.gcube.application.perform.service.engine.impl.Queries;
|
||||||
import org.gcube.application.perform.service.engine.impl.Query;
|
import org.gcube.application.perform.service.engine.impl.Query;
|
||||||
|
import org.gcube.application.perform.service.engine.impl.SchemaDefinition;
|
||||||
import org.gcube.application.perform.service.engine.model.CSVExportRequest;
|
import org.gcube.application.perform.service.engine.model.CSVExportRequest;
|
||||||
import org.gcube.application.perform.service.engine.model.DBField;
|
import org.gcube.application.perform.service.engine.model.DBField;
|
||||||
import org.gcube.application.perform.service.engine.model.DBQueryDescriptor;
|
import org.gcube.application.perform.service.engine.model.DBQueryDescriptor;
|
||||||
|
@ -43,27 +44,23 @@ public class ImportedTable {
|
||||||
private ArrayList<String> csvFields; // Fields actually expected in csv
|
private ArrayList<String> csvFields; // Fields actually expected in csv
|
||||||
|
|
||||||
private String tablename;
|
private String tablename;
|
||||||
private DBField routineIdField;
|
// private DBField routineIdField;
|
||||||
|
|
||||||
private String farmUUIDField;
|
|
||||||
private String associationUUIDField;
|
|
||||||
private String companyUUIDField;
|
|
||||||
private String batchUUIDField;
|
|
||||||
|
|
||||||
|
// private String farmUUIDField;
|
||||||
|
// private String associationUUIDField;
|
||||||
|
// private String companyUUIDField;
|
||||||
|
// private String batchUUIDField;
|
||||||
|
// private Boolean analysisEnabled;
|
||||||
|
|
||||||
private Query insertQuery;
|
private Query insertQuery;
|
||||||
|
|
||||||
|
private SchemaDefinition schema;
|
||||||
|
|
||||||
public ImportedTable(String tablename, DBField routineIdField, String farmUUIDField, String associationUUIDField,
|
|
||||||
String companyUUIDField, String batchUUIDField, ArrayList<DBField> csvFieldsDefinition) {
|
public ImportedTable(String tablename, SchemaDefinition schema, ArrayList<DBField> csvFieldsDefinition) {
|
||||||
super();
|
super();
|
||||||
|
this.schema=schema;
|
||||||
this.tablename=tablename;
|
this.tablename=tablename;
|
||||||
this.routineIdField = routineIdField;
|
|
||||||
this.farmUUIDField = farmUUIDField;
|
|
||||||
this.associationUUIDField = associationUUIDField;
|
|
||||||
this.companyUUIDField = companyUUIDField;
|
|
||||||
this.batchUUIDField = batchUUIDField;
|
|
||||||
|
|
||||||
// init
|
// init
|
||||||
|
|
||||||
csvFields=new ArrayList<>();
|
csvFields=new ArrayList<>();
|
||||||
|
@ -79,6 +76,11 @@ public class ImportedTable {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private DBField getRoutineIdField() {
|
||||||
|
return new DBField(Types.BIGINT,schema.getRoutineIdFieldName());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private Query prepareInsertionQuery() {
|
private Query prepareInsertionQuery() {
|
||||||
|
|
||||||
StringBuilder fieldList=new StringBuilder();
|
StringBuilder fieldList=new StringBuilder();
|
||||||
|
@ -92,11 +94,11 @@ public class ImportedTable {
|
||||||
valueString.append("?,");
|
valueString.append("?,");
|
||||||
}
|
}
|
||||||
|
|
||||||
queryFields.add(routineIdField);
|
queryFields.add(getRoutineIdField());
|
||||||
|
|
||||||
|
|
||||||
String insertSQL= String.format("INSERT INTO %1$s (%2$s) VALUES (%3$s)", tablename,
|
String insertSQL= String.format("INSERT INTO %1$s (%2$s) VALUES (%3$s)", tablename,
|
||||||
fieldList+routineIdField.getFieldName(),valueString+"?");
|
fieldList+getRoutineIdField().getFieldName(),valueString+"?");
|
||||||
|
|
||||||
|
|
||||||
return new Query(insertSQL, queryFields.toArray(new DBField[queryFields.size()]));
|
return new Query(insertSQL, queryFields.toArray(new DBField[queryFields.size()]));
|
||||||
|
@ -120,7 +122,7 @@ public class ImportedTable {
|
||||||
|
|
||||||
String standardDefinitions=
|
String standardDefinitions=
|
||||||
String.format( "%1$s bigint,"
|
String.format( "%1$s bigint,"
|
||||||
+ "FOREIGN KEY (%1$s) REFERENCES "+ImportRoutine.TABLE+"("+ImportRoutine.ID+")",routineIdField.getFieldName());
|
+ "FOREIGN KEY (%1$s) REFERENCES "+ImportRoutine.TABLE+"("+ImportRoutine.ID+")",getRoutineIdField().getFieldName());
|
||||||
|
|
||||||
String stmt=String.format("CREATE TABLE IF NOT EXISTS %1$s (%2$s, %3$s)",
|
String stmt=String.format("CREATE TABLE IF NOT EXISTS %1$s (%2$s, %3$s)",
|
||||||
tablename,fieldDefinitions.substring(0,fieldDefinitions.lastIndexOf(",")),standardDefinitions);
|
tablename,fieldDefinitions.substring(0,fieldDefinitions.lastIndexOf(",")),standardDefinitions);
|
||||||
|
@ -163,7 +165,7 @@ public class ImportedTable {
|
||||||
desc.add(toSetField, value);
|
desc.add(toSetField, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
desc.add(routineIdField, routineId);
|
desc.add(getRoutineIdField(), routineId);
|
||||||
return desc;
|
return desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -174,12 +176,6 @@ public class ImportedTable {
|
||||||
return tablename;
|
return tablename;
|
||||||
}
|
}
|
||||||
|
|
||||||
private ExportCSVQuery getExportQuery() {
|
|
||||||
ExportCSVQuery query=new ExportCSVQuery("", null);
|
|
||||||
query.setFieldList(labels.values());
|
|
||||||
query.setTablename(tablename);
|
|
||||||
return query;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public File exportCSV(CSVExportRequest request) throws InvalidRequestException, SQLException, InternalException, IOException {
|
public File exportCSV(CSVExportRequest request) throws InvalidRequestException, SQLException, InternalException, IOException {
|
||||||
|
@ -191,8 +187,9 @@ public class ImportedTable {
|
||||||
FileWriter writer=null;
|
FileWriter writer=null;
|
||||||
CSVPrinter printer=null;
|
CSVPrinter printer=null;
|
||||||
try {
|
try {
|
||||||
ExportCSVQuery exportQuery=getExportQuery();
|
ExportCSVQuery exportQuery=new ExportCSVQuery("",null,request,schema);
|
||||||
|
exportQuery.setFieldList(labels.values());
|
||||||
|
exportQuery.setTablename(tablename);
|
||||||
|
|
||||||
Map<String,String> farmMapping=new HashMap<>();
|
Map<String,String> farmMapping=new HashMap<>();
|
||||||
Map<String,String> companyMapping=new HashMap<>();
|
Map<String,String> companyMapping=new HashMap<>();
|
||||||
|
@ -219,12 +216,11 @@ public class ImportedTable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
exportQuery.setMapping(associationUUIDField, associationMapping);
|
exportQuery.setMapping(schema.getAssociationUUIDField(), associationMapping);
|
||||||
exportQuery.setMapping(companyUUIDField, companyMapping);
|
exportQuery.setMapping(schema.getCompanyUUIDField(), companyMapping);
|
||||||
exportQuery.setMapping(farmUUIDField, farmMapping);
|
exportQuery.setMapping(schema.getFarmUUIDField(), farmMapping);
|
||||||
exportQuery.setMapping(batchUUIDField, batchMapping);
|
exportQuery.setMapping(schema.getBatchUUIDField(), batchMapping);
|
||||||
|
|
||||||
exportQuery.setSelectionFilters(request);
|
|
||||||
|
|
||||||
log.trace("Performing actual query towards {} ",tablename);
|
log.trace("Performing actual query towards {} ",tablename);
|
||||||
|
|
||||||
|
@ -256,8 +252,11 @@ public class ImportedTable {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public SchemaDefinition getSchema() {
|
||||||
|
return schema;
|
||||||
|
}
|
||||||
|
|
||||||
private String escapeString(String fieldname) {
|
private String escapeString(String fieldname) {
|
||||||
return fieldname;
|
return fieldname;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
package org.gcube.application.perform.service.engine.utils;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.FileNotFoundException;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import org.gcube.application.perform.service.engine.impl.PerformanceManagerImpl;
|
||||||
|
import org.gcube.contentmanagement.blobstorage.service.IClient;
|
||||||
|
import org.gcube.contentmanagement.blobstorage.transport.backend.RemoteBackendException;
|
||||||
|
import org.gcube.contentmanager.storageclient.wrapper.AccessType;
|
||||||
|
import org.gcube.contentmanager.storageclient.wrapper.MemoryType;
|
||||||
|
import org.gcube.contentmanager.storageclient.wrapper.StorageClient;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
public class StorageUtils {
|
||||||
|
|
||||||
|
private static final Logger log= LoggerFactory.getLogger(StorageUtils.class);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static final IClient getClient(){
|
||||||
|
return new StorageClient("data-transfer", "data-transfer-library", ScopeUtils.getCaller(), AccessType.SHARED, MemoryType.VOLATILE).getClient();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//return Id
|
||||||
|
public static final String putOntoStorage(File source) throws RemoteBackendException, FileNotFoundException{
|
||||||
|
IClient client=getClient();
|
||||||
|
log.debug("Uploading local file "+source.getAbsolutePath());
|
||||||
|
return client.put(true).LFile(new FileInputStream(source)).RFile(UUID.randomUUID().toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -1,6 +1,10 @@
|
||||||
package org.gcube.application.perform.service.rest;
|
package org.gcube.application.perform.service.rest;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import javax.ws.rs.WebApplicationException;
|
import javax.ws.rs.WebApplicationException;
|
||||||
|
import javax.ws.rs.core.MultivaluedMap;
|
||||||
import javax.ws.rs.core.Response;
|
import javax.ws.rs.core.Response;
|
||||||
|
|
||||||
public class InterfaceCommons {
|
public class InterfaceCommons {
|
||||||
|
@ -10,5 +14,10 @@ public class InterfaceCommons {
|
||||||
throw new WebApplicationException(String.format("Parameter %1$s is mandatory",name),Response.Status.BAD_REQUEST);
|
throw new WebApplicationException(String.format("Parameter %1$s is mandatory",name),Response.Status.BAD_REQUEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static final List<String> getParameter(MultivaluedMap<String,String> map,String paramName, boolean mandatory){
|
||||||
|
if(map.containsKey(paramName)) {
|
||||||
|
return map.get(paramName);
|
||||||
|
}else if(mandatory) throw new WebApplicationException(String.format("Parameter %1$s is mandatory",paramName),Response.Status.BAD_REQUEST);
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,19 +1,39 @@
|
||||||
package org.gcube.application.perform.service.rest;
|
package org.gcube.application.perform.service.rest;
|
||||||
|
|
||||||
|
import java.sql.SQLException;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
import javax.ws.rs.GET;
|
import javax.ws.rs.GET;
|
||||||
import javax.ws.rs.Path;
|
import javax.ws.rs.Path;
|
||||||
|
import javax.ws.rs.Produces;
|
||||||
import javax.ws.rs.WebApplicationException;
|
import javax.ws.rs.WebApplicationException;
|
||||||
|
import javax.ws.rs.core.Context;
|
||||||
|
import javax.ws.rs.core.MediaType;
|
||||||
import javax.ws.rs.core.Response;
|
import javax.ws.rs.core.Response;
|
||||||
|
import javax.ws.rs.core.UriInfo;
|
||||||
|
|
||||||
import org.gcube.application.perform.service.PerformServiceManager;
|
import org.gcube.application.perform.service.PerformServiceManager;
|
||||||
import org.gcube.application.perform.service.ServiceConstants;
|
import org.gcube.application.perform.service.ServiceConstants;
|
||||||
|
import org.gcube.application.perform.service.engine.PerformanceManager;
|
||||||
|
import org.gcube.application.perform.service.engine.model.InternalException;
|
||||||
|
import org.gcube.application.perform.service.engine.model.InvalidRequestException;
|
||||||
import org.gcube.smartgears.annotations.ManagedBy;
|
import org.gcube.smartgears.annotations.ManagedBy;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
@Path(ServiceConstants.Import.PATH)
|
@Path(ServiceConstants.Performance.PATH)
|
||||||
|
|
||||||
@ManagedBy(PerformServiceManager.class)
|
@ManagedBy(PerformServiceManager.class)
|
||||||
public class Performance {
|
public class Performance {
|
||||||
|
|
||||||
|
private static final Logger log= LoggerFactory.getLogger(Performance.class);
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
PerformanceManager perform;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates CSV file representing a dataset with
|
* Creates CSV file representing a dataset with
|
||||||
*
|
*
|
||||||
|
@ -24,8 +44,49 @@ public class Performance {
|
||||||
* @return Storage ID (Volatile)
|
* @return Storage ID (Volatile)
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
public String getPerformance(){
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
throw new WebApplicationException("Not YET Implemented", Response.Status.NOT_IMPLEMENTED);
|
public Map<String,String> getPerformance(@Context UriInfo info){
|
||||||
|
try {
|
||||||
|
// MultivaluedMap<String, String> parameters=info.getQueryParameters();
|
||||||
|
// log.info("Forming request from {}",parameters);
|
||||||
|
// String batchType=InterfaceCommons.getParameter(parameters, ServiceConstants.Performance.BATCH_TYPE_PARAMETER, true).get(0);
|
||||||
|
//
|
||||||
|
// CSVExportRequest request=new CSVExportRequest( new AnalysisType(batchType, batchType));
|
||||||
|
//
|
||||||
|
// request.addAreas(InterfaceCommons.getParameter(parameters, ServiceConstants.Performance.AREA_PARAMETER, false));
|
||||||
|
// request.addQuarters(InterfaceCommons.getParameter(parameters, ServiceConstants.Performance.QUARTER_PARAMETER, false));
|
||||||
|
// for(String s:InterfaceCommons.getParameter(parameters, ServiceConstants.Performance.FARM_ID_PARAMETER, true))
|
||||||
|
// request.addFarmId(Long.parseLong(s));
|
||||||
|
//
|
||||||
|
// request.addSpecies(InterfaceCommons.getParameter(parameters, ServiceConstants.Performance.SPECIES_ID_PARAMETER, false));
|
||||||
|
// request.addPeriods(InterfaceCommons.getParameter(parameters, ServiceConstants.Performance.PERIOD_PARAMETER, false));
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// log.debug("Export request : {} ",request);
|
||||||
|
//
|
||||||
|
// return perform.generateCSV(request);
|
||||||
|
|
||||||
|
HashMap<String,String> toReturn=new HashMap();
|
||||||
|
toReturn.put("BatchesTable", "aslfgurt-dfgumk374");
|
||||||
|
toReturn.put("AntiparasiticTable", "aslfgurt-dfgumk374");
|
||||||
|
return toReturn;
|
||||||
|
|
||||||
|
|
||||||
|
// }catch(NumberFormatException e) {
|
||||||
|
// throw new WebApplicationException(String.format("Unable to parse parameters."),Response.Status.BAD_REQUEST);
|
||||||
|
// }catch(SQLException e) {
|
||||||
|
// log.debug("Exception while getting Batch",e);
|
||||||
|
// throw new WebApplicationException("Unexpected Exception occurred while dealing with database.", e,Response.Status.INTERNAL_SERVER_ERROR);
|
||||||
|
// } catch (InvalidRequestException e) {
|
||||||
|
// log.debug("Exception while getting Batch",e);
|
||||||
|
// throw new WebApplicationException("Unable to search for Batch. ",e,Response.Status.BAD_REQUEST);
|
||||||
|
// } catch (InternalException e) {
|
||||||
|
// log.warn("Unexpected Exception while getting Batch",e);
|
||||||
|
// throw new WebApplicationException("Unexpected Exception.", e,Response.Status.INTERNAL_SERVER_ERROR);
|
||||||
|
}catch(Throwable t) {
|
||||||
|
log.warn("Unexpected Exception while getting Batch",t);
|
||||||
|
throw new WebApplicationException("Unexpected Exception.", t,Response.Status.INTERNAL_SERVER_ERROR);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,13 @@
|
||||||
|
farm_id,year,biomass_produced_per_number_of_fte_employees,biomass_produced_per_volumes_of_sea_water_used,oxygen_depletion_persistence_days,escapes_number_of_episodes_including_causes,escapees_estimated_number_of_escaped_fish_confidential_isab,endangered_marine_mammals_reptiles_fishes_and_birds_lethal_incidents_n_of_lethal_incident_ha,marine_space_use_for_farming,land_use,freshwater_use,energy_used,fuel_diesel_used_for_transport,fuel_petrol_used_for_transport,fuel_diesel_used_for_others_uses,fuel_petrol_used_for_others_uses,use_of_renewable_energy,number_of_antiparasitic_treatments_per_species_dlabrax_and_disease_crustaceans,number_of_antiparasitic_treatments_per_species_dlabrax_and_disease_other_vibrionaceae,number_of_antiparasitic_treatments_per_species_saurata_and_disease_enteromyxum_leei,number_of_antiparasitic_treatments_per_species_saurata_and_disease_microsporidia,number_of_antiparasitic_treatments_per_species_saurata_and_disease_sparicotyle_chrysophrii,number_of_antiparasitic_treatments_total,number_of_antiparasitic_treatments_total_per_dlabrax,number_of_antiparasitic_treatments_total_per_saurata,number_of_antibiotic_treatments_per_species_dlabrax_and_disease_other,number_of_antibiotic_treatments_per_species_dlabrax_and_disease_tenacibaculum_maritimum,number_of_antibiotic_treatments_per_species_dlabrax_and_disease_vibrio_anguillarum,number_of_antibiotic_treatments_per_species_saurata_and_disease_enteromyxum_leei,number_of_antibiotic_treatments_per_species_saurata_and_disease_other,number_of_antibiotic_treatments_per_species_saurata_and_disease_photobacterium_damselae_piscicida,number_of_antibiotic_treatments_per_species_saurata_and_disease_sparicotyle_chrysophrii,number_of_antibiotic_treatments_per_species_saurata_and_disease_tenacibaculum_maritimum,number_of_antibiotic_treatments_total,number_of_antibiotic_treatments_total_per_dlabrax,number_of_antibiotic_treatments_total_per_saurata,amount_of_active_compounds_of_antiparasitic_treatments_per_species_dlabrax_and_disease_crustaceans,amount_of_active_compounds_of_antiparasitic_treatments_per_species_dlabrax_and_disease_other_vibrionaceae,amount_of_active_compounds_of_antiparasitic_treatments_per_species_saurata_and_disease_enteromyxum_leei,amount_of_active_compounds_of_antiparasitic_treatments_per_species_saurata_and_disease_microsporidia,amount_of_active_compounds_of_antiparasitic_treatments_per_species_saurata_and_disease_sparicotyle_chrysophrii,amount_of_active_compounds_of_antiparasitic_treatments_total,amount_of_active_compounds_of_antiparasitic_treatments_total_per_dlabrax,amount_of_active_compounds_of_antiparasitic_treatments_total_per_saurata,amount_of_active_compounds_of_antibiotic_treatments_per_species_dlabrax_and_disease_other,amount_of_active_compounds_of_antibiotic_treatments_per_species_dlabrax_and_disease_tenacibaculum_maritimum,amount_of_active_compounds_of_antibiotic_treatments_per_species_dlabrax_and_disease_vibrio_anguillarum,amount_of_active_compounds_of_antibiotic_treatments_per_species_saurata_and_disease_enteromyxum_leei,amount_of_active_compounds_of_antibiotic_treatments_per_species_saurata_and_disease_other,amount_of_active_compounds_of_antibiotic_treatments_per_species_saurata_and_disease_photobacterium_damselae_piscicida,amount_of_active_compounds_of_antibiotic_treatments_per_species_saurata_and_disease_sparicotyle_chrysophrii,amount_of_active_compounds_of_antibiotic_treatments_per_species_saurata_and_disease_tenacibaculum_maritimum,amount_of_active_compounds_of_antibiotic_treatments_total,amount_of_active_compounds_of_antibiotic_treatments_total_per_dlabrax,amount_of_active_compounds_of_antibiotic_treatments_total_per_saurata
|
||||||
|
GOAID,2018,50,0.013888889,15,0.008,40,0.13,0.04,4.00E-04,0.6,0.5,0.6,0.24,0.12,0.048,0.02,2,0,1,1,1,5,2,3,1,2,1,0,0,1,0,2,7,4,3,6.36,0,9.2,0.49,10,26.05,6.36,19.69,9.2,23.2,0.8,0,0,0.6,0,1.6,35.4,33.2,2.2
|
||||||
|
GOAID,2019,45,0.009473684,20,0.013888889,83.33333333,0.2,0.055555556,5.56E-04,0.833333333,0.722222222,0.722222222,0.288888889,0.144444444,0.057777778,0.03,5,0,1,0,1,7,5,2,0,0,1,1,0,1,1,1,5,1,4,31.51,0,0.38,0,1.89,33.78,31.51,2.26,0,0,1.11,0.83,0,1.67,1.11,0.56,5.28,1.11,4.17
|
||||||
|
GOAID,2020,64.44444444,0.017058824,25,0.010344828,41.37931034,0.13,0.034482759,3.45E-04,0.517241379,0.396551724,0.620689655,0.248275862,0.124137931,0.049655172,0.04,2,1,0,1,1,5,3,2,0,1,0,1,1,1,1,1,6,1,5,1.4,10.34,0,2.71,1.32,15.77,11.75,4.02,0,0.52,0,1.03,7.93,0.34,0.69,0.69,11.21,0.52,10.69
|
||||||
|
GOAID,2021,26.66666667,0.01,30,0.021875,68.75,0.48,0.0625,6.25E-04,0.9375,0.78125,1.1875,0.475,0.2375,0.095,0.05,4,0,1,1,0,6,4,2,0,1,1,1,0,0,1,2,6,2,4,14.15,0,1.16,1.72,0,17.03,14.15,2.88,0,1.88,0.94,0.63,0,0,0.94,2.5,6.88,2.81,4.06
|
||||||
|
GOAID2,2018,50,0.013888889,15,0.008,40,0.13,0.04,4.00E-04,0.6,0.5,0.6,0.24,0.12,0.048,0.02,2,0,1,1,1,5,2,3,1,2,1,0,0,1,0,2,7,4,3,6.36,0,9.2,0.49,10,26.05,6.36,19.69,9.2,23.2,0.8,0,0,0.6,0,1.6,35.4,33.2,2.2
|
||||||
|
GOAID2,2019,45,0.009473684,20,0.013888889,83.33333333,0.2,0.055555556,5.56E-04,0.833333333,0.722222222,0.722222222,0.288888889,0.144444444,0.057777778,0.03,5,0,1,0,1,7,5,2,0,0,1,1,0,1,1,1,5,1,4,31.51,0,0.38,0,1.89,33.78,31.51,2.26,0,0,1.11,0.83,0,1.67,1.11,0.56,5.28,1.11,4.17
|
||||||
|
GOAID2,2020,64.44444444,0.017058824,25,0.010344828,41.37931034,0.13,0.034482759,3.45E-04,0.517241379,0.396551724,0.620689655,0.248275862,0.124137931,0.049655172,0.04,2,1,0,1,1,5,3,2,0,1,0,1,1,1,1,1,6,1,5,1.4,10.34,0,2.71,1.32,15.77,11.75,4.02,0,0.52,0,1.03,7.93,0.34,0.69,0.69,11.21,0.52,10.69
|
||||||
|
GOAID2,2021,26.66666667,0.01,30,0.021875,68.75,0.48,0.0625,6.25E-04,0.9375,0.78125,1.1875,0.475,0.2375,0.095,0.05,4,0,1,1,0,6,4,2,0,1,1,1,0,0,1,2,6,2,4,14.15,0,1.16,1.72,0,17.03,14.15,2.88,0,1.88,0.94,0.63,0,0,0.94,2.5,6.88,2.81,4.06
|
||||||
|
GOAID3,2018,50,0.013888889,15,0.008,40,0.13,0.04,4.00E-04,0.6,0.5,0.6,0.24,0.12,0.048,0.02,2,0,1,1,1,5,2,3,1,2,1,0,0,1,0,2,7,4,3,6.36,0,9.2,0.49,10,26.05,6.36,19.69,9.2,23.2,0.8,0,0,0.6,0,1.6,35.4,33.2,2.2
|
||||||
|
GOAID3,2019,45,0.009473684,20,0.013888889,83.33333333,0.2,0.055555556,5.56E-04,0.833333333,0.722222222,0.722222222,0.288888889,0.144444444,0.057777778,0.03,5,0,1,0,1,7,5,2,0,0,1,1,0,1,1,1,5,1,4,31.51,0,0.38,0,1.89,33.78,31.51,2.26,0,0,1.11,0.83,0,1.67,1.11,0.56,5.28,1.11,4.17
|
||||||
|
GOAID3,2020,64.44444444,0.017058824,25,0.010344828,41.37931034,0.13,0.034482759,3.45E-04,0.517241379,0.396551724,0.620689655,0.248275862,0.124137931,0.049655172,0.04,2,1,0,1,1,5,3,2,0,1,0,1,1,1,1,1,6,1,5,1.4,10.34,0,2.71,1.32,15.77,11.75,4.02,0,0.52,0,1.03,7.93,0.34,0.69,0.69,11.21,0.52,10.69
|
||||||
|
GOAID3,2021,26.66666667,0.01,30,0.021875,68.75,0.48,0.0625,6.25E-04,0.9375,0.78125,1.1875,0.475,0.2375,0.095,0.05,4,0,1,1,0,6,4,2,0,1,1,1,0,0,1,2,6,2,4,14.15,0,1.16,1.72,0,17.03,14.15,2.88,0,1.88,0.94,0.63,0,0,0.94,2.5,6.88,2.81,4.06
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,2 @@
|
||||||
|
company_id,farm_id,operation_system,producer_association_affiliation,batch_id,stocking_period,species,year_of_reference_season,date_of_stocking_dd_mm_yy_stocking,number_of_rearing_units_n_stocking,total_volume_of_rearing_units_m3_stocking,larvae_at_1_dph_n_stocking,t_c_min_stocking,t_c_max_stocking,date_at_the_end_of_period_dd_mm_yy_500_dd,percentage_of_fish_with_non_inflated_swim_bladder_perc_on_1_dph_larvae_500_dd,t_c_min_500_dd,t_c_max_500_dd,date_at_the_end_of_period_dd_mm_yy_end_of_weaning,average_wet_weight_of_fish_mg_end_of_weaning,number_of_rearing_units_n_end_of_weaning,total_volume_of_rearing_units_m3_end_of_weaning,estimated_number_of_weaned_fish_n_end_of_weaning,rotifers_distribution_billions_end_of_weaning,artemia_distribution_kg_end_of_weaning,fish_with_head_deformities_perc_end_of_weaning,fish_with_spinal_deformities_perc_end_of_weaning,fish_with_fin_deformities_perc_end_of_weaning,t_c_min_end_of_weaning,t_c_max_end_of_weaning,date_at_the_end_of_period_dd_mm_yy_1200_dd,average_wet_weight_of_fish_for_nsize_weight_classes_g_1200_dd,number_of_rearing_units_n_1200_dd,total_volume_of_rearing_units_m3_1200_dd,number_of_fish_discarded_with_head_deformities_n_1200_dd,number_of_fish_discarded_with_spinal_deformities_n_1200_dd,number_of_fish_discarded_with_fin_deformities_n_1200_dd,estimated_number_of_fish_n_1200_dd,number_of_discarded_slow_grower_fish_n_1200_dd,t_c_min_1200_dd,t_c_max_1200_dd,date_at_the_end_of_period_dd_mm_yy_1800_dd,average_wet_weight_of_fish_for_nsize_weight_classes_g_1800_dd,number_of_rearing_units_n_1800_dd,total_volume_of_rearing_units_m3_1800_dd,number_of_fish_discarded_with_head_deformities_n_1800_dd,number_of_fish_discarded_with_spinal_deformities_n_1800_dd,number_of_fish_discarded_with_fin_deformities_n_1800_dd,estimated_number_of_fish_n_1800_dd,number_of_discarded_slow_grower_fish_n_1800_dd,t_c_min_1800_dd,t_c_max_1800_dd,date_at_the_end_of_period_dd_mm_yy_2400_dd,average_wet_weight_of_fish_for_nsize_weight_classes_g_2400_dd,number_of_rearing_units_n_2400_dd,total_volume_of_rearing_units_m3_2400_dd,number_of_fish_vaccinated_against_p_damselae_n_2400_dd,number_of_fish_vaccinated_against_v_anguillarum_n_2400_dd,number_of_fish_vaccinated_against_betanodavirus_n_2400_dd,number_of_fish_discarded_with_head_deformities_n_2400_dd,number_of_fish_discarded_with_spinal_deformities_n_2400_dd,number_of_fish_discarded_with_fin_deformities_n_2400_dd,estimated_number_of_fish_n_2400_dd,number_of_discarded_slow_grower_fish_n_2400_dd,fish_with_head_deformities_perc_2400_dd,fish_with_spinal_deformities_perc_2400_dd,fish_with_fin_deformities_perc_2400_dd,t_c_min_2400_dd,t_c_max_2400_dd,number_of_fish_produced_at_the_end_of_the_cycle_n_end_of_cycle,average_wet_weight_of_fish_at_the_end_of_the_cycle_g_end_of_cycle,day_degree_at_the_end_of_the_cycle_end_of_cycle,date_at_the_end_of_hatchery_cycle_dd_mm_yy_end_of_cycle,weaned_fish_perc,head_deformities_at_end_of_weaning_perc,spinal_deformities_at_end_of_weaning_perc,fin_deformities_at_end_of_weaning_perc,average_body_weight_bw_at_weaning_g,artemia_requirement_kg_of_artemia_million_fish_2400dd,rotifers_requirement_billions_rotifer_million_fish_2400_dd,swim_bladder_non_inflation_at_500dd_perc,discarded_for_head_deformities_at_1200dd_perc,discarded_for_spinal_deformities_at_1200dd_perc,discarded_for_fin_deformities_at_1200dd_perc,discarded_slow_grower_fish_at_1200dd_perc,survival_estimation_at_1200dd_perc,average_body_weight_bw_at_1200dd_g,specific_growth_rate_sgr_at_1200dd_perc_day_1_cumulated,discarded_for_head_deformities_at_1800dd_perc_cumulated_from_stocking,discarded_for_spinal_deformities_at_1800dd_perc_cumulated_from_stocking,discarded_for_fin_deformities_at_1800dd_perc_cumulated_from_stocking,discarded_slow_grower_fish_at_1800dd_perc_cumulated,survival_estimation_at_1800dd_perc,average_body_weight_bw_at_1800dd_g,specific_growth_rate_sgr_at_1800dd_perc_day_1_cumulated,discarded_for_head_deformities_at_2400dd_perc_cumulated_from_stocking,discarded_for_spinal_deformities_at_2400dd_perc_cumulated_from_stocking,discarded_for_fin_deformities_at_2400dd_perc_cumulated_from_stocking,total_discarded_deformed_fish_at_2400dd_perc_cumulated,discarded_slow_grower_fish_at_2400dd_perc_cumulated,survival_estimation_at_2400_dd_perc,head_deformities_at_2400dd_perc,spinal_deformities_at_2400dd_perc,fin_deformities_at_2400dd_perc,average_body_weight_bw_at_2400dd_g,specific_growth_rate_sgr_at_2400dd_perc_day_1_cumulated,vaccinated_fish_against_p_damselae_at_2400dd_perc,vaccinated_fish_against_v_anguillarum_at_2400dd_perc,vaccinated_fish_against_betanodavirus_at_2400dd_perc,fish_produced_at_2400dd_perc,total_production_perc,number_fish_fte_employees,employees_2018,employees_2019,employees_2020
|
||||||
|
Company_c611d557-2114-4e83-896b-fe60fb77b742,HID,Open water system,Association_99abd837-6ccc-45b0-8183-995ac56055f0,a12,natural,D.labrax,-3.0,1.0,12.0,12.0,12.0,12.0,15.0,20.0,0.12,12.0,17.0,30.0,12.0,12.0,12.0,12.0,12.0,12.0,12.0,12.0,12.0,12.0,17.0,12.0,11.999999999999998,12.0,12.0,12.0,12.0,12.0,12.0,12.0,12.0,30.0,30.0,11.999999999999998,12.0,12.0,12.0,12.0,12.0,12.0,12.0,12.0,14.0,40.0,11.999999999999998,12.0,12.0,12.0,12.0,12.0,12.0,12.0,12.0,12.0,12.0,12.0,12.0,12.0,12.0,40.0,12.0,11.999999999999998,12.0,70.0,100.0,12.0,12.0,12.0,0.012,1000000.0,1000000.0,12.0,100.0,100.0,100.0,100.0,100.0,11.999999999999998,-38.37641821656742,200.0,200.0,275.0,200.0,100.0,11.999999999999998,0,300.0,300.0,375.0,975.0,300.0,100.0,12.0,12.0,12.0,11.999999999999998,69.07755278982137,100.0,100.0,100.0,100.0,100.0,1.0,12.0,12.0,12.0
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
company_id,farm_id,operation_system,producer_association_affiliation,batch_id,stocking_period,species,year_of_reference_season,date_of_stocking_dd_mm_yy_stocking,number_of_rearing_units_n_stocking,total_volume_of_rearing_units_m3_stocking,larvae_at_1_dph_n_stocking,t_c_min_stocking,t_c_max_stocking,date_at_the_end_of_period_dd_mm_yy_500_dd,percentage_of_fish_with_non_inflated_swim_bladder_perc_on_1_dph_larvae_500_dd,t_c_min_500_dd,t_c_max_500_dd,date_at_the_end_of_period_dd_mm_yy_end_of_weaning,average_wet_weight_of_fish_mg_end_of_weaning,number_of_rearing_units_n_end_of_weaning,total_volume_of_rearing_units_m3_end_of_weaning,estimated_number_of_weaned_fish_n_end_of_weaning,rotifers_distribution_billions_end_of_weaning,artemia_distribution_kg_end_of_weaning,fish_with_head_deformities_perc_end_of_weaning,fish_with_spinal_deformities_perc_end_of_weaning,fish_with_fin_deformities_perc_end_of_weaning,t_c_min_end_of_weaning,t_c_max_end_of_weaning,date_at_the_end_of_period_dd_mm_yy_1200_dd,average_wet_weight_of_fish_for_nsize_weight_classes_g_1200_dd,number_of_rearing_units_n_1200_dd,total_volume_of_rearing_units_m3_1200_dd,number_of_fish_discarded_with_head_deformities_n_1200_dd,number_of_fish_discarded_with_spinal_deformities_n_1200_dd,number_of_fish_discarded_with_fin_deformities_n_1200_dd,estimated_number_of_fish_n_1200_dd,number_of_discarded_slow_grower_fish_n_1200_dd,t_c_min_1200_dd,t_c_max_1200_dd,date_at_the_end_of_period_dd_mm_yy_1800_dd,average_wet_weight_of_fish_for_nsize_weight_classes_g_1800_dd,number_of_rearing_units_n_1800_dd,total_volume_of_rearing_units_m3_1800_dd,number_of_fish_discarded_with_head_deformities_n_1800_dd,number_of_fish_discarded_with_spinal_deformities_n_1800_dd,number_of_fish_discarded_with_fin_deformities_n_1800_dd,estimated_number_of_fish_n_1800_dd,number_of_discarded_slow_grower_fish_n_1800_dd,t_c_min_1800_dd,t_c_max_1800_dd,date_at_the_end_of_period_dd_mm_yy_2400_dd,average_wet_weight_of_fish_for_nsize_weight_classes_g_2400_dd,number_of_rearing_units_n_2400_dd,total_volume_of_rearing_units_m3_2400_dd,number_of_fish_vaccinated_against_p_damselae_n_2400_dd,number_of_fish_vaccinated_against_v_anguillarum_n_2400_dd,number_of_fish_vaccinated_against_betanodavirus_n_2400_dd,number_of_fish_discarded_with_head_deformities_n_2400_dd,number_of_fish_discarded_with_spinal_deformities_n_2400_dd,number_of_fish_discarded_with_fin_deformities_n_2400_dd,estimated_number_of_fish_n_2400_dd,number_of_discarded_slow_grower_fish_n_2400_dd,fish_with_head_deformities_perc_2400_dd,fish_with_spinal_deformities_perc_2400_dd,fish_with_fin_deformities_perc_2400_dd,t_c_min_2400_dd,t_c_max_2400_dd,number_of_fish_produced_at_the_end_of_the_cycle_n_end_of_cycle,average_wet_weight_of_fish_at_the_end_of_the_cycle_g_end_of_cycle,day_degree_at_the_end_of_the_cycle_end_of_cycle,date_at_the_end_of_hatchery_cycle_dd_mm_yy_end_of_cycle,weaned_fish_perc,head_deformities_at_end_of_weaning_perc,spinal_deformities_at_end_of_weaning_perc,fin_deformities_at_end_of_weaning_perc,average_body_weight_bw_at_weaning_g,artemia_requirement_kg_of_artemia_million_fish_2400dd,rotifers_requirement_billions_rotifer_million_fish_2400_dd,swim_bladder_non_inflation_at_500dd_perc,discarded_for_head_deformities_at_1200dd_perc,discarded_for_spinal_deformities_at_1200dd_perc,discarded_for_fin_deformities_at_1200dd_perc,discarded_slow_grower_fish_at_1200dd_perc,survival_estimation_at_1200dd_perc,average_body_weight_bw_at_1200dd_g,specific_growth_rate_sgr_at_1200dd_perc_day_1_cumulated,discarded_for_head_deformities_at_1800dd_perc_cumulated_from_stocking,discarded_for_spinal_deformities_at_1800dd_perc_cumulated_from_stocking,discarded_for_fin_deformities_at_1800dd_perc_cumulated_from_stocking,discarded_slow_grower_fish_at_1800dd_perc_cumulated,survival_estimation_at_1800dd_perc,average_body_weight_bw_at_1800dd_g,specific_growth_rate_sgr_at_1800dd_perc_day_1_cumulated,discarded_for_head_deformities_at_2400dd_perc_cumulated_from_stocking,discarded_for_spinal_deformities_at_2400dd_perc_cumulated_from_stocking,discarded_for_fin_deformities_at_2400dd_perc_cumulated_from_stocking,total_discarded_deformed_fish_at_2400dd_perc_cumulated,discarded_slow_grower_fish_at_2400dd_perc_cumulated,survival_estimation_at_2400_dd_perc,head_deformities_at_2400dd_perc,spinal_deformities_at_2400dd_perc,fin_deformities_at_2400dd_perc,average_body_weight_bw_at_2400dd_g,specific_growth_rate_sgr_at_2400dd_perc_day_1_cumulated,vaccinated_fish_against_p_damselae_at_2400dd_perc,vaccinated_fish_against_v_anguillarum_at_2400dd_perc,vaccinated_fish_against_betanodavirus_at_2400dd_perc,fish_produced_at_2400dd_perc,total_production_perc,number_fish_fte_employees,employees_2018,employees_2019,employees_2020
|
||||||
|
Company_b79fc3e7-9d0e-447c-ab64-cb5a56ff576b,GPID,Open water system,Association_8179764c-1cad-4809-8f96-6c70dee89645,12,natural,S.aurata,1,12,12,12,12,12,15,133,0.12,12,16,44,1,2,12,12,12,21,21,21,21,12,16,4444,12,12,12,12,21,21,12,21,12,17,4444,12,12,21,21,21,21,21,21,12,19,3331,12,12,12,12,21,21,21,21,21,21,12,21,21,1,12,17,12,12,21,4444,100,21,21,21,0.001,1000000,571428.5714,12,100,175,175,175,100,12,0.213469589,275,350,350,350,175,12,0.213469589,450,525,525,1500,450,175,36.75,36.75,1.75,12,0.285751808,57.14285714,100,100,175,100,1.75,12,12,12
|
||||||
|
Company_b79fc3e7-9d0e-447c-ab64-cb5a56ff576b,GPID,Open water system,Association_8179764c-1cad-4809-8f96-6c70dee89645,13,natural,S.aurata,1,12,12,12,13,12,15,133,0.12,12,16,44,1,2,12,12,12,21,21,21,21,12,16,4444,12,12,12,12,21,21,15,21,12,17,4444,12,12,21,21,21,21,21,21,12,19,3331,12,12,12,12,21,21,21,21,21,21,12,21,21,1,12,17,12,12,21,4444,100,21,21,21,0.001,1000000,571428.5714,12,100,175,175,175,100,12,0.213469589,275,350,350,350,175,12,0.213469589,450,525,525,1500,450,175,36.75,36.75,1.75,12,0.285751808,57.14285714,100,100,175,100,1.75,12,12,12
|
||||||
|
Company_b79fc3e7-9d0e-447c-ab64-cb5a56ff576b,GPID5,Open water system,Association_8179764c-1cad-4809-8f96-6c70dee89645,14,natural,S.aurata,1,12,12,12,14,12,15,133,0.12,12,16,44,1,2,12,12,12,21,21,21,21,12,16,4444,12,12,12,12,21,21,11,21,12,17,4444,12,12,21,21,21,21,21,21,12,19,3331,12,12,12,12,21,21,21,21,21,21,12,21,21,1,12,17,12,12,21,4444,100,21,21,21,0.001,1000000,571428.5714,12,100,175,175,175,100,12,0.213469589,275,350,350,350,175,12,0.213469589,450,525,525,1500,450,175,36.75,36.75,1.75,12,0.285751808,57.14285714,100,100,175,100,1.75,12,12,12
|
||||||
|
Company_b79fc3e7-9d0e-447c-ab64-cb5a56ff576b,GPID,Open water system,Association_8179764c-1cad-4809-8f96-6c70dee89645,g15,natural,S.aurata,1,12,12,12,15,12,15,133,0.12,12,16,44,1,2,12,12,12,21,21,21,21,12,16,4444,12,12,12,12,21,21,16,21,12,17,4444,12,12,21,21,21,21,21,21,12,19,3331,12,12,12,12,21,21,21,21,21,21,12,21,21,1,12,17,12,12,21,4444,100,21,21,21,0.001,1000000,571428.5714,12,100,175,175,175,100,12,0.213469589,275,350,350,350,175,12,0.213469589,450,525,525,1500,450,175,36.75,36.75,1.75,12,0.285751808,57.14285714,100,100,175,100,1.75,12,12,12
|
||||||
|
Company_b79fc3e7-9d0e-447c-ab64-cb5a56ff576b,GPID3,Open water system,Association_8179764c-1cad-4809-8f96-6c70dee89645,g16,natural,S.aurata,1,12,12,12,14,12,15,133,0.12,12,16,44,1,2,12,12,12,21,21,21,21,12,16,4444,12,12,12,12,21,21,15,21,12,17,4444,12,12,21,21,21,21,21,21,12,19,3331,12,12,12,12,21,21,21,21,21,21,12,21,21,1,12,17,12,12,21,4444,100,21,21,21,0.001,1000000,571428.5714,12,100,175,175,175,100,12,0.213469589,275,350,350,350,175,12,0.213469589,450,525,525,1500,450,175,36.75,36.75,1.75,12,0.285751808,57.14285714,100,100,175,100,1.75,12,12,12
|
||||||
|
Company_b79fc3e7-9d0e-447c-ab64-cb5a56ff576b,GPID,Open water system,Association_8179764c-1cad-4809-8f96-6c70dee89645,17g,natural,S.aurata,1,12,12,12,11,12,15,133,0.12,12,16,44,1,2,12,12,12,21,21,21,21,12,16,4444,12,12,12,12,21,21,12,21,12,17,4444,12,12,21,21,21,21,21,21,12,19,3331,12,12,12,12,21,21,21,21,21,21,12,21,21,1,12,17,12,12,21,4444,100,21,21,21,0.001,1000000,571428.5714,12,100,175,175,175,100,12,0.213469589,275,350,350,350,175,12,0.213469589,450,525,525,1500,450,175,36.75,36.75,1.75,12,0.285751808,57.14285714,100,100,175,100,1.75,12,12,12
|
||||||
|
Company_b79fc3e7-9d0e-447c-ab64-cb5a56ff576b,GPID2,Open water system,Association_8179764c-1cad-4809-8f96-6c70dee89645,19,natural,S.aurata,1,12,12,12,10,12,15,133,0.12,12,16,44,1,2,12,12,12,21,21,21,21,12,16,4444,12,12,12,12,21,21,12,21,12,17,4444,12,12,21,21,21,21,21,21,12,19,3331,12,12,12,12,21,21,21,21,21,21,12,21,21,1,12,17,12,12,21,4444,100,21,21,21,0.001,1000000,571428.5714,12,100,175,175,175,100,12,0.213469589,275,350,350,350,175,12,0.213469589,450,525,525,1500,450,175,36.75,36.75,1.75,12,0.285751808,57.14285714,100,100,175,100,1.75,12,12,12
|
||||||
|
Company_b79fc3e7-9d0e-447c-ab64-cb5a56ff576b,GPID2,Open water system,Association_8179764c-1cad-4809-8f96-6c70dee89645,20r,natural,S.aurata,1,12,12,12,14,12,15,133,0.12,12,16,44,1,2,12,12,12,21,21,21,21,12,16,4444,12,12,12,12,21,21,17,21,12,17,4444,12,12,21,21,21,21,21,21,12,19,3331,12,12,12,12,21,21,21,21,21,21,12,21,21,1,12,17,12,12,21,4444,100,21,21,21,0.001,1000000,571428.5714,12,100,175,175,175,100,12,0.213469589,275,350,350,350,175,12,0.213469589,450,525,525,1500,450,175,36.75,36.75,1.75,12,0.285751808,57.14285714,100,100,175,100,1.75,12,12,12
|
||||||
|
Company_b79fc3e7-9d0e-447c-ab64-cb5a56ff576b,GPID4,Open water system,Association_8179764c-1cad-4809-8f96-6c70dee89645,12e,natural,S.aurata,1,12,12,12,17,12,15,133,0.12,12,16,44,1,2,12,12,12,21,21,21,21,12,16,4444,12,12,12,12,21,21,19,21,12,17,4444,12,12,21,21,21,21,21,21,12,19,3331,12,12,12,12,21,21,21,21,21,21,12,21,21,1,12,17,12,12,21,4444,100,21,21,21,0.001,1000000,571428.5714,12,100,175,175,175,100,12,0.213469589,275,350,350,350,175,12,0.213469589,450,525,525,1500,450,175,36.75,36.75,1.75,12,0.285751808,57.14285714,100,100,175,100,1.75,12,12,12
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
company_id,farm_id,operation_system,producer_association_affiliation,aggregated_batches_id,stocking_period,species,year_of_reference,number_of_batches_aggregated_in_a_single_record_n,date_of_stocking_for_the_first_batch_dd_mm_yy,larvae_at_1_dph_n,t_c_min_stocking,t_c_max_stocking,percentage_of_fish_with_non_inflated_swim_bladder_perc_on_1_dph_larvae,estimated_number_of_weaned_fish_n,rotifers_distribution_billions,artemia_distribution_kg,fish_with_head_deformities_perc_end_of_weaning,fish_with_spinal_deformities_percend_of_weaning,fish_with_fin_deformities_perc_end_of_weaning,t_c_min_end_of_weaning,t_c_max_end_of_weaning,number_of_fish_discarded_with_head_deformities_n,number_of_fish_discarded_with_spinal_deformities_n,number_of_fish_discarded_with_fin_deformities_n,fish_with_head_deformities_perc_2400_dd,fish_with_spinal_deformities_perc_2400_dd,fish_with_fin_deformities_perc_2400_dd,number_of_discarded_slow_grower_fish_n,number_of_fish_vaccinated_against_p_damselae_n,number_of_fish_vaccinated_against_v_anguillarum_n,number_of_fish_vaccinated_against_betanodavirus_n,estimated_number_of_fish_produced_n,date_of_last_closed_batch_dd_mm_yy,average_length_of_rearing_period_in_number_of_days_n,t_c_min_2400_dd,t_c_max_2400_dd,weaned_fish_perc,deformed_fish_at_2400dd_perc,discarded_slow_grower_fish_at_2400dd_perc,fish_produced_at_2400dd_perc,fish_produced_per_fte_employees_number_fish_fte_employees,survival_estimation_at_2400_dd_perc,head_deformities_at_end_of_weaning_perc,head_deformities_at_2400dd_perc,spinal_deformities_at_end_of_weaning_perc,spinal_deformities_at_2400dd_perc,fin_deformities_at_end_of_weaning_perc,fin_deformities_at_2400dd_perc,swim_bladder_non_inflation_at_500dd_perc,artemia_requirement_kg_of_artemia_million_fish_produced,rotifers_requirement_billions_rotifer_million_fish_produced,vaccinated_fish_against_p_damselae_at_2400dd_perc,vaccinated_fish_against_v_anguillarum_at_2400dd_perc,vaccinated_fish_against_betanodavirus_at_2400dd_perc,employees_2018,employees_2019,employees_2020
|
||||||
|
Company_3b92fc3c-4df4-4cd0-8301-63502986a731,HID,Partial recirculated system,Association_6f48cb69-7859-4524-b4f9-a126b05c08f3,12.0,Natural,S.aurata,-3.0,12.0,20.0,12.0,12.0,40.0,12.0,12.0,12.0,12.0,12.0,12.0,12.0,12.0,30.0,12.0,12.0,12.0,12.0,12.0,12.0,12.0,12.0,12.0,12.0,12.0,30.0,12.0,11.0,30.0,100.0,300.0,100.0,100.0,0,100.0,12.0,12.0,12.0,12.0,12.0,12.0,12.0,1000000.0,1000000.0,100.0,100.0,100.0,12.0,12.0,0.0
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
company_id,farm_id,operation_system,producer_association_affiliation,aggregated_batches_id,stocking_period,species,year_of_reference,number_of_batches_aggregated_in_a_single_record_n,date_of_stocking_for_the_first_batch_dd_mm_yy,larvae_at_1_dph_n,t_c_min_stocking,t_c_max_stocking,percentage_of_fish_with_non_inflated_swim_bladder_perc_on_1_dph_larvae,estimated_number_of_weaned_fish_n,rotifers_distribution_billions,artemia_distribution_kg,fish_with_head_deformities_perc_end_of_weaning,fish_with_spinal_deformities_percend_of_weaning,fish_with_fin_deformities_perc_end_of_weaning,t_c_min_end_of_weaning,t_c_max_end_of_weaning,number_of_fish_discarded_with_head_deformities_n,number_of_fish_discarded_with_spinal_deformities_n,number_of_fish_discarded_with_fin_deformities_n,fish_with_head_deformities_perc_2400_dd,fish_with_spinal_deformities_perc_2400_dd,fish_with_fin_deformities_perc_2400_dd,number_of_discarded_slow_grower_fish_n,number_of_fish_vaccinated_against_p_damselae_n,number_of_fish_vaccinated_against_v_anguillarum_n,number_of_fish_vaccinated_against_betanodavirus_n,estimated_number_of_fish_produced_n,date_of_last_closed_batch_dd_mm_yy,average_length_of_rearing_period_in_number_of_days_n,t_c_min_2400_dd,t_c_max_2400_dd,weaned_fish_perc,deformed_fish_at_2400dd_perc,discarded_slow_grower_fish_at_2400dd_perc,fish_produced_at_2400dd_perc,fish_produced_per_fte_employees_number_fish_fte_employees,survival_estimation_at_2400_dd_perc,head_deformities_at_end_of_weaning_perc,head_deformities_at_2400dd_perc,spinal_deformities_at_end_of_weaning_perc,spinal_deformities_at_2400dd_perc,fin_deformities_at_end_of_weaning_perc,fin_deformities_at_2400dd_perc,swim_bladder_non_inflation_at_500dd_perc,artemia_requirement_kg_of_artemia_million_fish_produced,rotifers_requirement_billions_rotifer_million_fish_produced,vaccinated_fish_against_p_damselae_at_2400dd_perc,vaccinated_fish_against_v_anguillarum_at_2400dd_perc,vaccinated_fish_against_betanodavirus_at_2400dd_perc,employees_2018,employees_2019,employees_2020
|
||||||
|
Company_7bb54c05-1123-457a-b391-f82bb2199405,HID,Open water system,Association_3730a70e-0aed-4533-941f-157a70be71b5,12,Early,S.aurata,1,12,22,12,12,17,12,12,12,12,12,12,21,21,14,12,12,12,12,12,12,12,12,12,12,12,44,12,12,45,100,300,100,100,1,100,12,12,12,12,21,12,12,1000000,1000000,100,100,100,12,12,0
|
||||||
|
Company_7bb54c05-1123-457a-b391-f82bb2199405,HID2,Open water system,Association_3730a70e-0aed-4533-941f-157a70be71b5,13,Early,S.aurata,1,12,22,12,12,17,12,12,12,12,12,12,21,21,14,12,12,12,12,12,12,12,12,12,12,12,44,12,12,45,100,300,100,100,1,100,12,12,12,12,21,12,12,1000000,1000000,100,100,100,12,12,0
|
||||||
|
Company_7bb54c05-1123-457a-b391-f82bb2199405,HID3,Open water system,Association_3730a70e-0aed-4533-941f-157a70be71b5,14,Early,S.aurata,1,12,22,12,12,17,12,12,12,12,12,12,21,21,14,12,12,12,12,12,12,12,12,12,12,12,44,12,12,45,100,300,100,100,1,100,12,12,12,12,21,12,12,1000000,1000000,100,100,100,12,12,0
|
||||||
|
Company_7bb54c05-1123-457a-b391-f82bb2199405,HID4,Open water system,Association_3730a70e-0aed-4533-941f-157a70be71b5,15,Early,S.aurata,1,12,22,12,12,17,12,12,12,12,12,12,21,21,14,12,12,12,12,12,12,12,12,12,12,12,44,12,12,45,100,300,100,100,1,100,12,12,12,12,21,12,12,1000000,1000000,100,100,100,12,12,0
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
company_id,farm_id,area,operation_system,producer_association_affiliation,batch_id,period,species,date_of_stocking_dd_mm_yy,fish_stocked_n,abw_at_stocking_g,date_of_the_end_of_pregrow_cycle_dd_mm_yy,abw_end_of_pregrow_cycle_g,discarded_deformed_fish_n,discarded_slow_grower_fish_n,dead_fish_n,dry_feed_amount_kg,number_of_harvested_fish_n,deformed_fish_perc,discarded_slow_grower_fish_perc,mortalities_total_perc,specific_growth_rate_sgr,feed_conversion_ratio_fcr
|
||||||
|
Company_5e219448-00d0-4537-8b04-88afd38c8da5,PGCB,-,Partially recirculated system,Association_a82118f8-4e51-4138-b487-f75a7fc1d867,a12,early,S. aurata,12.0,12.0,12.0,20.0,11.999999999999998,12.0,12.0,12.0,12.0,12.0,100.0,100.0,100.0,0.0,-4.3234556422756762E17
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
company_id,farm_id,area,operation_system,producer_association_affiliation,batch_id,period,species,date_of_stocking_dd_mm_yy,fish_stocked_n,abw_at_stocking_g,date_of_the_end_of_pregrow_cycle_dd_mm_yy,abw_end_of_pregrow_cycle_g,discarded_deformed_fish_n,discarded_slow_grower_fish_n,dead_fish_n,dry_feed_amount_kg,number_of_harvested_fish_n,deformed_fish_perc,discarded_slow_grower_fish_perc,mortalities_total_perc,specific_growth_rate_sgr,feed_conversion_ratio_fcr
|
||||||
|
Company_dd381442-5b1d-4c43-bcc8-dc1c0f73f869,IDGP,A1,Open flow-through System,Association_15c1d06f-80d4-4f07-92a9-f7b42e7ea7e0,12,early,S. aurata,12,12,10,20,15,5,3,2,12,5,2,1,1,2,1.20E+01
|
||||||
|
Company_dd381442-5b1d-4c43-bcc8-dc1c0f73f869,IDGP,A2,Open flow-through System,Association_15c1d06f-80d4-4f07-92a9-f7b42e7ea7e0,13,early,S. aurata,20,10,12,30,16,4,2,3,15,4,1,2,2,2,2.10E+01
|
||||||
|
Company_dd381442-5b1d-4c43-bcc8-dc1c0f73f869,IDGP,A1,Open flow-through System,Association_15c1d06f-80d4-4f07-92a9-f7b42e7ea7e0,14,early,S. aurata,30,15,15,40,17,2,1,0,18,5,2,1,2,1,1.20E+01
|
||||||
|
Company_dd381442-5b1d-4c43-bcc8-dc1c0f73f869,IDGP,A3,Open flow-through System,Association_15c1d06f-80d4-4f07-92a9-f7b42e7ea7e0,15,early,S. aurata,40,20,16,50,18,6,2,3,20,5,1,2,2,2,1.20E+01
|
||||||
|
Company_dd381442-5b1d-4c43-bcc8-dc1c0f73f869,IDGP,A4,Open flow-through System,Association_15c1d06f-80d4-4f07-92a9-f7b42e7ea7e0,16,early,S. aurata,50,50,20,60,20,7,3,1,30,7,2,1,2,12,1.20E+01
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
description=AnagraphicTable
|
||||||
|
routine=internal_routine_id
|
||||||
|
csv=csv/Grow_out_Aggregated_Batch_Data_Entry_KPI_aggregated.csv
|
|
@ -0,0 +1,4 @@
|
||||||
|
description=AnnualTable
|
||||||
|
farm=farm_id
|
||||||
|
routine=internal_routine_id
|
||||||
|
csv=csv/KPIs_annual.csv
|
|
@ -0,0 +1,4 @@
|
||||||
|
description=AntibioticsTable
|
||||||
|
farm=farm_id
|
||||||
|
routine=internal_routine_id
|
||||||
|
csv=csv/KPIs_antibiotics.csv
|
|
@ -0,0 +1,4 @@
|
||||||
|
description=AntiparasiticTable
|
||||||
|
farm=farm_id
|
||||||
|
routine=internal_routine_id
|
||||||
|
csv=csv/KPIs_antiparasitic.csv
|
|
@ -5,3 +5,4 @@ association=producer_association_id
|
||||||
batch=aggregated_batch_id
|
batch=aggregated_batch_id
|
||||||
routine=internal_routine_id
|
routine=internal_routine_id
|
||||||
csv=csv/Grow_out_Aggregated_Batch_Data_Entry_KPI.csv
|
csv=csv/Grow_out_Aggregated_Batch_Data_Entry_KPI.csv
|
||||||
|
enable_analysis=true
|
|
@ -0,0 +1,3 @@
|
||||||
|
description=AnagraphicTable
|
||||||
|
routine=internal_routine_id
|
||||||
|
csv=csv/Grow_out_Aggregated_Batch_Data_Entry_KPI_aggregated.csv
|
|
@ -0,0 +1,4 @@
|
||||||
|
description=AnnualTable
|
||||||
|
farm=farm_id
|
||||||
|
routine=internal_routine_id
|
||||||
|
csv=csv/KPIs_annual.csv
|
|
@ -0,0 +1,4 @@
|
||||||
|
description=AntibioticsTable
|
||||||
|
farm=farm_id
|
||||||
|
routine=internal_routine_id
|
||||||
|
csv=csv/KPIs_antibiotics.csv
|
|
@ -0,0 +1,4 @@
|
||||||
|
description=AntiparasiticTable
|
||||||
|
farm=farm_id
|
||||||
|
routine=internal_routine_id
|
||||||
|
csv=csv/KPIs_antiparasitic.csv
|
|
@ -0,0 +1,7 @@
|
||||||
|
description=BatchesTable
|
||||||
|
farm=farm_id
|
||||||
|
company=company_id
|
||||||
|
association=producer_association_id
|
||||||
|
batch=aggregated_batch_id
|
||||||
|
routine=internal_routine_id
|
||||||
|
csv=csv/Grow_out_Aggregated_Batch_Data_Entry_KPI.csv
|
|
@ -0,0 +1,7 @@
|
||||||
|
description=BatchesTable
|
||||||
|
farm=farm_id
|
||||||
|
company=company_id
|
||||||
|
association=producer_association_id
|
||||||
|
batch=aggregated_batch_id
|
||||||
|
routine=internal_routine_id
|
||||||
|
csv=csv/Grow_out_Aggregated_Batch_Data_Entry_KPI.csv
|
|
@ -0,0 +1,7 @@
|
||||||
|
description=BatchesTable
|
||||||
|
farm=farm_id
|
||||||
|
company=company_id
|
||||||
|
association=producer_association_id
|
||||||
|
batch=aggregated_batch_id
|
||||||
|
routine=internal_routine_id
|
||||||
|
csv=csv/Grow_out_Aggregated_Batch_Data_Entry_KPI.csv
|
|
@ -0,0 +1,7 @@
|
||||||
|
description=BatchesTable
|
||||||
|
farm=farm_id
|
||||||
|
company=company_id
|
||||||
|
association=producer_association_id
|
||||||
|
batch=aggregated_batch_id
|
||||||
|
routine=internal_routine_id
|
||||||
|
csv=csv/Grow_out_Aggregated_Batch_Data_Entry_KPI.csv
|
|
@ -0,0 +1,7 @@
|
||||||
|
description=BatchesTable
|
||||||
|
farm=farm_id
|
||||||
|
company=company_id
|
||||||
|
association=producer_association_id
|
||||||
|
batch=aggregated_batch_id
|
||||||
|
routine=internal_routine_id
|
||||||
|
csv=csv/Grow_out_Aggregated_Batch_Data_Entry_KPI.csv
|
|
@ -0,0 +1,7 @@
|
||||||
|
description=BatchesTable
|
||||||
|
farm=farm_id
|
||||||
|
company=company_id
|
||||||
|
association=producer_association_id
|
||||||
|
batch=aggregated_batch_id
|
||||||
|
routine=internal_routine_id
|
||||||
|
csv=csv/Grow_out_Aggregated_Batch_Data_Entry_KPI.csv
|
|
@ -0,0 +1,7 @@
|
||||||
|
description=BatchesTable
|
||||||
|
farm=farm_id
|
||||||
|
company=company_id
|
||||||
|
association=producer_association_id
|
||||||
|
batch=aggregated_batch_id
|
||||||
|
routine=internal_routine_id
|
||||||
|
csv=csv/Grow_out_Aggregated_Batch_Data_Entry_KPI.csv
|
|
@ -0,0 +1,22 @@
|
||||||
|
package org.gcube.application.perform.service;
|
||||||
|
|
||||||
|
import javax.ws.rs.client.WebTarget;
|
||||||
|
import javax.ws.rs.core.Response;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
public class PerformanceTest extends CommonTest{
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void getBatch() {
|
||||||
|
WebTarget target=
|
||||||
|
// target(ServiceConstants.SERVICE_NAME).
|
||||||
|
// path(ServiceConstants.APPLICATION_PATH).
|
||||||
|
target(ServiceConstants.Performance.PATH);
|
||||||
|
|
||||||
|
System.out.println(target.getUri());
|
||||||
|
Response resp=target.request().get();
|
||||||
|
System.out.println(resp.getStatus() + " : "+ resp.readEntity(String.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue