public class ScriptService extends AbstractComponent implements java.io.Closeable
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 ParseField |
SCRIPT_FILE
Deprecated.
Use
ScriptService.ScriptType.getParseField() instead. This should
be removed in 2.0 |
static ParseField |
SCRIPT_ID
Deprecated.
Use
ScriptService.ScriptType.getParseField() instead. This should
be removed in 2.0 |
static ParseField |
SCRIPT_INLINE
Deprecated.
Use
ScriptService.ScriptType.getParseField() instead. This should
be removed in 2.0 |
static ParseField |
SCRIPT_LANG
Deprecated.
Use
Script.ScriptField instead. This should be removed in
2.0 |
static Setting<java.lang.Integer> |
SCRIPT_MAX_SIZE_IN_BYTES |
deprecationLogger, logger, settings
Constructor and Description |
---|
ScriptService(Settings settings,
Environment env,
java.util.Set<ScriptEngineService> scriptEngines,
ResourceWatcherService resourceWatcherService,
ScriptEngineRegistry scriptEngineRegistry,
ScriptContextRegistry scriptContextRegistry,
ScriptSettings scriptSettings) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
CompiledScript |
compile(Script script,
ScriptContext scriptContext,
java.util.Map<java.lang.String,java.lang.String> params,
ClusterState state)
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,
ClusterState state)
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,
ClusterState state)
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
@Deprecated public static final ParseField SCRIPT_LANG
Script.ScriptField
instead. This should be removed in
2.0@Deprecated public static final ParseField SCRIPT_FILE
ScriptService.ScriptType.getParseField()
instead. This should
be removed in 2.0@Deprecated public static final ParseField SCRIPT_ID
ScriptService.ScriptType.getParseField()
instead. This should
be removed in 2.0@Deprecated public static final ParseField SCRIPT_INLINE
ScriptService.ScriptType.getParseField()
instead. This should
be removed in 2.0@Inject public ScriptService(Settings settings, Environment env, java.util.Set<ScriptEngineService> scriptEngines, 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, ClusterState state)
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, ClusterState state)
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, ClusterState state)
public ScriptStats stats()