Module org.elasticsearch.xcore
Class InferModelAction.Request
java.lang.Object
org.elasticsearch.transport.TransportMessage
org.elasticsearch.transport.AbstractTransportRequest
org.elasticsearch.action.ActionRequest
org.elasticsearch.action.UntypedActionRequest
org.elasticsearch.xpack.core.ml.action.InferModelAction.Request
- All Implemented Interfaces:
Writeable,RefCounted,TaskAwareRequest,TransportRequest
- Enclosing class:
InferModelAction
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final TimeValuestatic final TimeValueIngest processors wait for an available inference slot.static final ParseFieldstatic final ParseFieldstatic final ParseFieldstatic final ParseFieldstatic final ParseFieldFields inherited from interface org.elasticsearch.core.RefCounted
ALWAYS_REFERENCED -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic InferModelAction.RequestforIngestDocs(String id, List<Map<String, Object>> docs, InferenceConfigUpdate update, boolean previouslyLicensed, TimeValue inferenceTimeout) Build a request from a list of documents as maps.static InferModelAction.RequestforTextInput(String id, InferenceConfigUpdate update, List<String> textInput, boolean previouslyLicensed, TimeValue inferenceTimeout) Build a request from a list of strings, each string is one evaluation of the model.getId()inthashCode()booleanbooleanbooleanintparseRequest(String id, XContentParser parser) voidsetChunked(boolean chunked) voidsetHighPriority(boolean highPriority) voidsetPrefixType(TrainedModelPrefixStrings.PrefixType prefixType) validate()voidwriteTo(StreamOutput out) Methods inherited from class org.elasticsearch.action.ActionRequest
getShouldStoreResultMethods inherited from class org.elasticsearch.transport.AbstractTransportRequest
copyFieldsFrom, getParentTask, getRequestId, remoteAddress, remoteAddress, setParentTask, setRequestId, toStringMethods inherited from class org.elasticsearch.transport.TransportMessage
decRef, hasReferences, incRef, tryIncRefMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.core.RefCounted
decRef, hasReferences, incRef, mustIncRef, tryIncRefMethods inherited from interface org.elasticsearch.tasks.TaskAwareRequest
createTask, getDescription, setParentTask
-
Field Details
-
ID
-
DEPLOYMENT_ID
-
DOCS
-
TIMEOUT
-
INFERENCE_CONFIG
-
DEFAULT_TIMEOUT_FOR_API
-
DEFAULT_TIMEOUT_FOR_INGEST
Ingest processors wait for an available inference slot. Two hours is intentionally generous to avoid spurious timeouts under load, while preventing indefinite hangs caused by inference errors that require node restart to recover.
-
-
Constructor Details
-
Request
- Throws:
IOException
-
-
Method Details
-
parseRequest
-
forIngestDocs
public static InferModelAction.Request forIngestDocs(String id, List<Map<String, Object>> docs, InferenceConfigUpdate update, boolean previouslyLicensed, TimeValue inferenceTimeout) Build a request from a list of documents as maps.- Parameters:
id- The model Iddocs- List of document mapsupdate- Inference config updatepreviouslyLicensed- License has been checked previously and can now be skippedinferenceTimeout- The inference timeout (how long the request waits in the inference queue for)- Returns:
- the new Request
-
forTextInput
public static InferModelAction.Request forTextInput(String id, InferenceConfigUpdate update, List<String> textInput, boolean previouslyLicensed, TimeValue inferenceTimeout) Build a request from a list of strings, each string is one evaluation of the model.- Parameters:
id- The model Idupdate- Inference config updatetextInput- Inference inputpreviouslyLicensed- License has been checked previously and can now be skippedinferenceTimeout- The inference timeout (how long the request waits in the inference queue for)- Returns:
- the new Request
-
numberOfDocuments
public int numberOfDocuments() -
getId
-
getObjectsToInfer
-
getTextInput
-
getUpdate
-
isPreviouslyLicensed
public boolean isPreviouslyLicensed() -
getInferenceTimeout
-
isHighPriority
public boolean isHighPriority() -
setHighPriority
public void setHighPriority(boolean highPriority) -
setPrefixType
-
getPrefixType
-
setChunked
public void setChunked(boolean chunked) -
isChunked
public boolean isChunked() -
validate
- Specified by:
validatein classActionRequest
-
writeTo
- Specified by:
writeToin interfaceWriteable- Overrides:
writeToin classActionRequest- Throws:
IOException
-
equals
-
createTask
-
hashCode
public int hashCode()
-