Class SystemLoad
java.lang.Object
org.opencastproject.serviceregistry.api.SystemLoad
Mappings between the registered hosts and their load factors.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA record of a node in the cluster and its load factor -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Map<String, SystemLoad.NodeLoad> The list of nodes and their current load -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a node to the map of load values, overwriting an existing entry if the node is already present in the mapbooleancontainsHost(String host) Returns true if the load map contains the host in question.Gets a specific host from the map, if present.Get the list of nodes and their current loadfactor.voidsetNodeLoads(Collection<SystemLoad.NodeLoad> newLoads) Sets the list of nodes and their current loadfactor.toString()voidupdateNodeLoad(String host, float modifier) Updates the load factor for a node
-
Field Details
-
nodeLoads
The list of nodes and their current load
-
-
Constructor Details
-
SystemLoad
public SystemLoad()No-arg constructor needed by JAXB
-
-
Method Details
-
getNodeLoads
Get the list of nodes and their current loadfactor.- Returns:
- the nodeLoads
-
setNodeLoads
Sets the list of nodes and their current loadfactor.- Parameters:
newLoads- the nodeLoads to set
-
updateNodeLoad
Updates the load factor for a node- Parameters:
host- The host to updatemodifier- The modifier to apply to the load- Throws:
NotFoundException
-
addNodeLoad
Adds a node to the map of load values, overwriting an existing entry if the node is already present in the map- Parameters:
load- the nodeLoad to add
-
get
Gets a specific host from the map, if present. If the node is not present, or the host value is null, this method returns null.- Parameters:
host- The hostname of the host you are interested in.- Returns:
- The specific host from the map, if present. If the node is not present, or the host value is null, this method returns null.
-
containsHost
Returns true if the load map contains the host in question.- Parameters:
host- The hostname of the host you are interested in.- Returns:
- True if the host is present, false if the host is not, or the host variable is null.
-
toString
-