Skip to content

Commit

Permalink
fix compliation
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkyle committed Oct 10, 2023
1 parent e2f3b14 commit 29fa10a
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.elasticsearch.common.settings.IndexScopedSettings;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.settings.SettingsFilter;
import org.elasticsearch.core.TimeValue;
import org.elasticsearch.env.Environment;
import org.elasticsearch.env.NodeEnvironment;
import org.elasticsearch.indices.IndicesService;
Expand All @@ -32,6 +33,8 @@
import org.elasticsearch.rest.RestHandler;
import org.elasticsearch.script.ScriptService;
import org.elasticsearch.telemetry.TelemetryProvider;
import org.elasticsearch.threadpool.ExecutorBuilder;
import org.elasticsearch.threadpool.ScalingExecutorBuilder;
import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.watcher.ResourceWatcherService;
import org.elasticsearch.xcontent.NamedXContentRegistry;
Expand All @@ -58,6 +61,7 @@
public class InferencePlugin extends Plugin implements ActionPlugin, InferenceServicePlugin, SystemIndexPlugin {

public static final String NAME = "inference";
public static final String UTILITY_THREAD_POOL_NAME = "inference_utility";

@Override
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
Expand Down Expand Up @@ -135,6 +139,20 @@ public Collection<SystemIndexDescriptor> getSystemIndexDescriptors(Settings sett
);
}

@Override
public List<ExecutorBuilder<?>> getExecutorBuilders(Settings unused) {
ScalingExecutorBuilder utility = new ScalingExecutorBuilder(
UTILITY_THREAD_POOL_NAME,
0,
1,
TimeValue.timeValueMinutes(10),
false,
"xpack.inference.utility_thread_pool"
);

return List.of(utility);
}

@Override
public String getFeatureName() {
return "inference_plugin";
Expand Down

0 comments on commit 29fa10a

Please sign in to comment.