Package cloud.spawnery.agent.api
Record Class ServerResources
java.lang.Object
java.lang.Record
cloud.spawnery.agent.api.ServerResources
- Record Components:
memoryRequest- the memory the server's pod requestsmemoryLimit- the memory limit of the server's podcpuRequest- the CPU the server's pod requestscpuLimit- the CPU limit of the server's podheap- the JVM's maximum heap, empty when no heap was chosen; the server then runs withMaxRAMPercentageor the group's own-Xmx
public record ServerResources(Optional<String> memoryRequest, Optional<String> memoryLimit, Optional<String> cpuRequest, Optional<String> cpuLimit, Optional<String> heap)
extends Record
The resources of one private server, as quantities in Kubernetes notation.
A component is empty where neither the group nor the network sets it, and
for every component of a member started in a group without
memberResources.
Quantities come back in the operator's canonical form: a start asked
for 7168Mi reports 7Gi. Compare them as quantities, not as
strings.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncpuLimit()Returns the value of thecpuLimitrecord component.Returns the value of thecpuRequestrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.heap()Returns the value of theheaprecord component.Returns the value of thememoryLimitrecord component.Returns the value of thememoryRequestrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
NONE
No component set.
-
-
Constructor Details
-
ServerResources
public ServerResources(Optional<String> memoryRequest, Optional<String> memoryLimit, Optional<String> cpuRequest, Optional<String> cpuLimit, Optional<String> heap) Creates an instance of aServerResourcesrecord class.- Parameters:
memoryRequest- the value for thememoryRequestrecord componentmemoryLimit- the value for thememoryLimitrecord componentcpuRequest- the value for thecpuRequestrecord componentcpuLimit- the value for thecpuLimitrecord componentheap- the value for theheaprecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
memoryRequest
Returns the value of thememoryRequestrecord component.- Returns:
- the value of the
memoryRequestrecord component
-
memoryLimit
Returns the value of thememoryLimitrecord component.- Returns:
- the value of the
memoryLimitrecord component
-
cpuRequest
Returns the value of thecpuRequestrecord component.- Returns:
- the value of the
cpuRequestrecord component
-
cpuLimit
Returns the value of thecpuLimitrecord component.- Returns:
- the value of the
cpuLimitrecord component
-
heap
Returns the value of theheaprecord component.- Returns:
- the value of the
heaprecord component
-