Module org.elasticsearch.xcore
Class TrainedModelAssignment
java.lang.Object
org.elasticsearch.xpack.core.ml.inference.assignment.TrainedModelAssignment
- All Implemented Interfaces:
Diffable<TrainedModelAssignment>,SimpleDiffable<TrainedModelAssignment>,Writeable,ToXContent,ToXContentObject
public final class TrainedModelAssignment
extends Object
implements SimpleDiffable<TrainedModelAssignment>, ToXContentObject
Trained model assignment object that contains assignment options and the assignment routing table
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.elasticsearch.cluster.SimpleDiffable
SimpleDiffable.CompleteDiff<T extends Diffable<T>>Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsFields inherited from interface org.elasticsearch.cluster.SimpleDiffable
EMPTYFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic TrainedModelAssignmentfromXContent(XContentParser parser) intString[]inthashCode()booleanbooleanbooleanisRoutedToNode(String nodeId) booleanisSatisfied(Set<String> assignableNodeIds) selectRandomNodesWeighedOnAllocations(int numberOfRequests, RoutingState... acceptableStates) intintintinttoXContent(XContentBuilder builder, ToXContent.Params params) voidwriteTo(StreamOutput out) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.cluster.SimpleDiffable
diffMethods inherited from interface org.elasticsearch.xcontent.ToXContentObject
isFragment
-
Field Details
-
ADAPTIVE_ALLOCATIONS
-
-
Constructor Details
-
TrainedModelAssignment
- Throws:
IOException
-
-
Method Details
-
fromXContent
- Throws:
IOException
-
isRoutedToNode
-
getNodeRoutingTable
- Returns:
- shows where allocations for this assignment/deployment are located (on which nodes)
-
getModelId
-
getDeploymentId
-
getTaskParams
-
getAssignmentState
-
getStartedNodes
-
hasStartedRoutes
public boolean hasStartedRoutes() -
selectRandomNodesWeighedOnAllocations
public List<Tuple<String,Integer>> selectRandomNodesWeighedOnAllocations(int numberOfRequests, RoutingState... acceptableStates) -
getReason
-
getStartTime
-
getMaxAssignedAllocations
public int getMaxAssignedAllocations() -
getAdaptiveAllocationsSettings
-
isSatisfied
-
hasOutdatedRoutingEntries
public boolean hasOutdatedRoutingEntries() -
totalCurrentAllocations
public int totalCurrentAllocations() -
totalTargetAllocations
public int totalTargetAllocations() -
totalTargetProcessors
public int totalTargetProcessors() -
totalFailedAllocations
public int totalFailedAllocations() -
equals
-
hashCode
public int hashCode() -
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
toXContentin interfaceToXContent- Throws:
IOException
-
writeTo
- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
calculateAllocationStatus
-