package org.gcube.dataanalysis.dataminer.poolmanager.service; import java.io.File; import java.io.FileNotFoundException; ***REMOVED*** import java.util.Scanner; ***REMOVED*** import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Cluster; import org.gcube.dataanalysis.dataminer.poolmanager.util.ClusterBuilder; import org.gcube.dataanalysis.dataminer.poolmanager.util.SVNUpdater; ***REMOVED*** ***REMOVED*** ***REMOVED*** public class DataminerPoolManager ***REMOVED*** private Logger logger; private SVNUpdater svnUpdater; public DataminerPoolManager() ***REMOVED*** this.logger = LoggerFactory.getLogger(this.getClass()); try ***REMOVED*** ***REMOVED***TODO: read this from configuration this.svnUpdater = new SVNUpdater(); ***REMOVED*** catch (SVNException e) ***REMOVED*** e.printStackTrace(); ***REMOVED*** ***REMOVED*** ***REMOVED***Algorithm algo,String targetVRE, String category, String algorithm_type/*,String env*/) throws IOException, InterruptedException ***REMOVED*** this.logger.debug("Stage algorithm"); this.logger.debug("Algo "+algo); this.logger.debug("Category "+category); this.logger.debug("Algo type "+algorithm_type); Cluster stagingCluster = ClusterBuilder.getStagingDataminerCluster(); ***REMOVED***Cluster rProtoCluster = ClusterBuilder.getRProtoCluster(); DMPMJob job = new StagingJob(this.svnUpdater, algo, stagingCluster, /*rProtoCluster,*/ targetVRE, category, algorithm_type/*,env*/); String id = job.start(); return id; ***REMOVED*** ***REMOVED***Algorithm algo, String targetVRE, String category, String algorithm_type/*, String env*/) throws IOException, InterruptedException ***REMOVED*** this.logger.debug("publish algorithm"); this.logger.debug("Algo "+algo); this.logger.debug("Category "+category); this.logger.debug("Algo type "+algorithm_type); Cluster prodCluster = ClusterBuilder.getProdDataminerCluster(); DMPMJob job = new ProductionPublishingJob(this.svnUpdater, algo, prodCluster, targetVRE, category, algorithm_type/*,env*/); String id = job.start(); return id; ***REMOVED*** public String getLogById(String id) throws FileNotFoundException***REMOVED*** ***REMOVED***TODO: load dir from configuration file this.logger.debug("Getting log by id "+id); File path = new File(System.getProperty("user.home") + File.separator + "dataminer-pool-manager/jobs/" + id); Scanner scanner = new Scanner(path); String response = scanner.useDelimiter("\\Z").next(); this.logger.debug("Response "+response); scanner.close(); return response; ***REMOVED*** public String getMonitorById(String id) throws FileNotFoundException***REMOVED*** this.logger.debug("Getting monitor by id "+id); ***REMOVED***TODO: load dir from configuration file File path = new File(System.getProperty("user.home") + File.separator + "dataminer-pool-manager/jobs/" + id + "_exitStatus"); Scanner scanner = new Scanner(path); String response= scanner.useDelimiter("\\Z").next(); this.logger.debug("Response "+response); scanner.close(); return response; ***REMOVED*** ***REMOVED***