Class ElasticsearchServiceSettings.Builder
java.lang.Object
co.elastic.clients.util.ObjectBuilderBase
co.elastic.clients.util.WithJsonObjectBuilderBase<ElasticsearchServiceSettings.Builder>
co.elastic.clients.elasticsearch.inference.ElasticsearchServiceSettings.Builder
- All Implemented Interfaces:
WithJson<ElasticsearchServiceSettings.Builder>
,ObjectBuilder<ElasticsearchServiceSettings>
- Enclosing class:
- ElasticsearchServiceSettings
public static class ElasticsearchServiceSettings.Builder
extends WithJsonObjectBuilderBase<ElasticsearchServiceSettings.Builder>
implements ObjectBuilder<ElasticsearchServiceSettings>
Builder for
ElasticsearchServiceSettings
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdaptive allocations configuration details.Adaptive allocations configuration details.build()
Builds aElasticsearchServiceSettings
.deploymentId
(String value) The deployment identifier for a trained model deployment.Required - The name of the model to use for the inference task.numAllocations
(Integer value) The total number of allocations that are assigned to the model across machine learning nodes.numThreads
(int value) Required - The number of threads used by each model allocation during inference.protected ElasticsearchServiceSettings.Builder
self()
Methods inherited from class co.elastic.clients.util.WithJsonObjectBuilderBase
withJson
Methods inherited from class co.elastic.clients.util.ObjectBuilderBase
_checkSingleUse, _listAdd, _listAddAll, _mapPut, _mapPutAll
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
adaptiveAllocations
public final ElasticsearchServiceSettings.Builder adaptiveAllocations(@Nullable AdaptiveAllocations value) Adaptive allocations configuration details. Ifenabled
is true, the number of allocations of the model is set based on the current load the process gets. When the load is high, a new model allocation is automatically created, respecting the value ofmax_number_of_allocations
if it's set. When the load is low, a model allocation is automatically removed, respecting the value ofmin_number_of_allocations
if it's set. Ifenabled
is true, do not set the number of allocations manually.API name:
adaptive_allocations
-
adaptiveAllocations
public final ElasticsearchServiceSettings.Builder adaptiveAllocations(Function<AdaptiveAllocations.Builder, ObjectBuilder<AdaptiveAllocations>> fn) Adaptive allocations configuration details. Ifenabled
is true, the number of allocations of the model is set based on the current load the process gets. When the load is high, a new model allocation is automatically created, respecting the value ofmax_number_of_allocations
if it's set. When the load is low, a model allocation is automatically removed, respecting the value ofmin_number_of_allocations
if it's set. Ifenabled
is true, do not set the number of allocations manually.API name:
adaptive_allocations
-
deploymentId
The deployment identifier for a trained model deployment. Whendeployment_id
is used themodel_id
is optional.API name:
deployment_id
-
modelId
Required - The name of the model to use for the inference task. It can be the ID of a built-in model (for example,.multilingual-e5-small
for E5) or a text embedding model that was uploaded by using the Eland client.API name:
model_id
-
numAllocations
The total number of allocations that are assigned to the model across machine learning nodes. Increasing this value generally increases the throughput. If adaptive allocations are enabled, do not set this value because it's automatically set.API name:
num_allocations
-
numThreads
Required - The number of threads used by each model allocation during inference. This setting generally increases the speed per inference request. The inference process is a compute-bound process;threads_per_allocations
must not exceed the number of available allocated processors per node. The value must be a power of 2. The maximum value is 32.API name:
num_threads
-
self
- Specified by:
self
in classWithJsonObjectBuilderBase<ElasticsearchServiceSettings.Builder>
-
build
Builds aElasticsearchServiceSettings
.- Specified by:
build
in interfaceObjectBuilder<ElasticsearchServiceSettings>
- Throws:
NullPointerException
- if some of the required fields are null.
-