java.lang.Object
org.elasticsearch.xpack.core.ml.inference.assignment.TrainedModelAssignment
All Implemented Interfaces:
Diffable<TrainedModelAssignment>, SimpleDiffable<TrainedModelAssignment>, Writeable, org.elasticsearch.xcontent.ToXContent, org.elasticsearch.xcontent.ToXContentObject

public final class TrainedModelAssignment extends Object implements SimpleDiffable<TrainedModelAssignment>, org.elasticsearch.xcontent.ToXContentObject
Trained model assignment object that contains assignment options and the assignment routing table
  • Field Details

    • ADAPTIVE_ALLOCATIONS

      public static final org.elasticsearch.xcontent.ParseField ADAPTIVE_ALLOCATIONS
  • Constructor Details

  • Method Details

    • useNewMemoryFields

      public static boolean useNewMemoryFields(TransportVersion minClusterVersion)
    • fromXContent

      public static TrainedModelAssignment fromXContent(org.elasticsearch.xcontent.XContentParser parser) throws IOException
      Throws:
      IOException
    • isRoutedToNode

      public boolean isRoutedToNode(String nodeId)
    • getNodeRoutingTable

      public Map<String,RoutingInfo> getNodeRoutingTable()
      Returns:
      shows where allocations for this assignment/deployment are located (on which nodes)
    • getModelId

      public String getModelId()
    • getDeploymentId

      public String getDeploymentId()
    • getTaskParams

    • getAssignmentState

      public AssignmentState getAssignmentState()
    • getStartedNodes

      public String[] getStartedNodes()
    • hasStartedRoutes

      public boolean hasStartedRoutes()
    • selectRandomNodesWeighedOnAllocations

      public List<org.elasticsearch.core.Tuple<String,Integer>> selectRandomNodesWeighedOnAllocations(int numberOfRequests, RoutingState... acceptableStates)
    • getReason

      public Optional<String> getReason()
    • getStartTime

      public Instant getStartTime()
    • getMaxAssignedAllocations

      public int getMaxAssignedAllocations()
    • getAdaptiveAllocationsSettings

      public AdaptiveAllocationsSettings getAdaptiveAllocationsSettings()
    • isSatisfied

      public boolean isSatisfied(Set<String> assignableNodeIds)
    • hasOutdatedRoutingEntries

      public boolean hasOutdatedRoutingEntries()
    • totalCurrentAllocations

      public int totalCurrentAllocations()
    • totalTargetAllocations

      public int totalTargetAllocations()
    • totalTargetProcessors

      public int totalTargetProcessors()
    • totalFailedAllocations

      public int totalFailedAllocations()
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object
    • 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
    • writeTo

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

      public Optional<AllocationStatus> calculateAllocationStatus()