Class MovAvgModel.AbstractModelParser
java.lang.Object
org.elasticsearch.search.aggregations.pipeline.MovAvgModel.AbstractModelParser
- Enclosing class:
- MovAvgModel
Abstract class which also provides some concrete parsing functionality.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
checkUnrecognizedParams(Map<String,Object> settings)
abstract MovAvgModel
Parse a settings hash that is specific to this modelprotected boolean
parseBoolParam(Map<String,Object> settings, String name, boolean defaultValue)
Extracts a boolean from the settings map, otherwise throws an exceptionprotected double
parseDoubleParam(Map<String,Object> settings, String name, double defaultValue)
Extracts a 0-1 inclusive double from the settings map, otherwise throws an exceptionprotected int
parseIntegerParam(Map<String,Object> settings, String name, int defaultValue)
Extracts an integer from the settings map, otherwise throws an exception
-
Constructor Details
-
AbstractModelParser
public AbstractModelParser()
-
-
Method Details
-
parse
public abstract MovAvgModel parse(@Nullable Map<String,Object> settings, String pipelineName, int windowSize) throws ParseExceptionParse a settings hash that is specific to this model- Parameters:
settings
- Map of settings, extracted from the requestpipelineName
- Name of the parent pipeline aggwindowSize
- Size of the window for this moving avg- Returns:
- A fully built moving average model
- Throws:
ParseException
-
parseDoubleParam
protected double parseDoubleParam(@Nullable Map<String,Object> settings, String name, double defaultValue) throws ParseExceptionExtracts a 0-1 inclusive double from the settings map, otherwise throws an exception- Parameters:
settings
- Map of settings provided to this modelname
- Name of parameter we are attempting to extractdefaultValue
- Default value to be used if value does not exist in map- Returns:
- Double value extracted from settings map
- Throws:
ParseException
-
parseIntegerParam
protected int parseIntegerParam(@Nullable Map<String,Object> settings, String name, int defaultValue) throws ParseExceptionExtracts an integer from the settings map, otherwise throws an exception- Parameters:
settings
- Map of settings provided to this modelname
- Name of parameter we are attempting to extractdefaultValue
- Default value to be used if value does not exist in map- Returns:
- Integer value extracted from settings map
- Throws:
ParseException
-
parseBoolParam
protected boolean parseBoolParam(@Nullable Map<String,Object> settings, String name, boolean defaultValue) throws ParseExceptionExtracts a boolean from the settings map, otherwise throws an exception- Parameters:
settings
- Map of settings provided to this modelname
- Name of parameter we are attempting to extractdefaultValue
- Default value to be used if value does not exist in map- Returns:
- Boolean value extracted from settings map
- Throws:
ParseException
-
checkUnrecognizedParams
- Throws:
ParseException
-