|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object tassl.workflow.resources.Resource
public abstract class Resource
Field Summary | |
---|---|
protected java.lang.String |
identifier
|
protected java.lang.String |
keyfile
|
protected java.util.HashMap<java.lang.String,Node> |
nodeList
|
protected java.lang.String |
softwareDirWorker
|
protected java.util.HashMap<java.lang.String,java.lang.String> |
supportedApps
|
protected java.lang.String |
userWorker
|
protected java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.util.List<java.lang.String>>> |
wflNode
|
protected java.lang.String |
workerBasePropertyFile
|
protected java.lang.String |
workingDir
|
protected java.lang.String |
zone
|
Constructor Summary | |
---|---|
Resource()
|
Method Summary | |
---|---|
abstract java.util.List |
allocateStage(java.lang.String wflId,
java.lang.String stageId,
java.util.List<java.lang.String> MachineWorkers,
java.lang.String properties)
Allocate N workers to a specific stage. |
abstract boolean |
checkAllocatePossibleStage(int numWorkers,
java.lang.String properties)
Check if the stage can be allocated in this resource |
java.util.HashMap |
checkAllWorkerStatus()
Check the status of all the workers |
protected boolean |
checkIfExistsNodeAcct(java.util.List<NodeAcct> currentNodeAcct,
java.lang.String ip)
Check if an machine, identified by IP, is registered in the accounting already. |
java.lang.String |
checkWorkerStatus(java.lang.String address,
int port)
|
boolean |
createWorkerProperties(java.lang.String filename,
java.lang.String wflId,
java.lang.String stageId,
java.lang.String appname,
java.lang.String workerclass,
java.lang.String properties,
double perf,
java.lang.String tasks)
|
abstract void |
disableSite()
Disable a site by setting all resources to 0 and terminate currently running workers/VMs. |
abstract java.util.List<NodeAcct> |
generateAccountingInfo(java.lang.String wflId,
java.lang.String stageId,
long timestamp,
java.util.List<NodeAcct> currentNodeAcct)
Generate the accounting information of a stage. |
java.util.HashMap<java.lang.String,java.util.List> |
getActiveResourcesWorkflow()
Get the list of active resources organized by workflowid.stageid |
abstract java.util.List |
getAvailableSlotsScheduling(java.lang.String siteAddress,
java.lang.String[] allocatedWorkers)
It creates the list of available slots for scheduling considering the workers per machine and the number of available machines. |
protected int |
getCandidateTunnelPort(java.util.List avoidPorts)
Return a port to use for the tunnel from Agent to Worker |
double |
getCostDataIn()
|
double |
getCostDataOut()
|
java.lang.String |
getIdentifier()
|
java.lang.String |
getKeyfile()
|
java.util.HashMap<java.lang.String,Node> |
getNodeList()
Return the list of nodes of this site in the format "name or ip": Node |
double |
getOverhead()
|
java.lang.Integer |
getPortMapWorker(java.lang.String address,
int port)
|
java.util.HashMap<java.lang.String,java.lang.String> |
getSupportedApps()
|
java.lang.String |
getUserWorker()
|
java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.util.List<java.lang.String>>> |
getWflNode()
Return nodes assigned to each workflow |
java.lang.String |
getWflStageWorker(java.lang.String worker)
Return the workflowId.stageId where the worker is allocated worker ip:port |
java.lang.String |
getWorkerBasePropertyFile()
|
java.util.List<java.lang.String> |
getWorkersWorkflowStage(java.lang.String workflowId,
java.lang.String stageId)
Return the workers allocated to a specific stage workflow |
java.lang.String |
getZone()
|
abstract boolean |
isActive(java.lang.String ip)
Check if the node corresponding to this IP is active. |
abstract boolean |
isStatusActive(java.lang.String ip)
Check if the machine is in active status in the records. |
boolean |
loadConfig(java.lang.String file,
java.lang.String type)
|
void |
releasePortMapWorker(java.lang.String addressWorker,
int portWorker)
Release ports from SSH tunnel from Agent to Worker. |
abstract java.util.List |
releaseSomeWorkers(java.lang.String workflowId,
java.lang.String stageId,
java.util.List workers)
Release SOME workers allocated to the specific workflow stage |
abstract java.util.List |
releaseSomeWorkersbyMachineIp(java.lang.String workflowId,
java.lang.String stageId,
java.util.List machineIps)
Release all workers of the selected machines |
void |
releaseTunnelsWorker(java.lang.String addressWorker)
Release reverse SSH tunnel from Agent to Worker. |
abstract java.util.List |
releaseWorkers(java.lang.String workflowId,
java.lang.String stageId)
Release ALL workers allocated to the specific workflow stage |
abstract void |
restoreSite()
Restore a previously disabled site. |
void |
setAgentSSHTunnelPortRange(int[] portRange)
|
void |
setIdentifier(java.lang.String identifier)
|
void |
setKeyfile(java.lang.String keyfile)
|
void |
setNodeList(java.util.HashMap<java.lang.String,Node> nodeList)
|
void |
setOverhead(double overhead)
|
void |
setPorts(int taskServicePort,
int mgmtServicePort,
int fileServerPort)
|
void |
setStartSSHtunnelAgent(boolean value)
|
void |
setStartSSHtunnels(boolean startSSHtunnels)
|
void |
setSupportedApps(java.util.HashMap<java.lang.String,java.lang.String> supportedApps)
|
void |
setWorkerBasePropertyFile(java.lang.String workerBasePropertyFile)
|
void |
startAgentToWorkerTunnel(java.lang.String remoteport,
java.lang.String remoteaddress)
|
void |
startTunnelsWorker(java.lang.String addkey,
java.lang.String address)
|
java.util.List |
startWorkers(java.util.List<java.lang.String> nodeinfo,
java.lang.String wflId,
java.lang.String stageId,
java.lang.String appname,
java.lang.String properties,
java.util.List<java.lang.Double> performance,
java.lang.String tasks)
|
java.util.HashMap<java.lang.String,java.lang.Double> |
string2HashMapDouble(java.lang.String values)
Convert a string to HashMap |
java.util.HashMap<java.lang.String,java.lang.Integer> |
string2HashMapInt(java.lang.String values)
Convert a string to HashMap |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.String identifier
protected java.lang.String zone
protected java.util.HashMap<java.lang.String,Node> nodeList
protected java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.util.List<java.lang.String>>> wflNode
protected java.util.HashMap<java.lang.String,java.lang.String> supportedApps
protected java.lang.String softwareDirWorker
protected java.lang.String userWorker
protected java.lang.String workerBasePropertyFile
protected java.lang.String workingDir
protected java.lang.String keyfile
Constructor Detail |
---|
public Resource()
Method Detail |
---|
public boolean loadConfig(java.lang.String file, java.lang.String type)
public java.util.HashMap<java.lang.String,java.lang.Integer> string2HashMapInt(java.lang.String values)
values
- The format is m1.small:10;Logger.getLogger(ResourceCloud.class.getName()).log(Level.SEVERE, null, e);m1.medium:5;m1.large:3 or ip:2;ip:2 or etc
public java.util.HashMap<java.lang.String,java.lang.Double> string2HashMapDouble(java.lang.String values)
values
- The format is m1.small:10;m1.medium:5;m1.large:3 or ip:2;ip:2 or etc
public java.util.HashMap<java.lang.String,java.lang.String> getSupportedApps()
public java.lang.String getIdentifier()
public java.lang.String getZone()
public java.lang.String getKeyfile()
public double getOverhead()
public java.lang.String getUserWorker()
public double getCostDataIn()
public double getCostDataOut()
public java.lang.String getWorkerBasePropertyFile()
public java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.util.List<java.lang.String>>> getWflNode()
public java.util.List<java.lang.String> getWorkersWorkflowStage(java.lang.String workflowId, java.lang.String stageId)
workflowId
- stageId
-
public java.util.HashMap<java.lang.String,Node> getNodeList()
public void setStartSSHtunnels(boolean startSSHtunnels)
public void setStartSSHtunnelAgent(boolean value)
public void setAgentSSHTunnelPortRange(int[] portRange)
protected int getCandidateTunnelPort(java.util.List avoidPorts)
public void setPorts(int taskServicePort, int mgmtServicePort, int fileServerPort)
public void setNodeList(java.util.HashMap<java.lang.String,Node> nodeList)
public void setIdentifier(java.lang.String identifier)
public void setKeyfile(java.lang.String keyfile)
public void setSupportedApps(java.util.HashMap<java.lang.String,java.lang.String> supportedApps)
public void setOverhead(double overhead)
public void setWorkerBasePropertyFile(java.lang.String workerBasePropertyFile)
public void startAgentToWorkerTunnel(java.lang.String remoteport, java.lang.String remoteaddress)
public void startTunnelsWorker(java.lang.String addkey, java.lang.String address)
public void releasePortMapWorker(java.lang.String addressWorker, int portWorker)
addressWorker
- portWorker
- public void releaseTunnelsWorker(java.lang.String addressWorker)
addressWorker
- portWorker
- public java.util.List startWorkers(java.util.List<java.lang.String> nodeinfo, java.lang.String wflId, java.lang.String stageId, java.lang.String appname, java.lang.String properties, java.util.List<java.lang.Double> performance, java.lang.String tasks)
public java.lang.String getWflStageWorker(java.lang.String worker)
public java.util.HashMap checkAllWorkerStatus()
public java.lang.Integer getPortMapWorker(java.lang.String address, int port)
public java.lang.String checkWorkerStatus(java.lang.String address, int port)
public boolean createWorkerProperties(java.lang.String filename, java.lang.String wflId, java.lang.String stageId, java.lang.String appname, java.lang.String workerclass, java.lang.String properties, double perf, java.lang.String tasks)
public java.util.HashMap<java.lang.String,java.util.List> getActiveResourcesWorkflow()
public abstract java.util.List releaseWorkers(java.lang.String workflowId, java.lang.String stageId)
workflowId
- stageId
-
public abstract java.util.List releaseSomeWorkers(java.lang.String workflowId, java.lang.String stageId, java.util.List workers)
workflowId
- stageId
- workers
-
public abstract java.util.List releaseSomeWorkersbyMachineIp(java.lang.String workflowId, java.lang.String stageId, java.util.List machineIps)
workflowId
- stageId
- machineIps
-
public abstract java.util.List allocateStage(java.lang.String wflId, java.lang.String stageId, java.util.List<java.lang.String> MachineWorkers, java.lang.String properties)
wflId
- stageId
- MachineWorkers
- properties
- This defines the type of allocation "random" or "exact" as the list of MachineWorkers says
public abstract boolean checkAllocatePossibleStage(int numWorkers, java.lang.String properties)
numWorkers
- properties
- This can be the type of VM we want, the min performance of a machine, etc..
public abstract boolean isActive(java.lang.String ip)
ip
-
public abstract boolean isStatusActive(java.lang.String ip)
ip
-
public abstract java.util.List getAvailableSlotsScheduling(java.lang.String siteAddress, java.lang.String[] allocatedWorkers)
siteAddress
- address:port of the site to be identified laterallocatedWorkers
- machine/vmtype:numWorkers
public abstract java.util.List<NodeAcct> generateAccountingInfo(java.lang.String wflId, java.lang.String stageId, long timestamp, java.util.List<NodeAcct> currentNodeAcct)
wflId
- stageId
- timestamp
- time when the machine is provisionedcurrentNodeAcct
- this is the accounting info before the new workers are assigned.
public abstract void disableSite()
public abstract void restoreSite()
protected boolean checkIfExistsNodeAcct(java.util.List<NodeAcct> currentNodeAcct, java.lang.String ip)
currentNodeAcct
- ip
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |