|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecteu.xtreemos.system.eventmachine.stage.AbstractStage
eu.xtreemos.system.eventmachine.stage.AbstractReceivingStage
eu.xtreemos.system.eventmachine.stage.Abstract2wayStage
eu.xtreemos.xosd.resmng.ResMng
public class ResMng
A class implementing the Resource Manager service. The service collects the available computation node and enables the node selection by resource queries expressed as a part of a job description. The job descriptions are formed as XMLs using the JSDL schema. Resource Manager queries nodes' local Resource Monitor service to obtain the resource descriptors formed as XMLs using the GLUE v.1.2 schema.
Nested Class Summary | |
---|---|
class |
ResMng.WeightedResourceDescriptorComparator
|
protected class |
ResMng.XMLMatch
A class-structure for defining which element in GLUE match (i.e. should be used for checking the criteria against) an element in JSDL. |
Field Summary | |
---|---|
private boolean |
compromised
Indicates whether returned signed data was compromised. |
protected CResMngConfig |
config
The configuration of the service. |
private java.lang.String |
delim
|
(package private) static org.apache.log4j.Logger |
logger
|
private eu.xtreemos.xosd.utilities.metrics.JobMetrics |
metrics
|
private eu.xtreemos.xosd.utilities.metrics.JobMetricsData |
metricsData
|
(package private) org.bouncycastle.openssl.PasswordFinder |
myPass
|
protected ResMng.XMLMatch[] |
xmlMatches
|
Fields inherited from class eu.xtreemos.system.eventmachine.stage.Abstract2wayStage |
---|
context, counter, curContext, sink |
Fields inherited from class eu.xtreemos.system.eventmachine.stage.AbstractReceivingStage |
---|
queue |
Fields inherited from class eu.xtreemos.system.eventmachine.stage.AbstractStage |
---|
handlerChain, handlerGroup, handlerThreads, name, running, serviceListeners |
Constructor Summary | |
---|---|
ResMng()
|
Method Summary | |
---|---|
java.lang.Integer |
addJobMetric(java.lang.String jobId,
eu.xtreemos.xosd.utilities.metrics.MetricsDesc metric)
|
java.util.ArrayList<CommunicationAddress> |
createRequest(java.util.Hashtable<java.lang.String,java.lang.Object> jsdlTable)
|
java.lang.Object |
createRequestAnswer(java.util.ArrayList<CommunicationAddress> alRes)
|
java.lang.Exception |
failureCallback(java.lang.Exception ex)
|
java.lang.Object |
getDaemonsReplyAndProcess(java.util.ArrayList list)
Dorothy, you're not in Kansas anymore... but in a Callback! |
java.lang.String |
getHandledEventType()
|
java.lang.String |
getJobInfo(java.lang.String jobId,
java.lang.Integer flags,
java.lang.Integer infoLevel,
java.util.ArrayList<java.lang.String> metricsList,
java.lang.String user)
|
java.util.ArrayList<ResourceDescriptorRecord> |
getNodeResourceDescriptor(CommunicationAddress address)
A proxy call to ResourceMonitor.query of a service running at particular node. |
java.util.Hashtable<java.lang.String,java.lang.Object> |
getNodeResourceGLUE(CommunicationAddress address)
A proxy call to ResourceMonitor.query of a service running at particular node. |
java.util.ArrayList<ResourceDescriptorRecord> |
getProxyResMonDescrReply(java.util.Hashtable<java.lang.String,java.lang.Object> glue)
The callback that concludes the call to getNodeResourceDescriptor(CommunicationAddress)
and passes the returns the value. |
java.util.Hashtable<java.lang.String,java.lang.Object> |
getProxyResMonReply(java.util.Hashtable<java.lang.String,java.lang.Object> glue)
The callback that concludes the call to getNodeResourceGLUE(CommunicationAddress)
and passes the returns the value. |
java.util.Hashtable<java.lang.String,java.lang.String> |
getResInfo(CommunicationAddress resource,
java.security.cert.X509Certificate userCtx)
Returns the monitoring information associated with the resource. |
java.util.Hashtable<java.lang.String,java.lang.String> |
getResInfoSuccess(java.util.Hashtable<java.lang.String,java.lang.String> list)
|
java.util.ArrayList<java.lang.String> |
getResMetrics(CommunicationAddress resource,
java.security.cert.X509Certificate userCtx)
Returns the list of metrics available on that resource. |
java.util.ArrayList<java.lang.String> |
getResMetricsSuccess(java.util.ArrayList<java.lang.String> metrics)
|
java.util.ArrayList<ResourceDescriptorRecord> |
getResourceDescriptors(java.util.ArrayList<CommunicationAddress> resources)
Retrieve the resource descriptors of the nodes from the given list. |
java.util.ArrayList<ResourceDescriptorRecord> |
getResourceDescriptorsFailure(java.lang.Exception ex)
|
java.util.ArrayList<ResourceDescriptorRecord> |
getResourceDescriptorsSuccess(java.util.ArrayList<ResourceDescriptorRecord> result)
|
java.lang.Object |
getResourceMonitorReply(java.util.Hashtable glue)
continuing the processing after ResourceMonitor call, to the Wicked Witch of the West. |
java.lang.Object |
getResourceMonitorReplyFailure(java.lang.Exception ex)
|
java.util.ArrayList<CommunicationAddress> |
getResources(java.lang.String query,
java.security.cert.X509Certificate userCtx,
java.lang.Integer howMany)
Retrieve a collection of resources that match the job's resource demands. |
java.util.ArrayList<CommunicationAddress> |
getResourcesADS(java.lang.String query,
java.security.cert.X509Certificate userCtx,
java.lang.Integer howMany)
|
java.util.ArrayList<CommunicationAddress> |
getResourcesADSSucceeded(java.util.ArrayList<CommunicationAddress> selection)
The SRDSMng retuns here after the call to getResources[ADS] to provide its selection based on the JSDL. |
java.util.ArrayList<CommunicationAddress> |
getResourcesCentral(java.lang.String query,
java.security.cert.X509Certificate userCtx,
java.lang.Integer howMany)
Retrieve a collection of resources that match the job's resource demands. |
java.util.ArrayList<CommunicationAddress> |
getResourcesFromParsedCommand(ParsedCommand command)
|
java.util.ArrayList<CommunicationAddress> |
getResourcesFromPath(java.lang.String queryFileName)
Retrieve a collection of resources that match the job's resource demands. |
java.util.ArrayList<CommunicationAddress> |
getResourcesFromString(java.lang.String query)
Retrieve a collection of resources that match the job's resource demands. |
java.util.ArrayList<CommunicationAddress> |
getResourcesFromStructure(java.util.Hashtable<java.lang.String,java.lang.Object> jsdl)
Retrieve a collection of resources that match the job's resource demands. |
java.util.ArrayList<CommunicationAddress> |
getResourcesScored(java.lang.String query)
|
java.util.ArrayList<CommunicationAddress> |
getResourcesScoredWeighted(java.lang.String query,
java.util.Hashtable<java.lang.Integer,java.lang.Double> weights)
|
java.util.ArrayList<CommunicationAddress> |
getResourcesSorted(java.lang.String query,
ResourceDescriptorComparatorSerializable comparator)
Retrieve a collection of resources that match the job's resource demands. |
java.util.ArrayList<CommunicationAddress> |
getXMLExtractorReply(java.util.Hashtable list)
The callback with the final piece of processing of the #getResources(String) service call. |
void |
handleEvent(java.lang.Object event)
|
private java.lang.Integer |
inheritMetrics(java.lang.String jobId,
CommunicationAddress jobMngAddr)
|
java.lang.Integer |
inheritMetricsCB(java.util.ArrayList<eu.xtreemos.xosd.utilities.metrics.MetricsDesc> metricsList)
|
void |
init()
|
protected java.util.ArrayList<ResourceDescriptorScorekeeper> |
matchAndScoreResources(java.util.ArrayList<ResourceDescriptorRecord> resources,
IConditionTreeNode conditionTreeRoot)
|
protected java.util.ArrayList<CommunicationAddress> |
matchProcesses(java.util.ArrayList fullList,
java.util.ArrayList glues,
java.util.Hashtable jsdl,
ResMngStorage storage)
|
protected java.util.ArrayList<ResourceDescriptorRecord> |
matchResources(java.util.ArrayList<ResourceDescriptorRecord> resources,
IConditionTreeNode conditionTreeRoot,
ResMngStorage storage)
Traverses the condition tree for each element in the resource descriptor collection and selects those that match the query expressed in the condition tree. |
java.lang.Object |
policyEnforceRequest(java.util.ArrayList<CommunicationAddress> list)
Call to VOPS service. |
java.lang.Object |
policyEnforceRequestCertificateCatcher(java.security.cert.X509Certificate certificate)
Catching certificates from CDAMngs that are being queried for certificates. |
java.lang.Object |
policyEnforceRequestCertificateCatcherFailure(java.lang.Exception err)
Catches failures of CDAMng.getResourceCertificate call. |
void |
removeBuffers(java.lang.String jobId)
It's called from jobMng when cleaning. |
java.lang.Integer |
removeJobMetric(java.lang.String jobId,
java.lang.String metricName)
|
void |
removeMetrics(java.lang.String jobId)
Should be called after jobUnit dies, but resmng doesn't notice it. |
java.lang.Integer |
setMetricValue(java.lang.String jobId,
java.lang.String metricName,
java.lang.String value)
|
java.lang.Integer |
setMonitoringBuffering(java.lang.String jobId,
java.lang.String metricName,
java.lang.Boolean enable,
java.lang.String user)
|
java.util.ArrayList<CommunicationAddress> |
testCall()
A function for testing stuff. |
java.lang.Object |
testCallCallback1(java.util.Hashtable jsdl)
|
java.util.ArrayList |
testCallCallback2(java.util.Hashtable glue)
|
java.util.ArrayList<CommunicationAddress> |
VerifyPolicyAEMSuccess(ResourceMatching verifiedMatching)
|
java.util.ArrayList<CommunicationAddress> |
verifyPolicyCertResHandler(ResourceMatching rmList)
Reads VOPS' public key and checks if rmList has been written with VOPS' private key. |
java.util.Hashtable<java.lang.String,java.lang.String> |
VerifyPolicyForResInfo(ResourceMatching resmatching)
|
java.util.ArrayList<java.lang.String> |
VerifyPolicyForResMetrics(ResourceMatching resmatching)
|
Methods inherited from class eu.xtreemos.system.eventmachine.stage.Abstract2wayStage |
---|
getContext, removeContext, SendException, SendException, SendException, SendReply, SendReply, SendReply, setSink |
Methods inherited from class eu.xtreemos.system.eventmachine.stage.AbstractReceivingStage |
---|
dequeue, getSource |
Methods inherited from class eu.xtreemos.system.eventmachine.stage.AbstractStage |
---|
addHandler, addHandler, addServiceListener, getName, getShortName, getThreadCount, notifyServiceInitialised, notifyServiceStarted, notifyServiceStopped, processEvent, removeHandler, removeServiceListener, setThreadCount, start, stop |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.lang.String delim
private boolean compromised
protected CResMngConfig config
private eu.xtreemos.xosd.utilities.metrics.JobMetrics metrics
private eu.xtreemos.xosd.utilities.metrics.JobMetricsData metricsData
static final org.apache.log4j.Logger logger
protected ResMng.XMLMatch[] xmlMatches
org.bouncycastle.openssl.PasswordFinder myPass
Constructor Detail |
---|
public ResMng()
Method Detail |
---|
public java.lang.Object policyEnforceRequest(java.util.ArrayList<CommunicationAddress> list)
public java.lang.Object policyEnforceRequestCertificateCatcher(java.security.cert.X509Certificate certificate)
certificate
-
public java.lang.Object policyEnforceRequestCertificateCatcherFailure(java.lang.Exception err)
err
-
public java.util.ArrayList<CommunicationAddress> verifyPolicyCertResHandler(ResourceMatching rmList)
rmList
- Signed list of resources
public java.util.ArrayList<CommunicationAddress> createRequest(java.util.Hashtable<java.lang.String,java.lang.Object> jsdlTable)
public java.lang.Object createRequestAnswer(java.util.ArrayList<CommunicationAddress> alRes)
public java.lang.Object getDaemonsReplyAndProcess(java.util.ArrayList list)
list
- List of available hosts
public java.lang.Object getResourceMonitorReplyFailure(java.lang.Exception ex) throws java.lang.Exception
ex
-
java.lang.Exception
public java.lang.Object getResourceMonitorReply(java.util.Hashtable glue)
glue
-
public java.util.ArrayList<CommunicationAddress> getXMLExtractorReply(java.util.Hashtable list)
#getResources(String)
service call. The method
getResourceMonitorReply(Hashtable)
registers this callback.
list
- The structure representing the JSDL input, the result
of the call to the XMLExtractor service.
public java.util.ArrayList<CommunicationAddress> getResourcesADSSucceeded(java.util.ArrayList<CommunicationAddress> selection)
selection
- The result obtained from the ADS, filtered by the
resource requirements in the JSDL.
public java.util.ArrayList<CommunicationAddress> VerifyPolicyAEMSuccess(ResourceMatching verifiedMatching) throws java.lang.Exception
java.lang.Exception
public java.util.ArrayList<CommunicationAddress> getResourcesFromPath(java.lang.String queryFileName) throws java.io.FileNotFoundException
queryFileName
- The filename of the XML file with JSDL query
containing the resource query as a part of a job description.
java.io.FileNotFoundException
public java.util.ArrayList<CommunicationAddress> getResources(java.lang.String query, java.security.cert.X509Certificate userCtx, java.lang.Integer howMany) throws java.lang.Exception
query
- The contents of the XML file with JSDL query
containing the resource query as a part of a job description.userCtx
- The certificate signifying the user on whose behalf
the call is doing the query.howMany
- A hint, specifying how many retrieved resources we
would like to have.
java.lang.Exception
public java.util.ArrayList<CommunicationAddress> getResourcesADS(java.lang.String query, java.security.cert.X509Certificate userCtx, java.lang.Integer howMany) throws java.lang.Exception
java.lang.Exception
public java.util.ArrayList<CommunicationAddress> getResourcesCentral(java.lang.String query, java.security.cert.X509Certificate userCtx, java.lang.Integer howMany) throws java.lang.Exception
query
- The contents of the XML file with JSDL query
containing the resource query as a part of a job description.userCtx
- The certificate signifying the user on whose behalf
the call is doing the query.howMany
- A hint, specifying how many retrieved resources we
would like to have.
java.lang.Exception
public java.util.ArrayList<CommunicationAddress> getResourcesFromString(java.lang.String query)
query
- The contents of the XML file with JSDL query
containing the resource query as a part of a job description.
public java.util.ArrayList<CommunicationAddress> getResourcesFromStructure(java.util.Hashtable<java.lang.String,java.lang.Object> jsdl)
jsdl
- The structure containing the parsed and searchable contents
of the XML file with JSDL query.
public java.util.ArrayList<CommunicationAddress> getResourcesSorted(java.lang.String query, ResourceDescriptorComparatorSerializable comparator)
query
- The contents of the XML file with JSDL query
containing the resource query as a part of a job description.comparator
- The comparator to use when sorting the records.
public java.util.ArrayList<CommunicationAddress> getResourcesScored(java.lang.String query)
public java.util.ArrayList<CommunicationAddress> getResourcesScoredWeighted(java.lang.String query, java.util.Hashtable<java.lang.Integer,java.lang.Double> weights)
protected java.util.ArrayList<CommunicationAddress> matchProcesses(java.util.ArrayList fullList, java.util.ArrayList glues, java.util.Hashtable jsdl, ResMngStorage storage)
fullList
- list of resourcesglues
- list of resource descriptorsjsdl
- parsed JSDL query
public java.util.Hashtable<java.lang.String,java.lang.Object> getNodeResourceGLUE(CommunicationAddress address)
address
- The node we request the resource details of the
ResourceMonitor service from.
public java.util.Hashtable<java.lang.String,java.lang.Object> getProxyResMonReply(java.util.Hashtable<java.lang.String,java.lang.Object> glue)
getNodeResourceGLUE(CommunicationAddress)
and passes the returns the value.
glue
- The value passed by the ResourceMonitor.
public java.util.ArrayList<ResourceDescriptorRecord> getNodeResourceDescriptor(CommunicationAddress address)
address
- The node we request the resource details of the
ResourceMonitor service from.
public java.util.ArrayList<ResourceDescriptorRecord> getProxyResMonDescrReply(java.util.Hashtable<java.lang.String,java.lang.Object> glue)
getNodeResourceDescriptor(CommunicationAddress)
and passes the returns the value.
glue
- The value passed by the ResourceMonitor.
public java.lang.Exception failureCallback(java.lang.Exception ex)
public java.util.ArrayList<CommunicationAddress> testCall()
public java.lang.Object testCallCallback1(java.util.Hashtable jsdl)
public java.util.ArrayList testCallCallback2(java.util.Hashtable glue)
protected java.util.ArrayList<ResourceDescriptorRecord> matchResources(java.util.ArrayList<ResourceDescriptorRecord> resources, IConditionTreeNode conditionTreeRoot, ResMngStorage storage)
resources
- A collection of resources to be matched against the
resource query in the condition tree.conditionTreeRoot
- The root node of the condition tree to match
the resources against.
protected java.util.ArrayList<ResourceDescriptorScorekeeper> matchAndScoreResources(java.util.ArrayList<ResourceDescriptorRecord> resources, IConditionTreeNode conditionTreeRoot)
public java.util.ArrayList<CommunicationAddress> getResourcesFromParsedCommand(ParsedCommand command)
public java.util.Hashtable<java.lang.String,java.lang.String> getResInfo(CommunicationAddress resource, java.security.cert.X509Certificate userCtx) throws java.net.ConnectException, java.io.IOException, java.lang.Exception, java.lang.InterruptedException, UserNotAuthorisedException
resource
- The resource we are querying the information on.userCtx
- The user that queries the information
#getResourceMetrics
and
their respective values on the resource.
java.net.ConnectException
java.io.IOException
java.lang.Exception
java.lang.InterruptedException
UserNotAuthorisedException
public java.lang.Integer addJobMetric(java.lang.String jobId, eu.xtreemos.xosd.utilities.metrics.MetricsDesc metric)
public java.lang.Integer inheritMetricsCB(java.util.ArrayList<eu.xtreemos.xosd.utilities.metrics.MetricsDesc> metricsList)
private java.lang.Integer inheritMetrics(java.lang.String jobId, CommunicationAddress jobMngAddr)
jobId
- jobMngAddr
-
public java.lang.Integer removeJobMetric(java.lang.String jobId, java.lang.String metricName)
jobId
- metricName
-
public void removeMetrics(java.lang.String jobId)
jobId
- public void removeBuffers(java.lang.String jobId)
jobId
- public java.lang.Integer setMetricValue(java.lang.String jobId, java.lang.String metricName, java.lang.String value)
jobId
- metricName
- value
-
public java.lang.Integer setMonitoringBuffering(java.lang.String jobId, java.lang.String metricName, java.lang.Boolean enable, java.lang.String user)
jobId
- metricName
- enable
- user
-
public java.lang.String getJobInfo(java.lang.String jobId, java.lang.Integer flags, java.lang.Integer infoLevel, java.util.ArrayList<java.lang.String> metricsList, java.lang.String user)
public java.util.Hashtable<java.lang.String,java.lang.String> VerifyPolicyForResInfo(ResourceMatching resmatching) throws UserNotAuthorisedException
UserNotAuthorisedException
public java.util.Hashtable<java.lang.String,java.lang.String> getResInfoSuccess(java.util.Hashtable<java.lang.String,java.lang.String> list)
public java.util.ArrayList<java.lang.String> getResMetrics(CommunicationAddress resource, java.security.cert.X509Certificate userCtx) throws java.lang.Exception
resource
- The resource we are querying the information on.userCtx
- The user that queries the information
java.lang.Exception
public java.util.ArrayList<java.lang.String> VerifyPolicyForResMetrics(ResourceMatching resmatching) throws UserNotAuthorisedException
UserNotAuthorisedException
public java.util.ArrayList<java.lang.String> getResMetricsSuccess(java.util.ArrayList<java.lang.String> metrics)
public java.util.ArrayList<ResourceDescriptorRecord> getResourceDescriptors(java.util.ArrayList<CommunicationAddress> resources)
resources
- The list of communication addresses of the resources
that we would like to learn the resource properties of.
ResourceDescriptorRecord.communicationAddress
of each element to check the responses' address.public java.util.ArrayList<ResourceDescriptorRecord> getResourceDescriptorsSuccess(java.util.ArrayList<ResourceDescriptorRecord> result)
public java.util.ArrayList<ResourceDescriptorRecord> getResourceDescriptorsFailure(java.lang.Exception ex)
public void init()
init
in interface eu.xtreemos.system.eventmachine.stage.IStage
init
in class eu.xtreemos.system.eventmachine.stage.AbstractStage
public void handleEvent(java.lang.Object event) throws java.lang.Exception
handleEvent
in interface eu.xtreemos.system.eventmachine.queue.IEventHandler
handleEvent
in class eu.xtreemos.system.eventmachine.stage.AbstractReceivingStage
java.lang.Exception
public java.lang.String getHandledEventType()
getHandledEventType
in class eu.xtreemos.system.eventmachine.stage.AbstractReceivingStage
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |