Record Class ServiceUnitStateData

java.lang.Object
java.lang.Record
org.apache.pulsar.broker.loadbalance.extensions.channel.ServiceUnitStateData

public record ServiceUnitStateData(ServiceUnitState state, String dstBroker, String sourceBroker, Map<String,Optional<String>> splitServiceUnitToDestBroker, boolean force, long timestamp, long versionId) extends Record
Defines data for the service unit state changes. This data will be broadcast in ServiceUnitStateChannel.
  • Constructor Details

    • ServiceUnitStateData

      public ServiceUnitStateData(ServiceUnitState state, String dstBroker, String sourceBroker, Map<String,Optional<String>> splitServiceUnitToDestBroker, boolean force, long timestamp, long versionId)
      Creates an instance of a ServiceUnitStateData record class.
      Parameters:
      state - the value for the state record component
      dstBroker - the value for the dstBroker record component
      sourceBroker - the value for the sourceBroker record component
      splitServiceUnitToDestBroker - the value for the splitServiceUnitToDestBroker record component
      force - the value for the force record component
      timestamp - the value for the timestamp record component
      versionId - the value for the versionId record component
    • ServiceUnitStateData

      public ServiceUnitStateData(ServiceUnitState state, String dstBroker, String sourceBroker, Map<String,Optional<String>> splitServiceUnitToDestBroker, long versionId)
    • ServiceUnitStateData

      public ServiceUnitStateData(ServiceUnitState state, String dstBroker, String sourceBroker, Map<String,Optional<String>> splitServiceUnitToDestBroker, boolean force, long versionId)
    • ServiceUnitStateData

      public ServiceUnitStateData(ServiceUnitState state, String dstBroker, String sourceBroker, long versionId)
    • ServiceUnitStateData

      public ServiceUnitStateData(ServiceUnitState state, String dstBroker, String sourceBroker, boolean force, long versionId)
    • ServiceUnitStateData

      public ServiceUnitStateData(ServiceUnitState state, String dstBroker, long versionId)
    • ServiceUnitStateData

      public ServiceUnitStateData(ServiceUnitState state, String dstBroker, boolean force, long versionId)
  • Method Details

    • state

      public static ServiceUnitState state(ServiceUnitStateData data)
    • equals

      public 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • 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
    • state

      public ServiceUnitState state()
      Returns the value of the state record component.
      Returns:
      the value of the state record component
    • dstBroker

      public String dstBroker()
      Returns the value of the dstBroker record component.
      Returns:
      the value of the dstBroker record component
    • sourceBroker

      public String sourceBroker()
      Returns the value of the sourceBroker record component.
      Returns:
      the value of the sourceBroker record component
    • splitServiceUnitToDestBroker

      public Map<String,Optional<String>> splitServiceUnitToDestBroker()
      Returns the value of the splitServiceUnitToDestBroker record component.
      Returns:
      the value of the splitServiceUnitToDestBroker record component
    • force

      public boolean force()
      Returns the value of the force record component.
      Returns:
      the value of the force record component
    • timestamp

      public long timestamp()
      Returns the value of the timestamp record component.
      Returns:
      the value of the timestamp record component
    • versionId

      public long versionId()
      Returns the value of the versionId record component.
      Returns:
      the value of the versionId record component