public abstract class StatisticsLearner extends AbstractProcessor implements StatisticsService
| Modifier and Type | Field and Description |
|---|---|
protected String[] |
keys |
protected String |
prefix |
protected Statistics |
statistics |
context| Constructor and Description |
|---|
StatisticsLearner() |
| Modifier and Type | Method and Description |
|---|---|
String[] |
getKeys() |
String |
getPrefix() |
Statistics |
getStatistics() |
Data |
process(Data data) |
void |
reset() |
void |
resetState() |
void |
setKeys(String[] keys) |
void |
setPrefix(String prefix) |
abstract void |
updateStatistics(Data item) |
finish, initprotected String[] keys
protected Statistics statistics
protected String prefix
public String[] getKeys()
@Parameter(required=false, description="The keys/attributes this processor should account statistics (sum,average,min/max) for") public void setKeys(String[] keys)
keys - the keys to setpublic String getPrefix()
@Parameter(required=false, description="An optional prefix that is prepended to the attribute names, which prevents the original attribute values from being overwritten by the respective sum/average/min/max value") public void setPrefix(String prefix)
prefix - the prefix to setpublic Data process(Data data)
process in interface ProcessorDataProcessorpublic Statistics getStatistics()
getStatistics in interface StatisticsServicestream.statistics.StatisticsService#getStatistics(java.lang.String)public abstract void updateStatistics(Data item)
public void reset()
throws Exception
reset in interface ServiceExceptionService.reset()public void resetState()
throws Exception
resetState in interface StatefulProcessorresetState in class AbstractProcessorExceptionAbstractProcessor.resetState()Copyright © 2018. All rights reserved.