|
|
|
@ -145,13 +145,40 @@ public class ISClient {
|
|
|
|
|
public String getHProxy(){
|
|
|
|
|
Host h = new Host();
|
|
|
|
|
SimpleQuery query = queryFor(ServiceEndpoint.class);
|
|
|
|
|
query.addCondition("$resource/Profile/Platform/Name/text() eq 'DataMinerAlone'");
|
|
|
|
|
query.addCondition("$resource/Profile/Platform/Name/text() eq 'DataMiner'");
|
|
|
|
|
DiscoveryClient<ServiceEndpoint> client = clientFor(ServiceEndpoint.class);
|
|
|
|
|
List<ServiceEndpoint> resources = client.submit(query);
|
|
|
|
|
h.setName(resources.get(0).profile().runtime().hostedOn());
|
|
|
|
|
return h.getName();
|
|
|
|
|
***REMOVED***
|
|
|
|
|
|
|
|
|
|
***REMOVED***return the Cluster hostname from the IS
|
|
|
|
|
***REMOVED***to develop
|
|
|
|
|
public Cluster getCluster(){
|
|
|
|
|
Cluster cl = new Cluster();
|
|
|
|
|
String HProxy = this.getHProxy();
|
|
|
|
|
SimpleQuery query = queryFor(ServiceEndpoint.class);
|
|
|
|
|
query.addCondition("$resource/Profile/Platform/Name/text() eq 'DataMiner'");
|
|
|
|
|
DiscoveryClient<ServiceEndpoint> client = clientFor(ServiceEndpoint.class);
|
|
|
|
|
List<ServiceEndpoint> resources = client.submit(query);
|
|
|
|
|
cl.setName(resources.get(0).profile().runtime().hostedOn());
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
|
|
***REMOVED***
|
|
|
|
|
|
|
|
|
|
***REMOVED***return the dataminer hostnames from the IS
|
|
|
|
|
***REMOVED***to develop
|
|
|
|
|
public List<Host> getDM(){
|
|
|
|
|
Cluster cl = new Cluster();
|
|
|
|
|
String HProxy = this.getHProxy();
|
|
|
|
|
SimpleQuery query = queryFor(ServiceEndpoint.class);
|
|
|
|
|
query.addCondition("$resource/Profile/Platform/Name/text() eq 'DataMiner'");
|
|
|
|
|
DiscoveryClient<ServiceEndpoint> client = clientFor(ServiceEndpoint.class);
|
|
|
|
|
List<ServiceEndpoint> resources = client.submit(query);
|
|
|
|
|
cl.setName(resources.get(0).profile().runtime().hostedOn());
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
|
|
***REMOVED***
|
|
|
|
|
|
|
|
|
|
public Cluster getClusterByHProxy() throws IOException {
|
|
|
|
|
Cluster cl = new Cluster();
|
|
|
|
@ -171,14 +198,60 @@ public Cluster getClusterByHProxy() throws IOException {
|
|
|
|
|
***REMOVED***
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public List<Host> listDataMinersByCluster() throws IOException {
|
|
|
|
|
Cluster cluster = this.getClusterByHProxy();
|
|
|
|
|
public Cluster MapCluster() throws IOException {
|
|
|
|
|
***REMOVED***
|
|
|
|
|
URL stockURL = new URL("http:***REMOVED***data.d4science.org/Yk4zSFF6V3JOSytNd3JkRDlnRFpDUUR5TnRJZEw2QjRHbWJQNStIS0N6Yz0");
|
|
|
|
|
String HProxy = this.getHProxy();
|
|
|
|
|
***REMOVED***
|
|
|
|
|
***REMOVED***
|
|
|
|
|
***REMOVED***
|
|
|
|
|
***REMOVED***
|
|
|
|
|
***REMOVED***
|
|
|
|
|
***REMOVED***
|
|
|
|
|
***REMOVED***
|
|
|
|
|
***REMOVED***
|
|
|
|
|
***REMOVED***
|
|
|
|
|
***REMOVED***
|
|
|
|
|
***REMOVED***
|
|
|
|
|
***REMOVED***
|
|
|
|
|
***REMOVED***
|
|
|
|
|
***REMOVED***
|
|
|
|
|
***REMOVED***
|
|
|
|
|
***REMOVED***
|
|
|
|
|
***REMOVED***
|
|
|
|
|
***REMOVED***
|
|
|
|
|
***REMOVED***
|
|
|
|
|
***REMOVED***
|
|
|
|
|
***REMOVED***
|
|
|
|
|
***REMOVED***
|
|
|
|
|
***REMOVED***
|
|
|
|
|
***REMOVED***
|
|
|
|
|
if (HProxy.equals("dataminer-d-workers.d4science.org")) {
|
|
|
|
|
***REMOVED***
|
|
|
|
|
***REMOVED***
|
|
|
|
|
|
|
|
|
|
***REMOVED***
|
|
|
|
|
|
|
|
|
|
***REMOVED***
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public List<Host> listDataMinersByCluster() throws IOException {
|
|
|
|
|
***REMOVED***next op to use when Cluster info available in the IS
|
|
|
|
|
***REMOVED***Cluster cluster = this.getClusterByHProxy();
|
|
|
|
|
***REMOVED***
|
|
|
|
|
***REMOVED***
|
|
|
|
|
***REMOVED***prod
|
|
|
|
|
***REMOVED***URL stockURL = new URL("http:***REMOVED***data.d4science.org/Yk4zSFF6V3JOSytNd3JkRDlnRFpDUUR5TnRJZEw2QjRHbWJQNStIS0N6Yz0");
|
|
|
|
|
|
|
|
|
|
***REMOVED***dev
|
|
|
|
|
URL stockURL = new URL("http:***REMOVED***data.d4science.org/c29KTUluTkZnRlB0WXE5NVNaZnRoR0dtYThUSmNTVlhHbWJQNStIS0N6Yz0");
|
|
|
|
|
BufferedReader in = new BufferedReader(new InputStreamReader(stockURL.openStream()));
|
|
|
|
|
reader = new CSVReader(in, ',');
|
|
|
|
|
String[] nextLine;
|
|
|
|
|
while ((nextLine = reader.readNext()) != null) {
|
|
|
|
|
if (nextLine[1].equals("BACKEND")||(nextLine[1].equals("FRONTEND"))){
|
|
|
|
|
continue;
|
|
|
|
|
***REMOVED***
|
|
|
|
|
|
|
|
|
|
if (nextLine[0].equals(cluster.getName())) {
|
|
|
|
|
***REMOVED***
|
|
|
|
|
a.setName(nextLine[1]);
|
|
|
|
@ -190,8 +263,6 @@ public Cluster getClusterByHProxy() throws IOException {
|
|
|
|
|
|
|
|
|
|
***REMOVED***
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Return the list of hosts (dataminers) in a given VRE
|
|
|
|
|
*
|
|
|
|
@ -238,7 +309,8 @@ public Cluster getClusterByHProxy() throws IOException {
|
|
|
|
|
ISClient a = new ISClient();
|
|
|
|
|
ScopeProvider.instance.set("/gcube/devNext/NextNext");
|
|
|
|
|
***REMOVED***System.out.println(a.getHProxy());
|
|
|
|
|
***REMOVED***System.out.println(a.getClusterByHProxy());
|
|
|
|
|
***REMOVED***System.out.println(a.MapCluster());
|
|
|
|
|
System.out.println(a.listDataMinersByCluster());
|
|
|
|
|
***REMOVED***System.out.println(a.listDataMinersByCluster());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|