Class MovAvgPipelineAggregationBuilder
- java.lang.Object
-
- org.elasticsearch.search.aggregations.PipelineAggregationBuilder
-
- org.elasticsearch.search.aggregations.pipeline.AbstractPipelineAggregationBuilder<MovAvgPipelineAggregationBuilder>
-
- org.elasticsearch.search.aggregations.pipeline.movavg.MovAvgPipelineAggregationBuilder
-
- All Implemented Interfaces:
NamedWriteable
,Writeable
,ToXContent
,ToXContentFragment
,BaseAggregationBuilder
public class MovAvgPipelineAggregationBuilder extends AbstractPipelineAggregationBuilder<MovAvgPipelineAggregationBuilder>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
-
Field Summary
Fields Modifier and Type Field Description static ParseField
MODEL
static java.lang.String
NAME
static ParseField
SETTINGS
-
Fields inherited from class org.elasticsearch.search.aggregations.pipeline.AbstractPipelineAggregationBuilder
BUCKETS_PATH_FIELD, metaData, type
-
Fields inherited from class org.elasticsearch.search.aggregations.PipelineAggregationBuilder
bucketsPaths, name
-
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
-
Constructor Summary
Constructors Constructor Description MovAvgPipelineAggregationBuilder(java.lang.String name, java.lang.String bucketsPath)
MovAvgPipelineAggregationBuilder(StreamInput in)
Read from a stream.
-
Method Summary
Modifier and Type Method Description protected PipelineAggregator
createInternal(java.util.Map<java.lang.String,java.lang.Object> metaData)
protected boolean
doEquals(java.lang.Object obj)
protected int
doHashCode()
void
doValidate(AggregatorFactory<?> parent, java.util.Collection<AggregationBuilder> aggFactories, java.util.Collection<PipelineAggregationBuilder> pipelineAggregatoractories)
protected void
doWriteTo(StreamOutput out)
java.lang.String
format()
Gets the format to use on the output of this aggregation.MovAvgPipelineAggregationBuilder
format(java.lang.String format)
Sets the format to use on the output of this aggregation.protected DocValueFormat
formatter()
BucketHelpers.GapPolicy
gapPolicy()
Gets the GapPolicy to use on the output of this aggregation.MovAvgPipelineAggregationBuilder
gapPolicy(BucketHelpers.GapPolicy gapPolicy)
Sets the GapPolicy to use on the output of this aggregation.java.lang.String
getWriteableName()
Returns the name of the writeable objectprotected XContentBuilder
internalXContent(XContentBuilder builder, ToXContent.Params params)
java.lang.Boolean
minimize()
Gets whether the model should be fit to the data using a cost minimizing algorithm.MovAvgPipelineAggregationBuilder
minimize(boolean minimize)
Sets whether the model should be fit to the data using a cost minimizing algorithm.MovAvgModel
model()
Gets a MovAvgModel for the Moving Average.MovAvgPipelineAggregationBuilder
model(MovAvgModel model)
Sets a MovAvgModel for the Moving Average.MovAvgPipelineAggregationBuilder
modelBuilder(MovAvgModelBuilder model)
Sets a MovAvgModel for the Moving Average.static MovAvgPipelineAggregationBuilder
parse(ParseFieldRegistry<MovAvgModel.AbstractModelParser> movingAverageMdelParserRegistry, java.lang.String pipelineAggregatorName, XContentParser parser)
int
predict()
Gets the number of predictions that should be returned.MovAvgPipelineAggregationBuilder
predict(int predict)
Sets the number of predictions that should be returned.int
window()
Gets the window size for the moving average.MovAvgPipelineAggregationBuilder
window(int window)
Sets the window size for the moving average.-
Methods inherited from class org.elasticsearch.search.aggregations.pipeline.AbstractPipelineAggregationBuilder
create, equals, getType, hashCode, overrideBucketsPath, setMetaData, toXContent, type, validate, validateSequentiallyOrderedParentAggs, writeTo
-
Methods inherited from class org.elasticsearch.search.aggregations.PipelineAggregationBuilder
getBucketsPaths, getName, subAggregations, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment
isFragment
-
-
-
-
Field Detail
-
NAME
public static final java.lang.String NAME
- See Also:
- Constant Field Values
-
MODEL
public static final ParseField MODEL
-
SETTINGS
public static final ParseField SETTINGS
-
-
Constructor Detail
-
MovAvgPipelineAggregationBuilder
public MovAvgPipelineAggregationBuilder(java.lang.String name, java.lang.String bucketsPath)
-
MovAvgPipelineAggregationBuilder
public MovAvgPipelineAggregationBuilder(StreamInput in) throws java.io.IOException
Read from a stream.- Throws:
java.io.IOException
-
-
Method Detail
-
doWriteTo
protected void doWriteTo(StreamOutput out) throws java.io.IOException
- Specified by:
doWriteTo
in classAbstractPipelineAggregationBuilder<MovAvgPipelineAggregationBuilder>
- Throws:
java.io.IOException
-
format
public MovAvgPipelineAggregationBuilder format(java.lang.String format)
Sets the format to use on the output of this aggregation.
-
format
public java.lang.String format()
Gets the format to use on the output of this aggregation.
-
gapPolicy
public MovAvgPipelineAggregationBuilder gapPolicy(BucketHelpers.GapPolicy gapPolicy)
Sets the GapPolicy to use on the output of this aggregation.
-
gapPolicy
public BucketHelpers.GapPolicy gapPolicy()
Gets the GapPolicy to use on the output of this aggregation.
-
formatter
protected DocValueFormat formatter()
-
window
public MovAvgPipelineAggregationBuilder window(int window)
Sets the window size for the moving average. This window will "slide" across the series, and the values inside that window will be used to calculate the moving avg value- Parameters:
window
- Size of window
-
window
public int window()
Gets the window size for the moving average. This window will "slide" across the series, and the values inside that window will be used to calculate the moving avg value
-
modelBuilder
public MovAvgPipelineAggregationBuilder modelBuilder(MovAvgModelBuilder model)
Sets a MovAvgModel for the Moving Average. The model is used to define what type of moving average you want to use on the series- Parameters:
model
- A MovAvgModel which has been prepopulated with settings
-
model
public MovAvgPipelineAggregationBuilder model(MovAvgModel model)
Sets a MovAvgModel for the Moving Average. The model is used to define what type of moving average you want to use on the series- Parameters:
model
- A MovAvgModel which has been prepopulated with settings
-
model
public MovAvgModel model()
Gets a MovAvgModel for the Moving Average. The model is used to define what type of moving average you want to use on the series
-
predict
public MovAvgPipelineAggregationBuilder predict(int predict)
Sets the number of predictions that should be returned. Each prediction will be spaced at the intervals specified in the histogram. E.g "predict: 2" will return two new buckets at the end of the histogram with the predicted values.- Parameters:
predict
- Number of predictions to make
-
predict
public int predict()
Gets the number of predictions that should be returned. Each prediction will be spaced at the intervals specified in the histogram. E.g "predict: 2" will return two new buckets at the end of the histogram with the predicted values.
-
minimize
public MovAvgPipelineAggregationBuilder minimize(boolean minimize)
Sets whether the model should be fit to the data using a cost minimizing algorithm.- Parameters:
minimize
- If the model should be fit to the underlying data
-
minimize
public java.lang.Boolean minimize()
Gets whether the model should be fit to the data using a cost minimizing algorithm.
-
createInternal
protected PipelineAggregator createInternal(java.util.Map<java.lang.String,java.lang.Object> metaData) throws java.io.IOException
- Specified by:
createInternal
in classAbstractPipelineAggregationBuilder<MovAvgPipelineAggregationBuilder>
- Throws:
java.io.IOException
-
doValidate
public void doValidate(AggregatorFactory<?> parent, java.util.Collection<AggregationBuilder> aggFactories, java.util.Collection<PipelineAggregationBuilder> pipelineAggregatoractories)
- Overrides:
doValidate
in classAbstractPipelineAggregationBuilder<MovAvgPipelineAggregationBuilder>
-
internalXContent
protected XContentBuilder internalXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
- Specified by:
internalXContent
in classAbstractPipelineAggregationBuilder<MovAvgPipelineAggregationBuilder>
- Throws:
java.io.IOException
-
parse
public static MovAvgPipelineAggregationBuilder parse(ParseFieldRegistry<MovAvgModel.AbstractModelParser> movingAverageMdelParserRegistry, java.lang.String pipelineAggregatorName, XContentParser parser) throws java.io.IOException
- Throws:
java.io.IOException
-
doHashCode
protected int doHashCode()
- Specified by:
doHashCode
in classAbstractPipelineAggregationBuilder<MovAvgPipelineAggregationBuilder>
-
doEquals
protected boolean doEquals(java.lang.Object obj)
- Specified by:
doEquals
in classAbstractPipelineAggregationBuilder<MovAvgPipelineAggregationBuilder>
-
getWriteableName
public java.lang.String getWriteableName()
Description copied from interface:NamedWriteable
Returns the name of the writeable object
-
-