This commit is contained in:
Nunzio Andrea Galante 2017-05-11 15:42:53 +00:00
parent d428b52929
commit 0eb07b35d1
4 changed files with 61 additions and 4 deletions

View File

@ -94,9 +94,9 @@ public class HAProxy {
//}
else {
// prod
URL stockURL = new
URL("http://data.d4science.org/Yk4zSFF6V3JOSytNd3JkRDlnRFpDUUR5TnRJZEw2QjRHbWJQNStIS0N6Yz0");
//URL stockURL = new URL("http://"+ ISClient.getHProxy() +":8880/;csv");
//URL stockURL = new
//URL("http://data.d4science.org/Yk4zSFF6V3JOSytNd3JkRDlnRFpDUUR5TnRJZEw2QjRHbWJQNStIS0N6Yz0");
URL stockURL = new URL("http://"+ ISClient.getHProxy() +":8880/;csv");
//URL stockURL = new URL("http://data.d4science.org/c29KTUluTkZnRlB0WXE5NVNaZnRoR0dtYThUSmNTVlhHbWJQNStIS0N6Yz0");
//System.out.println(stockURL);
// dev

View File

@ -9,6 +9,7 @@ import org.gcube.dataanalysis.dataminer.poolmanager.ansiblebridge.AnsibleBridge;
import org.gcube.dataanalysis.dataminer.poolmanager.clients.HAProxy;
import org.gcube.dataanalysis.dataminer.poolmanager.clients.ISClient;
import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.*;
import org.gcube.dataanalysis.dataminer.poolmanager.util.Props;
import org.gcube.dataanalysis.dataminer.poolmanager.util.SVNUpdater;
import org.gcube.informationsystem.publisher.AdvancedScopedPublisher;
import org.gcube.informationsystem.publisher.RegistryPublisherFactory;
@ -72,8 +73,9 @@ public class DataminerPoolManager {
private Cluster getStagingDataminerCluster(){
Cluster cluster = new Cluster();
Host h = new Host();
Props p = new Props();
//TODO: read this from configuration or IS?
h.setName("dataminer1-devnext.d4science.org");
h.setName(p.getStagingHost());
cluster.addHost(h);
return cluster;
}

View File

@ -0,0 +1,52 @@
package org.gcube.dataanalysis.dataminer.poolmanager.util;
import java.io.IOException;
import java.util.Properties;
public class Props {
public static String home = System.getProperty("user.home");
public Props() {
}
public String getCSVUrl() {
Properties props = new Properties();
java.io.InputStream input = Props.class.getClassLoader().getResourceAsStream("service.properties");
// loading properites from properties file
try {
props.load(input);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
// reading proeprty
String path = props.getProperty("HAPROXY_CSV");
return path;
}
public String getStagingHost() {
Properties props = new Properties();
java.io.InputStream input = Props.class.getClassLoader().getResourceAsStream("service.properties");
// loading properites from properties file
try {
props.load(input);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
// reading proeprty
String path = props.getProperty("STAGING_HOST");
return path;
}
public static void main(String[] args) {
Props a = new Props();
System.out.println(a.getStagingHost());
}
}

View File

@ -0,0 +1,3 @@
#YML node file
STAGING_HOST: dataminer1-devnext.d4science.org
#HAPROXY_CSV: http://data.d4science.org/Yk4zSFF6V3JOSytNd3JkRDlnRFpDUUR5TnRJZEw2QjRHbWJQNStIS0N6Yz0