Class ContainerMemoryTracker
java.lang.Object
org.apache.storm.daemon.supervisor.ContainerMemoryTracker
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionlong
getAssignedWorkerCount
(String topologyId) Gets the number of worker ports assigned to the given topology id on this supervisor.long
getReservedMemoryMb
(String topologyId) Gets the memory reserved by the given topology across all ports on this supervisor.getUsedMemoryMb
(int port) Get the memory used by the worker on the given port.long
getUsedMemoryMb
(String topologyId) Gets the memory used by the given topology across all ports on this supervisor.void
remove
(int port) Clears the topology assignment and tracked memory for the given port.void
setReservedMemoryMb
(int port, String topologyId, long reservedMemoryMb) Sets the reserved memory for the given port and topology id.void
setUsedMemoryMb
(int port, String topologyId, long usedMemoryMb) Assigns the given topology id to the given port, and sets the used memory for that port and topology id.
-
Constructor Details
-
ContainerMemoryTracker
-
-
Method Details
-
getUsedMemoryMb
Get the memory used by the worker on the given port.- Parameters:
port
- The worker port- Returns:
- The memory used by the worker, or empty if no worker exists on the given port.
-
getUsedMemoryMb
Gets the memory used by the given topology across all ports on this supervisor.- Parameters:
topologyId
- The topology id- Returns:
- The memory used by the given topology id
-
getReservedMemoryMb
Gets the memory reserved by the given topology across all ports on this supervisor.- Parameters:
topologyId
- The topology id- Returns:
- The memory reserved by the given topology id
-
getAssignedWorkerCount
Gets the number of worker ports assigned to the given topology id on this supervisor.- Parameters:
topologyId
- The topology id- Returns:
- The number of worker ports assigned to the given topology.
-
remove
public void remove(int port) Clears the topology assignment and tracked memory for the given port.- Parameters:
port
- The worker port
-
setUsedMemoryMb
Assigns the given topology id to the given port, and sets the used memory for that port and topology id.- Parameters:
port
- The worker porttopologyId
- The topology idusedMemoryMb
- The memory used by the topology
-
setReservedMemoryMb
Sets the reserved memory for the given port and topology id.- Parameters:
port
- The worker porttopologyId
- The topology idreservedMemoryMb
- The memory reserved by the topology
-