Record Class ServerResources

java.lang.Object
java.lang.Record
cloud.spawnery.agent.api.ServerResources
Record Components:
memoryRequest - the memory the server's pod requests
memoryLimit - the memory limit of the server's pod
cpuRequest - the CPU the server's pod requests
cpuLimit - the CPU limit of the server's pod
heap - the JVM's maximum heap, empty when no heap was chosen; the server then runs with MaxRAMPercentage or 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 Details

  • Constructor Details

  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • memoryRequest

      public Optional<String> memoryRequest()
      Returns the value of the memoryRequest record component.
      Returns:
      the value of the memoryRequest record component
    • memoryLimit

      public Optional<String> memoryLimit()
      Returns the value of the memoryLimit record component.
      Returns:
      the value of the memoryLimit record component
    • cpuRequest

      public Optional<String> cpuRequest()
      Returns the value of the cpuRequest record component.
      Returns:
      the value of the cpuRequest record component
    • cpuLimit

      public Optional<String> cpuLimit()
      Returns the value of the cpuLimit record component.
      Returns:
      the value of the cpuLimit record component
    • heap

      public Optional<String> heap()
      Returns the value of the heap record component.
      Returns:
      the value of the heap record component