java.lang.Object
org.elasticsearch.xpack.core.ml.inference.assignment.RoutingInfo
All Implemented Interfaces:
Writeable, org.elasticsearch.xcontent.ToXContent, org.elasticsearch.xcontent.ToXContentObject

public class RoutingInfo extends Object implements org.elasticsearch.xcontent.ToXContentObject, Writeable
  • Constructor Details

    • RoutingInfo

      public RoutingInfo(int currentAllocations, int targetAllocations, RoutingState state, String reason)
      RoutingInfo defines the state of a particular trained model assignment on a particular node.
      Parameters:
      currentAllocations - The number of allocations currently running on a node.
      targetAllocations - The number of allocations that have been assigned to a node, and will run on the node. Should never be higher than the number of available processors on the node.
      state - Indicates the availability of the allocations on the node.
      reason - Will contain the reason that currentAllocations != targetAllocations, if applicable, otherwise empty string.
    • RoutingInfo

      public RoutingInfo(StreamInput in) throws IOException
      Throws:
      IOException
  • Method Details

    • fromXContent

      public static RoutingInfo fromXContent(org.elasticsearch.xcontent.XContentParser parser)
    • getCurrentAllocations

      public int getCurrentAllocations()
      Returns:
      The number of allocations currently running on a node.
    • getTargetAllocations

      public int getTargetAllocations()
      Returns:
      The number of allocations that have been assigned to a node, and will run on the node. Should never be higher than the number of available processors on the node.
    • getFailedAllocations

      public int getFailedAllocations()
    • getState

      public RoutingState getState()
    • getReason

      @Nullable public String getReason()
    • isOutdated

      public boolean isOutdated()
    • writeTo

      public void writeTo(StreamOutput out) throws IOException
      Specified by:
      writeTo in interface Writeable
      Throws:
      IOException
    • toXContent

      public org.elasticsearch.xcontent.XContentBuilder toXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) throws IOException
      Specified by:
      toXContent in interface org.elasticsearch.xcontent.ToXContent
      Throws:
      IOException
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isRoutable

      public boolean isRoutable()