@PublicAPI public interface ResourceManager extends ServiceUsingPermission
The resource manager is used to aggregate resources across the network which are represented by ProActive nodes. Its main features are
SelectionScript
)This interface provides means to create/remove node sources in the resource manager, add remove nodes to node sources, track the state of the resource manager and get nodes for computations.
All the methods of this interface are asynchronous.
Modifier and Type | Method and Description |
---|---|
org.objectweb.proactive.core.util.wrapper.BooleanWrapper |
acquireNodes(String sourceName,
int numberNodes,
long timeout,
Map<String,?> nodeConfiguration)
Acquires new nodes in the particular node source.
|
org.objectweb.proactive.core.util.wrapper.BooleanWrapper |
addNode(String nodeUrl)
Adds an existing node to the default node source of the resource manager.
|
org.objectweb.proactive.core.util.wrapper.BooleanWrapper |
addNode(String nodeUrl,
String sourceName)
Adds an existing node to the particular node source.
|
void |
addNodeToken(String nodeUrl,
String token)
Add a token to the given node
|
boolean |
areNodesKnown(NodeSet nodes)
Check whether the nodes in the given node set are known by the resource
manager
|
Map<String,Boolean> |
areNodesRecoverable(NodeSet nodes)
Check whether the nodes in the given node set can be recovered in case
of a crash
|
org.objectweb.proactive.core.util.wrapper.BooleanWrapper |
checkNodePermission(String nodeUrl,
boolean provider)
Check is the user has admin permission for the given node or it is a node source provider
|
org.objectweb.proactive.core.util.wrapper.BooleanWrapper |
checkNodeSourcePermission(String nodeSourceName,
boolean provider)
Check is the user has admin permission for the given node source or it is a node source provider
|
org.objectweb.proactive.core.util.wrapper.BooleanWrapper |
createNodeSource(String nodeSourceName,
String infrastructureType,
Object[] infrastructureParameters,
String policyType,
Object[] policyParameters,
boolean nodesRecoverable)
Deprecated.
As of version 8.1, replaced by
defineNodeSource(String, String, Object[], String, Object[],
boolean) and deployNodeSource(String)
The node source is the set of nodes acquired from specific infrastructure and characterized
by particular acquisition policy.
This method creates a new node source with specified name, infrastructure manager and acquisition policy.
Parameters required to create infrastructure manager and policy can be obtained from
corresponding |
org.objectweb.proactive.core.util.wrapper.BooleanWrapper |
defineNodeSource(String nodeSourceName,
String infrastructureType,
Object[] infraParams,
String policyType,
Object[] policyParams,
boolean nodesRecoverable)
Defines a new node source in the resource manager.
|
org.objectweb.proactive.core.util.wrapper.BooleanWrapper |
deployNodeSource(String nodeSourceName)
Start acquiring the nodes of a node source that has been defined before.
|
org.objectweb.proactive.core.util.wrapper.BooleanWrapper |
disconnect()
Disconnects from resource manager and releases all the nodes taken by user for computations.
|
org.objectweb.proactive.core.util.wrapper.BooleanWrapper |
editNodeSource(String nodeSourceName,
String infrastructureType,
Object[] infraParams,
String policyType,
Object[] policyParams,
boolean nodesRecoverable)
Edit an existing node source in the resource manager.
|
<T> List<ScriptResult<T>> |
executeScript(Script<T> script,
String targetType,
Set<String> targets)
Executes the script on the specified targets depending on the target type.
|
List<ScriptResult<Object>> |
executeScript(String script,
String scriptEngine,
String targetType,
Set<String> targets)
Executes the script on the specified targets depending on the target type.
|
Map<String,List<String>> |
getAllEligibleNodesTokens()
Get the list of tokens associated with all resource manager eligible nodes
|
Map<String,List<String>> |
getAllNodesTokens()
Get the list of tokens associated with all resource manager nodes
|
NodeSet |
getAtMostNodes(int number,
List<SelectionScript> selectionScriptsList,
NodeSet exclusion)
Deprecated.
|
NodeSet |
getAtMostNodes(int number,
SelectionScript selectionScript)
Deprecated.
|
NodeSet |
getAtMostNodes(int number,
SelectionScript selectionScript,
NodeSet exclusion)
Deprecated.
|
NodeSet |
getAtMostNodes(int number,
TopologyDescriptor descriptor,
List<SelectionScript> selectionScriptsList,
NodeSet exclusion)
Deprecated.
|
org.objectweb.proactive.core.util.wrapper.StringWrapper |
getCurrentUser()
Returns the user currently connected
|
UserData |
getCurrentUserData()
Returns the groups associated with the current connected user.
|
List<RMNodeSourceEvent> |
getExistingNodeSourcesList()
Returns the list of existing node source infrastructures
|
Map<String,List<String>> |
getInfrasToPoliciesMapping()
Return the associations of infrastructures and policy
For each infrastructure name, the list of policies which can be associated
|
RMMonitoring |
getMonitoring()
Returns the monitoring interface to manager listeners of the resource manager.
|
NodeSet |
getNodes(Criteria criteria)
Finds and books nodes for computations.
|
NodeSet |
getNodes(int number,
TopologyDescriptor descriptor,
List<SelectionScript> selectionScriptsList,
NodeSet exclusion,
boolean bestEffort)
Deprecated.
|
Set<String> |
getNodesByTag(String tag)
Returns a list of nodes Urls which contain the specified tag
|
Set<String> |
getNodesByTags(Set<String> tags,
boolean all)
Returns a list of nodes Urls which contain all or any specified list of tags
|
List<RMNodeHistory> |
getNodesHistory(long windowStart,
long windowEnd)
Return all node state events for the given period
|
NodeSourceConfiguration |
getNodeSourceConfiguration(String nodeSourceName)
Returns the current configuration of a node source.
|
org.objectweb.proactive.core.util.wrapper.IntWrapper |
getNodeSourcePingFrequency(String sourceName)
Returns the ping frequency of a node source.
|
Set<String> |
getNodeTags(String nodeUrl)
Return the set of tags associated with the given node
|
org.objectweb.proactive.core.util.wrapper.StringWrapper |
getNodeThreadDump(String nodeUrl)
Returns the string content of the thread dump asked to the
Node
identified by the given URL. |
List<String> |
getNodeTokens(String nodeUrl)
Get the list of tokens associated with the given node
|
org.objectweb.proactive.core.util.wrapper.StringWrapper |
getRMThreadDump()
Returns the string content of the thread dump asked to the
Node
of the Resource Manager. |
RMState |
getState()
Returns the resource manager summary state.
|
Collection<PluginDescriptor> |
getSupportedNodeSourceInfrastructures()
Returns the list of supported node source infrastructures descriptors.
|
Collection<PluginDescriptor> |
getSupportedNodeSourcePolicies()
Returns the list of supported node source policies descriptors.
|
Topology |
getTopology()
Returns the topology information of nodes.
|
org.objectweb.proactive.core.util.wrapper.BooleanWrapper |
isActive()
Returns true if the resource manager is operational and a client is connected.
|
org.objectweb.proactive.core.util.wrapper.BooleanWrapper |
isNodeAdmin(String nodeUrl)
Checks if the currently connected user is the node administrator
|
org.objectweb.proactive.core.util.wrapper.BooleanWrapper |
isNodeUser(String nodeUrl)
Checks if the currently connected user can use node for computations
|
Set<String> |
listAliveNodeUrls()
Returns a list of all alive Nodes Urls.
|
Set<String> |
listAliveNodeUrls(Set<String> nodeSourceNames)
Returns a list of all alive Nodes Urls associated with the given node sources.
|
Set<String> |
listNodeUrls()
Returns a list of all nodes Urls known by RMCore.
|
org.objectweb.proactive.core.util.wrapper.BooleanWrapper |
lockNodes(Set<String> urls)
Locks the set of nodes and makes them not available for others.
|
org.objectweb.proactive.core.util.wrapper.BooleanWrapper |
nodeIsAvailable(String nodeUrl)
Returns true if the node nodeUrl is registered (i.e.
|
void |
releaseBusyNodesNotInList(List<NodeSet> verifiedBusyNodes)
Release the nodes that are busy and that are not part of the given node set
|
org.objectweb.proactive.core.util.wrapper.BooleanWrapper |
releaseNode(org.objectweb.proactive.core.node.Node node)
Releases the node after computations.
|
org.objectweb.proactive.core.util.wrapper.BooleanWrapper |
releaseNodes(NodeSet nodes)
Releases nodes after computations.
|
org.objectweb.proactive.core.util.wrapper.BooleanWrapper |
removeNode(String nodeUrl,
boolean preempt)
Removes a node from the resource manager.
|
org.objectweb.proactive.core.util.wrapper.BooleanWrapper |
removeNodeSource(String sourceName,
boolean preempt)
Remove a node source from the RM.
|
void |
removeNodeToken(String nodeUrl,
String token)
Remove a token from the given node
|
void |
setNeededNodes(int neededNodes)
Set the amount of nodes currently needed by the resource manager
|
Set<String> |
setNodesAvailable(Set<String> nodeUrls)
This method is called periodically by ProActive Nodes to inform the
Resource Manager of a possible reconnection.
|
org.objectweb.proactive.core.util.wrapper.BooleanWrapper |
setNodeSourcePingFrequency(int frequency,
String sourceName)
Each node source scan its nodes periodically to check their states.
|
void |
setNodeTokens(String nodeUrl,
List<String> tokens)
Overwrite the tokens list associated with the given node
|
org.objectweb.proactive.core.util.wrapper.BooleanWrapper |
shutdown(boolean preempt)
Initiate the shutdowns the resource manager.
|
org.objectweb.proactive.core.util.wrapper.BooleanWrapper |
undeployNodeSource(String nodeSourceName,
boolean preempt)
Remove the nodes of a node source that has been deployed before, and
keep the node source defined in the resource manager.
|
org.objectweb.proactive.core.util.wrapper.BooleanWrapper |
unlockNodes(Set<String> urls)
Unlock nodes.
|
org.objectweb.proactive.core.util.wrapper.BooleanWrapper |
updateDynamicParameters(String nodeSourceName,
String infrastructureType,
Object[] infraParams,
String policyType,
Object[] policyParams)
Update the infrastructure or policy parameters of a node source that
marked with 'dynamic'.
|
checkPermission
org.objectweb.proactive.core.util.wrapper.BooleanWrapper defineNodeSource(String nodeSourceName, String infrastructureType, Object[] infraParams, String policyType, Object[] policyParams, boolean nodesRecoverable)
nodeSourceName
- the name of the node sourceinfrastructureType
- type of the underlying infrastructureinfraParams
- parameters for infrastructure creationpolicyType
- name of the policy type. It passed as a string due to plug-able approachpolicyParams
- parameters for policy creationnodesRecoverable
- whether the nodes can be recovered in case of a scheduler crashorg.objectweb.proactive.core.util.wrapper.BooleanWrapper editNodeSource(String nodeSourceName, String infrastructureType, Object[] infraParams, String policyType, Object[] policyParams, boolean nodesRecoverable)
nodeSourceName
- the name of the node source to editinfrastructureType
- type of the underlying infrastructureinfraParams
- parameters for infrastructure creationpolicyType
- name of the policy type. It passed as a string due to plug-able approachpolicyParams
- parameters for policy creationnodesRecoverable
- whether the nodes can be recovered in case of a scheduler crashorg.objectweb.proactive.core.util.wrapper.BooleanWrapper updateDynamicParameters(String nodeSourceName, String infrastructureType, Object[] infraParams, String policyType, Object[] policyParams)
nodeSourceName
- the name of the node sourceinfrastructureType
- type of the underlying infrastructureinfraParams
- parameters of the infrastructure, including the dynamic parameters values to updatepolicyType
- name of the policy typepolicyParams
- parameters of the policy, including the dynamic parameters values to update@Deprecated org.objectweb.proactive.core.util.wrapper.BooleanWrapper createNodeSource(String nodeSourceName, String infrastructureType, Object[] infrastructureParameters, String policyType, Object[] policyParameters, boolean nodesRecoverable)
defineNodeSource(String, String, Object[], String, Object[],
boolean)
and deployNodeSource(String)
The node source is the set of nodes acquired from specific infrastructure and characterized
by particular acquisition policy.
This method creates a new node source with specified name, infrastructure manager and acquisition policy.
Parameters required to create infrastructure manager and policy can be obtained from
corresponding PluginDescriptor
.
nodeSourceName
- the name of the node sourceinfrastructureType
- type of the underlying infrastructureinfrastructureParameters
- parameters for infrastructure creationpolicyType
- name of the policy type. It passed as a string due to plug-able approachpolicyParameters
- parameters for policy creationnodesRecoverable
- whether the nodes can be recovered in case of a scheduler crashorg.objectweb.proactive.core.util.wrapper.BooleanWrapper deployNodeSource(String nodeSourceName)
nodeSourceName
- the name of the node source to deployorg.objectweb.proactive.core.util.wrapper.BooleanWrapper undeployNodeSource(String nodeSourceName, boolean preempt)
nodeSourceName
- the name of the node source to undeploypreempt
- if true remove the nodes immediately without waiting them to be freed.org.objectweb.proactive.core.util.wrapper.BooleanWrapper removeNodeSource(String sourceName, boolean preempt)
sourceName
- name of the source to remove.preempt
- if true remove the node immediately without waiting while it will be freed.List<RMNodeSourceEvent> getExistingNodeSourcesList()
Collection<PluginDescriptor> getSupportedNodeSourceInfrastructures()
Collection<PluginDescriptor> getSupportedNodeSourcePolicies()
NodeSourceConfiguration getNodeSourceConfiguration(String nodeSourceName)
org.objectweb.proactive.core.util.wrapper.BooleanWrapper setNodeSourcePingFrequency(int frequency, String sourceName)
frequency
- the frequency to set to the node source in ms.sourceName
- name of the node source to set the frequencyorg.objectweb.proactive.core.util.wrapper.IntWrapper getNodeSourcePingFrequency(String sourceName)
sourceName
- name of the node sourceorg.objectweb.proactive.core.util.wrapper.BooleanWrapper addNode(String nodeUrl)
nodeUrl
- URL of the node to add.org.objectweb.proactive.core.util.wrapper.BooleanWrapper addNode(String nodeUrl, String sourceName)
nodeUrl
- URL of the node to add.sourceName
- name of the static node source that will handle the nodeorg.objectweb.proactive.core.util.wrapper.BooleanWrapper acquireNodes(String sourceName, int numberNodes, long timeout, Map<String,?> nodeConfiguration)
sourceName
- name of the node source that will acquire the new nodesnumberNodes
- the number of nodes to acquiretimeout
- the maxime waiting time (in milliseconds) before starting to acquire nodesnodeConfiguration
- configuration of acquiring nodesorg.objectweb.proactive.core.util.wrapper.BooleanWrapper removeNode(String nodeUrl, boolean preempt)
nodeUrl
- URL of the node to remove.preempt
- if true remove the node immediately without waiting while it will be freed.org.objectweb.proactive.core.util.wrapper.BooleanWrapper lockNodes(Set<String> urls)
urls
- is a set of nodestrue
if all the nodes become locked, false
otherwise.org.objectweb.proactive.core.util.wrapper.BooleanWrapper unlockNodes(Set<String> urls)
urls
- is a set of nodes to be unlocked.true
if all the nodes are unlocked with success, false
otherwise.org.objectweb.proactive.core.util.wrapper.BooleanWrapper nodeIsAvailable(String nodeUrl)
nodeUrl
- of node to ping.Set<String> setNodesAvailable(Set<String> nodeUrls)
nodeUrls
- the URLs of the workers associated to the node that publishes the update.org.objectweb.proactive.core.util.wrapper.BooleanWrapper isActive()
RMState getState()
RMMonitoring
.getState() method.RMMonitoring getMonitoring()
org.objectweb.proactive.core.util.wrapper.StringWrapper getRMThreadDump()
Node
of the Resource Manager.org.objectweb.proactive.core.util.wrapper.StringWrapper getNodeThreadDump(String nodeUrl)
Node
identified by the given URL.nodeUrl
- node to ask the thread dump toSet<String> listAliveNodeUrls()
Set<String> listAliveNodeUrls(Set<String> nodeSourceNames)
nodeSourceNames
- set of node sources containing the nodes.Set<String> listNodeUrls()
@Deprecated NodeSet getAtMostNodes(int number, SelectionScript selectionScript)
If the resource manager does not have enough nodes it returns as much as it has, but only those which correspond to the selection criteria.
number
- the number of nodesselectionScript
- criterion to be verified by the returned nodes@Deprecated NodeSet getAtMostNodes(int number, SelectionScript selectionScript, NodeSet exclusion)
If the resource manager does not have enough nodes it returns as much as it has, but only those which correspond the to selection criteria.
number
- the number of nodesselectionScript
- criterion to be verified by the returned nodesexclusion
- a list of node which should not be in the result set@Deprecated NodeSet getAtMostNodes(int number, List<SelectionScript> selectionScriptsList, NodeSet exclusion)
If the resource manager does not have enough nodes it returns as much as it has, but only those which correspond the to selection criteria.
number
- the number of nodesselectionScriptsList
- criteria to be verified by the returned nodesexclusion
- a list of node which should not be in the result set@Deprecated NodeSet getAtMostNodes(int number, TopologyDescriptor descriptor, List<SelectionScript> selectionScriptsList, NodeSet exclusion)
If the resource manager does not have enough nodes it returns as much as it has, but only those which correspond the to selection criteria.
number
- the number of nodesdescriptor
- the topology descriptor of nodesselectionScriptsList
- criteria to be verified by the returned nodesexclusion
- a list of node which should not be in the result setTopologyDescriptor
@Deprecated NodeSet getNodes(int number, TopologyDescriptor descriptor, List<SelectionScript> selectionScriptsList, NodeSet exclusion, boolean bestEffort)
If the resource manager does not have enough nodes the result depends on the bestEffort mode. If set to true, the method returns as many node as it has, but only those which correspond the to selection criteria. If bestEffort set to false the method returns either 0 or all required nodes.
number
- the number of nodesdescriptor
- the topology descriptor of nodesselectionScriptsList
- criteria to be verified by the returned nodesexclusion
- a list of node which should not be in the result setbestEffort
- the mode of node aggregationTopologyDescriptor
NodeSet getNodes(Criteria criteria)
criteria
- criteria to select nodesCriteria
org.objectweb.proactive.core.util.wrapper.BooleanWrapper releaseNode(org.objectweb.proactive.core.node.Node node)
node
- the node to be releasedSecurityException
may be thrown if the user does not have right to release the node or it tries to release
a foreign node.org.objectweb.proactive.core.util.wrapper.BooleanWrapper releaseNodes(NodeSet nodes)
nodes
- the set of nodes to be releasedSecurityException
may be thrown if the user does not have right to release one of nodes or it tries to release
a foreign node.org.objectweb.proactive.core.util.wrapper.BooleanWrapper disconnect()
org.objectweb.proactive.core.util.wrapper.BooleanWrapper shutdown(boolean preempt)
RMEvent
(SHUTDOWN) will be send when the shutdown is finished.
Topology getTopology()
org.objectweb.proactive.core.util.wrapper.BooleanWrapper isNodeAdmin(String nodeUrl)
org.objectweb.proactive.core.util.wrapper.BooleanWrapper isNodeUser(String nodeUrl)
<T> List<ScriptResult<T>> executeScript(Script<T> script, String targetType, Set<String> targets)
script
- a selection script to execute.targetType
- must be either NODE_URL, NODESOURCE_NAME or HOSTNAMEtargets
- are names of particular resourcesScriptResult
corresponding to the script execution.List<ScriptResult<Object>> executeScript(String script, String scriptEngine, String targetType, Set<String> targets)
script
- a selection script to execute.scriptEngine
- script engine nametargetType
- must be either NODE_URL, NODESOURCE_NAME or HOSTNAMEtargets
- are names of particular resourcesScriptResult
corresponding to the script execution.org.objectweb.proactive.core.util.wrapper.StringWrapper getCurrentUser()
UserData getCurrentUserData()
void releaseBusyNodesNotInList(List<NodeSet> verifiedBusyNodes)
verifiedBusyNodes
- nodes that should not be releasedboolean areNodesKnown(NodeSet nodes)
nodes
- the node set to verifyMap<String,Boolean> areNodesRecoverable(NodeSet nodes)
nodes
- the node set to verifyvoid setNeededNodes(int neededNodes)
neededNodes
- number of nodes neededMap<String,List<String>> getInfrasToPoliciesMapping()
List<RMNodeHistory> getNodesHistory(long windowStart, long windowEnd)
windowStart
- period start timewindowEnd
- period end timevoid addNodeToken(String nodeUrl, String token) throws RMException
nodeUrl
- url of the nodetoken
- token to addRMException
void removeNodeToken(String nodeUrl, String token) throws RMException
nodeUrl
- url of the nodetoken
- token to removeRMException
void setNodeTokens(String nodeUrl, List<String> tokens) throws RMException
nodeUrl
- url of the nodetokens
- list of tokensRMException
List<String> getNodeTokens(String nodeUrl) throws RMException
nodeUrl
- url of the nodeRMException
Map<String,List<String>> getAllNodesTokens() throws RMException
RMException
Map<String,List<String>> getAllEligibleNodesTokens() throws RMException
RMException
Set<String> getNodeTags(String nodeUrl) throws RMException
nodeUrl
- url of the nodeRMException
Set<String> getNodesByTag(String tag)
tag
- the expected tag which should be contained in the returned nodeSet<String> getNodesByTags(Set<String> tags, boolean all)
tags
- list of tagsall
- When true, the search return nodes which contain all tags;
when false, the search return nodes which contain any tag among the list tags.org.objectweb.proactive.core.util.wrapper.BooleanWrapper checkNodePermission(String nodeUrl, boolean provider)
nodeUrl
- the node urlprovider
- if false, the method will check if the user is admin, if true, the method will also check if the node is a providerorg.objectweb.proactive.core.util.wrapper.BooleanWrapper checkNodeSourcePermission(String nodeSourceName, boolean provider)
nodeSourceName
- the node source nameprovider
- if false, the method will check if the user is admin, if true, the method will also check if the node is a provider