@PublicAPI
public interface ResourceManager
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 |
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.
|
boolean |
areNodesKnown(NodeSet nodes)
Check whether the nodes in the given node set are known by the resource
manager
|
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 |
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.
|
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
|
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.
|
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.
|
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. |
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.
|
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.
|
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.
|
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'.
|
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 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.@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 verifyboolean areNodesRecoverable(NodeSet nodes)
nodes
- the node set to verify