public class ScriptService extends AbstractComponent implements java.io.Closeable, ClusterStateListener
Modifier and Type | Class and Description |
---|---|
static class |
ScriptService.ScriptType
The type of a script, more specifically where it gets loaded from:
- provided dynamically at request time
- loaded from an index
- loaded from file
|
Modifier and Type | Field and Description |
---|---|
static Setting<java.lang.Boolean> |
SCRIPT_AUTO_RELOAD_ENABLED_SETTING |
static Setting<TimeValue> |
SCRIPT_CACHE_EXPIRE_SETTING |
static Setting<java.lang.Integer> |
SCRIPT_CACHE_SIZE_SETTING |
static Setting<java.lang.Integer> |
SCRIPT_MAX_COMPILATIONS_PER_MINUTE |
static Setting<java.lang.Integer> |
SCRIPT_MAX_SIZE_IN_BYTES |
deprecationLogger, logger, settings
Constructor and Description |
---|
ScriptService(Settings settings,
Environment env,
ResourceWatcherService resourceWatcherService,
ScriptEngineRegistry scriptEngineRegistry,
ScriptContextRegistry scriptContextRegistry,
ScriptSettings scriptSettings) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
clusterChanged(ClusterChangedEvent event)
Called when cluster state changes.
|
CompiledScript |
compile(Script script,
ScriptContext scriptContext,
java.util.Map<java.lang.String,java.lang.String> params)
Checks if a script can be executed and compiles it if needed, or returns the previously compiled and cached script.
|
void |
deleteStoredScript(ClusterService clusterService,
DeleteStoredScriptRequest request,
ActionListener<DeleteStoredScriptResponse> listener) |
ExecutableScript |
executable(CompiledScript compiledScript,
java.util.Map<java.lang.String,java.lang.Object> vars)
Executes a previously compiled script provided as an argument
|
ExecutableScript |
executable(Script script,
ScriptContext scriptContext,
java.util.Map<java.lang.String,java.lang.String> params)
Compiles (or retrieves from cache) and executes the provided script
|
java.lang.String |
getStoredScript(ClusterState state,
GetStoredScriptRequest request) |
SearchScript |
search(SearchLookup lookup,
Script script,
ScriptContext scriptContext,
java.util.Map<java.lang.String,java.lang.String> params)
Compiles (or retrieves from cache) and executes the provided search script
|
ScriptStats |
stats() |
void |
storeScript(ClusterService clusterService,
PutStoredScriptRequest request,
ActionListener<PutStoredScriptResponse> listener) |
logDeprecatedSetting, logRemovedSetting, nodeName
public static final Setting<java.lang.Integer> SCRIPT_CACHE_SIZE_SETTING
public static final Setting<java.lang.Boolean> SCRIPT_AUTO_RELOAD_ENABLED_SETTING
public static final Setting<java.lang.Integer> SCRIPT_MAX_SIZE_IN_BYTES
public static final Setting<java.lang.Integer> SCRIPT_MAX_COMPILATIONS_PER_MINUTE
public ScriptService(Settings settings, Environment env, ResourceWatcherService resourceWatcherService, ScriptEngineRegistry scriptEngineRegistry, ScriptContextRegistry scriptContextRegistry, ScriptSettings scriptSettings) throws java.io.IOException
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException
public CompiledScript compile(Script script, ScriptContext scriptContext, java.util.Map<java.lang.String,java.lang.String> params)
public void storeScript(ClusterService clusterService, PutStoredScriptRequest request, ActionListener<PutStoredScriptResponse> listener)
public void deleteStoredScript(ClusterService clusterService, DeleteStoredScriptRequest request, ActionListener<DeleteStoredScriptResponse> listener)
public java.lang.String getStoredScript(ClusterState state, GetStoredScriptRequest request)
public ExecutableScript executable(Script script, ScriptContext scriptContext, java.util.Map<java.lang.String,java.lang.String> params)
public ExecutableScript executable(CompiledScript compiledScript, java.util.Map<java.lang.String,java.lang.Object> vars)
public SearchScript search(SearchLookup lookup, Script script, ScriptContext scriptContext, java.util.Map<java.lang.String,java.lang.String> params)
public ScriptStats stats()
public void clusterChanged(ClusterChangedEvent event)
ClusterStateListener
clusterChanged
in interface ClusterStateListener