45 lines
1.3 KiB
Java
45 lines
1.3 KiB
Java
package org.gcube.dataanalysis.dataminer.poolmanager.util;
|
|
|
|
***REMOVED***
|
|
|
|
***REMOVED***
|
|
***REMOVED***
|
|
import org.gcube.dataanalysis.dataminer.poolmanager.clients.HAProxy;
|
|
import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Cluster;
|
|
import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Host;
|
|
|
|
public class ClusterBuilder ***REMOVED***
|
|
|
|
|
|
***REMOVED***1. to complete
|
|
public static Cluster getStagingDataminerCluster()***REMOVED***
|
|
Cluster cluster = new Cluster();
|
|
Props p = new Props();
|
|
Host h = new Host(p.getStagingHost());
|
|
***REMOVED***TODO: read this from configuration or IS?
|
|
h.setName(p.getStagingHost());
|
|
cluster.addHost(h);
|
|
return cluster;
|
|
***REMOVED***
|
|
|
|
public static Cluster getVRECluster(String targetVREToken, String targetVRE) throws IOException***REMOVED***
|
|
Cluster cluster = new Cluster();
|
|
for (Host h : new HAProxy().listDataMinersByCluster(targetVREToken,targetVRE)) ***REMOVED***
|
|
cluster.addHost(h);
|
|
***REMOVED***
|
|
return cluster;
|
|
***REMOVED***
|
|
|
|
public static Cluster getRProtoCluster() throws IOException***REMOVED***
|
|
***REMOVED***Assumes the service is running in RPrototypingLab
|
|
|
|
String token = SecurityTokenProvider.instance.get();
|
|
String targetVRE = ScopeProvider.instance.get();
|
|
|
|
return getVRECluster(token, targetVRE);
|
|
***REMOVED***
|
|
|
|
|
|
|
|
***REMOVED***
|