public class RMCore extends Object implements ResourceManager, org.objectweb.proactive.InitActive, org.objectweb.proactive.RunActive
The RMCore functions are:
RMProxyUserInterface
object, with a node selection mechanism performed by SelectionScript
.RMMonitoring
active object.
Nodes in Resource Manager are represented by objects
. RMcore
has to manage different states of nodes:
RMCore is not responsible of creation, acquisition and monitoring of nodes,
these points are performed by NodeSource
objects.
WARNING: you must instantiate this class as an Active Object!
RmCore should be non-blocking which means:
Modifier and Type | Field and Description |
---|---|
static Map<org.objectweb.proactive.core.UniqueID,Client> |
clients
Map of connected clients and internal services that have an access to the core.
|
static String |
HAS_BEEN_SUCCESSFULLY |
static String |
NODE_SOURCE_STRING |
static String |
REQUESTED_BY_STRING |
static TopologyManager |
topologyManager
Nodes topology
|
Constructor and Description |
---|
RMCore()
ProActive Empty constructor
|
RMCore(Map<String,NodeSource> deployedNodeSources,
Map<String,RMNode> allNodes,
Client caller,
RMMonitoringImpl monitoring,
SelectionManager manager,
List<RMNode> freeNodesList,
RMDBManager newDataBaseManager) |
RMCore(String id,
org.objectweb.proactive.core.node.Node nodeRM)
Creates the RMCore object.
|
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.
|
void |
addEligibleNodesToRecover(List<RMNode> eligibleNodes) |
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
|
boolean |
checkPermission(String methodName)
Checks if the current user is allowed to execute the provided method
|
protected Client |
checkPermissionAndGetClientIsSuccessful() |
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) |
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.
|
void |
disconnect(org.objectweb.proactive.core.UniqueID clientId)
Disconnects the client and releases all nodes held by him
|
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
|
List<RMNode> |
getAllNodes() |
Map<String,List<String>> |
getAllNodesTokens()
Get the list of tokens associated with all resource manager nodes
|
NodeSet |
getAtMostNodes(int number,
List<SelectionScript> scripts,
NodeSet exclusion)
Finds "number" nodes for computations according to the selection scripts
(node must be complaint to all scripts).
|
NodeSet |
getAtMostNodes(int nbNodes,
SelectionScript selectionScript)
Finds "number" nodes for computations according to the selection script.
|
NodeSet |
getAtMostNodes(int number,
SelectionScript selectionScript,
NodeSet exclusion)
Finds "number" nodes for computations according to the selection script.
|
NodeSet |
getAtMostNodes(int number,
TopologyDescriptor descriptor,
List<SelectionScript> selectionScrips,
NodeSet exclusion)
Finds "number" nodes for computations according to the selection scripts
(node must be complaint to all scripts).
|
List<RMNode> |
getBusyNodes() |
org.objectweb.proactive.core.util.wrapper.StringWrapper |
getCurrentUser()
Returns the user currently connected
|
UserData |
getCurrentUserData()
Returns the groups associated with the current connected user.
|
RMDBManager |
getDbManager() |
Map<String,NodeSourceDescriptor> |
getDeployedNodeSources() |
NodeSet |
getExactlyNodes(int nb,
SelectionScript selectionScript) |
List<RMNodeSourceEvent> |
getExistingNodeSourcesList()
Gives list of existing Node Sources
|
List<RMNode> |
getFreeNodes() |
String |
getId() |
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()
Gets RM monitoring stub
|
protected RMNode |
getNodeByUrlIncludingDeployingNodes(String url) |
NodeSet |
getNodes(Criteria criteria)
Finds and books nodes for computations.
|
NodeSet |
getNodes(int number,
TopologyDescriptor topology,
List<SelectionScript> selectionScrips,
NodeSet exclusion,
boolean bestEffort)
Finds "number" nodes for computations according to the selection scripts
(node must be complaint to all scripts).
|
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
|
List<RMNodeEvent> |
getNodesList()
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.
|
NodeState |
getNodeState(String nodeUrl) |
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
|
RMInitialState |
getRMInitialState()
Builds and returns a snapshot of RMCore's current state.
|
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.
|
List<String> |
getToBeRemovedUnavailableNodesUrls() |
Topology |
getTopology()
Returns the topology information of nodes.
|
int |
getTotalAliveNodesNumber()
Gives total number of alive nodes handled by RM
|
void |
initActivity(org.objectweb.proactive.Body body)
Initialization part of the RMCore active object.
|
protected void |
initiateRecoveryIfRequired() |
void |
internalAddNodeToCore(RMNode configuredNode)
Internal operation of registering a new node in the Core
This step is done after node configuration ran by
RMNodeConfigurator active object. |
void |
internalRegisterConfiguringNode(RMNode rmnode)
Internal operation of configuring a node.
|
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 |
lockNodes(Set<String> urls,
Client caller) |
org.objectweb.proactive.core.util.wrapper.BooleanWrapper |
nodeIsAvailable(String nodeUrl)
Returns true if the node nodeUrl is registered (i.e.
|
org.objectweb.proactive.core.util.wrapper.BooleanWrapper |
nodeSourceUnregister(String nodeSourceName,
NodeSourceStatus nodeSourceStatus,
RMNodeSourceEvent evt)
Unregisters node source from the resource manager core.
|
void |
recoverNodeSource(NodeSourceDescriptor nodeSourceDescriptor)
Recreate a node source from a node source descriptor and deploy it if
the node source descriptor specifies a deployed status.
|
org.objectweb.proactive.core.util.wrapper.BooleanWrapper |
redeployNodeSource(String nodeSourceName)
Remove the nodes of a node source that has been deployed before, and
keep the node source defined in the resource manager, then deploy the node source
If the node source is undeployed, then this method does nothing.
|
void |
registerAndEmitNodeEvent(RMNodeEvent event) |
org.objectweb.proactive.core.util.wrapper.BooleanWrapper |
registerAvailableNode(RMNode rmNode)
Add the node in the list of all nodes to make it pingable.
|
void |
releaseBusyNodesNotInList(List<NodeSet> nodesToNotRelease)
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.
|
void |
removeAllNodes(String nodeSourceName,
boolean preemptive)
Removes all nodes from the specified node source.
|
void |
removeAllNodes(String nodeSourceName,
boolean preemptive,
boolean isTriggeredFromShutdownHook)
Removes all nodes from the specified node source.
|
org.objectweb.proactive.core.util.wrapper.BooleanWrapper |
removeNode(String nodeUrl,
boolean preempt)
Removes a node from the RM.
|
org.objectweb.proactive.core.util.wrapper.BooleanWrapper |
removeNode(String nodeUrl,
boolean preempt,
boolean isTriggeredFromShutdownHook) |
org.objectweb.proactive.core.util.wrapper.BooleanWrapper |
removeNodeFromCore(String nodeUrl)
Removed a node with given url from the internal structures of the core.
|
void |
removeNodes(int number,
String nodeSourceName,
boolean preemptive)
Removes "number" of nodes from the node source.
|
org.objectweb.proactive.core.util.wrapper.BooleanWrapper |
removeNodeSource(String nodeSourceName,
boolean preempt)
Remove a node source from the RM.
|
void |
removeNodeToken(String nodeUrl,
String token)
Remove a token from the given node
|
void |
runActivity(org.objectweb.proactive.Body body)
RunActivity periodically send "alive" event to listeners
|
void |
setBusyNode(String nodeUrl,
Client owner) |
void |
setBusyNode(String nodeUrl,
Client owner,
Map<String,String> usageInfo)
Set a node state to busy.
|
void |
setBusyNodes(List<String> nodeUrlList,
Client owner,
List<Map<String,String>> usageInfoList,
int usageInfoCriteriaSize)
Set a list of nodes state to busy.
|
boolean |
setDeploying(RMNode rmNode) |
void |
setDownNode(String nodeUrl)
Sets a node state to down and updates all internal structures of rm core
accordingly.
|
org.objectweb.proactive.core.util.wrapper.BooleanWrapper |
setFreeNodes(List<RMNode> nodes)
Mark nodes as free after cleaning procedure.
|
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)
Shutdown the resource manager
|
protected void |
signalRMCoreIsInitialized() |
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'.
|
public static final String NODE_SOURCE_STRING
public static final String REQUESTED_BY_STRING
public static final String HAS_BEEN_SUCCESSFULLY
public static final Map<org.objectweb.proactive.core.UniqueID,Client> clients
Client
public static TopologyManager topologyManager
public RMCore()
public RMCore(String id, org.objectweb.proactive.core.node.Node nodeRM) throws org.objectweb.proactive.ActiveObjectCreationException, org.objectweb.proactive.core.node.NodeException
id
- Name for RMCOre.nodeRM
- Name of the ProActive Node object containing RM active
objects.org.objectweb.proactive.ActiveObjectCreationException
- if creation of the active object failed.org.objectweb.proactive.core.node.NodeException
- if a problem occurs on the target node.public RMCore(Map<String,NodeSource> deployedNodeSources, Map<String,RMNode> allNodes, Client caller, RMMonitoringImpl monitoring, SelectionManager manager, List<RMNode> freeNodesList, RMDBManager newDataBaseManager)
public void initActivity(org.objectweb.proactive.Body body)
RMConstants.DEFAULT_STATIC_SOURCE_NAME
. Finally, it throws the RM
started event.initActivity
in interface org.objectweb.proactive.InitActive
body
- the active object's body.protected void signalRMCoreIsInitialized()
protected void initiateRecoveryIfRequired()
public void runActivity(org.objectweb.proactive.Body body)
runActivity
in interface org.objectweb.proactive.RunActive
protected RMNode getNodeByUrlIncludingDeployingNodes(String url)
public org.objectweb.proactive.core.util.wrapper.BooleanWrapper setFreeNodes(List<RMNode> nodes)
nodes
- to be freepublic void internalAddNodeToCore(RMNode configuredNode)
RMNodeConfigurator
active object.configuredNode
- the node that is going to be added.public int getTotalAliveNodesNumber()
public org.objectweb.proactive.core.util.wrapper.BooleanWrapper registerAvailableNode(RMNode rmNode)
rmNode
- the node to make availablepublic void internalRegisterConfiguringNode(RMNode rmnode)
RMNodeConfigurator
to notify the core that the
process of configuring the rmnode has started. The end of the process will be
notified thanks to the method internalAddNodeToCore(RMNode)rmnode
- the node in the configuration statepublic String getId()
public org.objectweb.proactive.core.util.wrapper.BooleanWrapper addNode(String nodeUrl)
addNode
in interface ResourceManager
nodeUrl
- URL of the node to add.public org.objectweb.proactive.core.util.wrapper.BooleanWrapper addNode(String nodeUrl, String sourceName)
addNode
in interface ResourceManager
nodeUrl
- URL of the node to add.sourceName
- name of the static node source that will handle the nodepublic org.objectweb.proactive.core.util.wrapper.BooleanWrapper acquireNodes(String sourceName, int numberNodes, long timeout, Map<String,?> nodeConfiguration)
ResourceManager
acquireNodes
in interface ResourceManager
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 nodespublic org.objectweb.proactive.core.util.wrapper.BooleanWrapper removeNode(String nodeUrl, boolean preempt)
removeNode
in interface ResourceManager
nodeUrl
- URL of the node to remove.preempt
- if true remove the node immediately without waiting while it will be freed. ( ignored if deploying node )public org.objectweb.proactive.core.util.wrapper.BooleanWrapper removeNode(String nodeUrl, boolean preempt, boolean isTriggeredFromShutdownHook)
public void removeNodes(int number, String nodeSourceName, boolean preemptive)
number
- amount of nodes to be releasednodeSourceName
- a node source namepreemptive
- if true remove nodes immediately without waiting while they will be freedpublic void removeAllNodes(String nodeSourceName, boolean preemptive)
nodeSourceName
- a name of the node sourcepreemptive
- if true remove nodes immediately without waiting while they will be freedpublic void removeAllNodes(String nodeSourceName, boolean preemptive, boolean isTriggeredFromShutdownHook)
nodeSourceName
- a name of the node sourcepreemptive
- if true remove nodes immediately without waiting while they will be freedisTriggeredFromShutdownHook
- boolean saying if the calling is performed from a shutdown hook.public org.objectweb.proactive.core.util.wrapper.BooleanWrapper nodeIsAvailable(String nodeUrl)
nodeIsAvailable
in interface ResourceManager
nodeUrl
- the tested node.public Set<String> setNodesAvailable(Set<String> nodeUrls)
The method is defined as Immediate Service. This way it is executed in a dedicated Thread. It is essential in order to allow other methods to be executed immediately even if incoming connection to the Nodes is stopped or filtered while a timeout occurs when this method tries to send back a reply.
The allNodes
data-structure is written by a single Thread only
but read by multiple Threads.
Parallel executions of this method must involves different nodeUrl
s.
The underlying calls to setBusyNode
and internalSetFree
are writing to the freeNodes
data-structure. It explains why this last
is synchronized (thread-safe).
setNodesAvailable
in interface ResourceManager
nodeUrls
- the URLs of the workers associated to the node that publishes the update.public org.objectweb.proactive.core.util.wrapper.BooleanWrapper defineNodeSource(String nodeSourceName, String infrastructureType, Object[] infraParams, String policyType, Object[] policyParams, boolean nodesRecoverable)
defineNodeSource
in interface ResourceManager
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 crashpublic org.objectweb.proactive.core.util.wrapper.BooleanWrapper editNodeSource(String nodeSourceName, String infrastructureType, Object[] infraParams, String policyType, Object[] policyParams, boolean nodesRecoverable)
editNodeSource
in interface ResourceManager
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 crashpublic Map<String,NodeSourceDescriptor> getDeployedNodeSources()
public org.objectweb.proactive.core.util.wrapper.BooleanWrapper updateDynamicParameters(String nodeSourceName, String infrastructureType, Object[] infraParams, String policyType, Object[] policyParams)
updateDynamicParameters
in interface ResourceManager
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 public 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)
createNodeSource
in interface ResourceManager
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 crashpublic org.objectweb.proactive.core.util.wrapper.BooleanWrapper deployNodeSource(String nodeSourceName)
deployNodeSource
in interface ResourceManager
nodeSourceName
- the name of the node source to deploypublic void recoverNodeSource(NodeSourceDescriptor nodeSourceDescriptor)
defineNodeSource(java.lang.String, java.lang.String, java.lang.Object[], java.lang.String, java.lang.Object[], boolean)
and deployNodeSource(java.lang.String)
but this version does not emit events as the recovered node sources are
supposed to have been created and deployed already in the past.nodeSourceDescriptor
- the descriptor of the node source to recoverpublic org.objectweb.proactive.core.util.wrapper.BooleanWrapper undeployNodeSource(String nodeSourceName, boolean preempt)
undeployNodeSource
in interface ResourceManager
nodeSourceName
- the name of the node source to undeploypreempt
- if true remove the nodes immediately without waiting them to be freed.public org.objectweb.proactive.core.util.wrapper.BooleanWrapper redeployNodeSource(String nodeSourceName)
redeployNodeSource
in interface ResourceManager
nodeSourceName
- the name of the node source to redeploypublic org.objectweb.proactive.core.util.wrapper.BooleanWrapper shutdown(boolean preempt)
shutdown
in interface ResourceManager
public org.objectweb.proactive.core.util.wrapper.BooleanWrapper releaseNode(org.objectweb.proactive.core.node.Node node)
releaseNode
in interface ResourceManager
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.public org.objectweb.proactive.core.util.wrapper.BooleanWrapper releaseNodes(NodeSet nodes)
releaseNodes
in interface ResourceManager
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.public NodeSet getAtMostNodes(int nbNodes, 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.
getAtMostNodes
in interface ResourceManager
nbNodes
- the number of nodesselectionScript
- criterion to be verified by the returned nodespublic 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.
getAtMostNodes
in interface ResourceManager
number
- the number of nodesselectionScript
- criterion to be verified by the returned nodesexclusion
- a list of node which should not be in the result setpublic NodeSet getAtMostNodes(int number, List<SelectionScript> scripts, 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.
getAtMostNodes
in interface ResourceManager
number
- the number of nodesscripts
- criteria to be verified by the returned nodesexclusion
- a list of node which should not be in the result setpublic NodeSet getAtMostNodes(int number, TopologyDescriptor descriptor, List<SelectionScript> selectionScrips, NodeSet exclusion)
ResourceManager
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.
getAtMostNodes
in interface ResourceManager
number
- the number of nodesdescriptor
- the topology descriptor of nodesselectionScrips
- criteria to be verified by the returned nodesexclusion
- a list of node which should not be in the result setTopologyDescriptor
public RMDBManager getDbManager()
public NodeSet getNodes(int number, TopologyDescriptor topology, List<SelectionScript> selectionScrips, 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.
getNodes
in interface ResourceManager
number
- the number of nodestopology
- the topology descriptor of nodesselectionScrips
- 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
public NodeSet getNodes(Criteria criteria)
ResourceManager
getNodes
in interface ResourceManager
criteria
- criteria to select nodesCriteria
public NodeSet getExactlyNodes(int nb, SelectionScript selectionScript)
public RMInitialState getRMInitialState()
public RMMonitoring getMonitoring()
getMonitoring
in interface ResourceManager
public org.objectweb.proactive.core.util.wrapper.StringWrapper getRMThreadDump()
ResourceManager
Node
of the Resource Manager.getRMThreadDump
in interface ResourceManager
public org.objectweb.proactive.core.util.wrapper.StringWrapper getNodeThreadDump(String nodeUrl)
ResourceManager
Node
identified by the given URL.getNodeThreadDump
in interface ResourceManager
nodeUrl
- node to ask the thread dump topublic Set<String> listAliveNodeUrls()
ResourceManager
listAliveNodeUrls
in interface ResourceManager
public Set<String> listAliveNodeUrls(Set<String> nodeSourceNames)
ResourceManager
listAliveNodeUrls
in interface ResourceManager
nodeSourceNames
- set of node sources containing the nodes.public Set<String> listNodeUrls()
ResourceManager
listNodeUrls
in interface ResourceManager
public org.objectweb.proactive.core.util.wrapper.BooleanWrapper nodeSourceUnregister(String nodeSourceName, NodeSourceStatus nodeSourceStatus, RMNodeSourceEvent evt)
public void setBusyNode(String nodeUrl, Client owner) throws NotConnectedException
NotConnectedException
public void setBusyNode(String nodeUrl, Client owner, Map<String,String> usageInfo) throws NotConnectedException
owner
- nodeUrl
- node to setNotConnectedException
public void setBusyNodes(List<String> nodeUrlList, Client owner, List<Map<String,String>> usageInfoList, int usageInfoCriteriaSize) throws NotConnectedException
nodeUrlList
- list of node to mark as busyowner
- who is using the nodesusageInfoList
- list of usage information for each nodeusageInfoCriteriaSize
- original size of the usage information criteriaNotConnectedException
public void setDownNode(String nodeUrl)
public void registerAndEmitNodeEvent(RMNodeEvent event)
public org.objectweb.proactive.core.util.wrapper.BooleanWrapper removeNodeFromCore(String nodeUrl)
nodeUrl
- down node to be removedpublic org.objectweb.proactive.core.util.wrapper.IntWrapper getNodeSourcePingFrequency(String sourceName)
getNodeSourcePingFrequency
in interface ResourceManager
sourceName
- name of the node sourcepublic org.objectweb.proactive.core.util.wrapper.BooleanWrapper setNodeSourcePingFrequency(int frequency, String sourceName)
setNodeSourcePingFrequency
in interface ResourceManager
frequency
- the frequency to set to the node source in ms.sourceName
- name of the node source to set the frequencypublic List<RMNodeSourceEvent> getExistingNodeSourcesList()
getExistingNodeSourcesList
in interface ResourceManager
@Deprecated public List<RMNodeEvent> getNodesList()
public org.objectweb.proactive.core.util.wrapper.BooleanWrapper removeNodeSource(String nodeSourceName, boolean preempt)
removeNodeSource
in interface ResourceManager
nodeSourceName
- name of the source to remove.preempt
- if true remove the node immediately without waiting while it will be freed.public RMState getState()
RMMonitoring
.getState() method.getState
in interface ResourceManager
public org.objectweb.proactive.core.util.wrapper.BooleanWrapper isActive()
isActive
in interface ResourceManager
protected Client checkPermissionAndGetClientIsSuccessful()
public org.objectweb.proactive.core.util.wrapper.BooleanWrapper disconnect()
disconnect
in interface ResourceManager
public void disconnect(org.objectweb.proactive.core.UniqueID clientId)
public Collection<PluginDescriptor> getSupportedNodeSourceInfrastructures()
getSupportedNodeSourceInfrastructures
in interface ResourceManager
public Collection<PluginDescriptor> getSupportedNodeSourcePolicies()
getSupportedNodeSourcePolicies
in interface ResourceManager
public NodeSourceConfiguration getNodeSourceConfiguration(String nodeSourceName)
getNodeSourceConfiguration
in interface ResourceManager
public boolean checkPermission(String methodName) throws SecurityException
ServiceUsingPermission
checkPermission
in interface ServiceUsingPermission
methodName
- method nameSecurityException
- if the user is not allowed to execute this methodpublic Topology getTopology()
ResourceManager
getTopology
in interface ResourceManager
public org.objectweb.proactive.core.util.wrapper.BooleanWrapper lockNodes(Set<String> urls)
lockNodes
in interface ResourceManager
urls
- is a set of nodestrue
if all the nodes become locked, false
otherwise.public org.objectweb.proactive.core.util.wrapper.BooleanWrapper lockNodes(Set<String> urls, Client caller)
public org.objectweb.proactive.core.util.wrapper.BooleanWrapper unlockNodes(Set<String> urls)
unlockNodes
in interface ResourceManager
urls
- is a set of nodes to be unlocked.true
if all the nodes are unlocked with success, false
otherwise.public org.objectweb.proactive.core.util.wrapper.BooleanWrapper isNodeAdmin(String nodeUrl)
isNodeAdmin
in interface ResourceManager
public org.objectweb.proactive.core.util.wrapper.BooleanWrapper isNodeUser(String nodeUrl)
isNodeUser
in interface ResourceManager
public List<ScriptResult<Object>> executeScript(String script, String scriptEngine, String targetType, Set<String> targets)
ResourceManager
executeScript
in interface ResourceManager
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.public <T> List<ScriptResult<T>> executeScript(Script<T> script, String targetType, Set<String> targets)
executeScript
in interface ResourceManager
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.public boolean setDeploying(RMNode rmNode)
public org.objectweb.proactive.core.util.wrapper.StringWrapper getCurrentUser()
ResourceManager
getCurrentUser
in interface ResourceManager
public UserData getCurrentUserData()
ResourceManager
getCurrentUserData
in interface ResourceManager
public void releaseBusyNodesNotInList(List<NodeSet> nodesToNotRelease)
ResourceManager
releaseBusyNodesNotInList
in interface ResourceManager
nodesToNotRelease
- nodes that should not be releasedpublic boolean areNodesKnown(NodeSet nodes)
ResourceManager
areNodesKnown
in interface ResourceManager
nodes
- the node set to verifypublic Map<String,Boolean> areNodesRecoverable(NodeSet nodes)
ResourceManager
areNodesRecoverable
in interface ResourceManager
nodes
- the node set to verifypublic void setNeededNodes(int neededNodes)
ResourceManager
setNeededNodes
in interface ResourceManager
neededNodes
- number of nodes neededpublic Map<String,List<String>> getInfrasToPoliciesMapping()
ResourceManager
getInfrasToPoliciesMapping
in interface ResourceManager
public List<RMNodeHistory> getNodesHistory(long windowStart, long windowEnd)
ResourceManager
getNodesHistory
in interface ResourceManager
windowStart
- period start timewindowEnd
- period end timepublic void addNodeToken(String nodeUrl, String token) throws RMException
ResourceManager
addNodeToken
in interface ResourceManager
nodeUrl
- url of the nodetoken
- token to addRMException
public List<String> getNodeTokens(String nodeUrl) throws RMException
ResourceManager
getNodeTokens
in interface ResourceManager
nodeUrl
- url of the nodeRMException
public Map<String,List<String>> getAllNodesTokens() throws RMException
ResourceManager
getAllNodesTokens
in interface ResourceManager
RMException
public Map<String,List<String>> getAllEligibleNodesTokens() throws RMException
ResourceManager
getAllEligibleNodesTokens
in interface ResourceManager
RMException
public Set<String> getNodeTags(String nodeUrl) throws RMException
ResourceManager
getNodeTags
in interface ResourceManager
nodeUrl
- url of the nodeRMException
public Set<String> getNodesByTag(String tag)
ResourceManager
getNodesByTag
in interface ResourceManager
tag
- the expected tag which should be contained in the returned nodepublic Set<String> getNodesByTags(Set<String> tags, boolean all)
ResourceManager
getNodesByTags
in interface ResourceManager
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.public void removeNodeToken(String nodeUrl, String token) throws RMException
ResourceManager
removeNodeToken
in interface ResourceManager
nodeUrl
- url of the nodetoken
- token to removeRMException
public void setNodeTokens(String nodeUrl, List<String> tokens) throws RMException
ResourceManager
setNodeTokens
in interface ResourceManager
nodeUrl
- url of the nodetokens
- list of tokensRMException
public org.objectweb.proactive.core.util.wrapper.BooleanWrapper checkNodePermission(String nodeUrl, boolean provider)
ResourceManager
checkNodePermission
in interface ResourceManager
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 providerResourceManager.checkNodePermission(String, boolean)
public org.objectweb.proactive.core.util.wrapper.BooleanWrapper checkNodeSourcePermission(String nodeSourceName, boolean provider)
ResourceManager
checkNodeSourcePermission
in interface ResourceManager
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 providerResourceManager.checkNodeSourcePermission(String, boolean)