public class ContainerMemoryTracker extends Object
Constructor and Description |
---|
ContainerMemoryTracker(StormMetricsRegistry metricsRegistry) |
Modifier and Type | Method and Description |
---|---|
long |
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.
|
Optional<Long> |
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.
|
public ContainerMemoryTracker(StormMetricsRegistry metricsRegistry)
public Optional<Long> getUsedMemoryMb(int port)
Get the memory used by the worker on the given port.
port
- The worker portpublic long getUsedMemoryMb(String topologyId)
Gets the memory used by the given topology across all ports on this supervisor.
topologyId
- The topology idpublic long getReservedMemoryMb(String topologyId)
Gets the memory reserved by the given topology across all ports on this supervisor.
topologyId
- The topology idpublic long getAssignedWorkerCount(String topologyId)
Gets the number of worker ports assigned to the given topology id on this supervisor.
topologyId
- The topology idpublic void remove(int port)
Clears the topology assignment and tracked memory for the given port.
port
- The worker portpublic 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.
port
- The worker porttopologyId
- The topology idusedMemoryMb
- The memory used by the topologypublic void setReservedMemoryMb(int port, String topologyId, long reservedMemoryMb)
Sets the reserved memory for the given port and topology id.
port
- The worker porttopologyId
- The topology idreservedMemoryMb
- The memory reserved by the topologyCopyright © 2022 The Apache Software Foundation. All rights reserved.