Class OptimizedWithLastSample
java.lang.Object
org.epics.archiverappliance.retrieval.postprocessors.OptimizedWithLastSample
- All Implemented Interfaces:
FillNoFillSupport,PostProcessor,PostProcessorWithConsolidatedEventStream
public class OptimizedWithLastSample
extends Object
implements PostProcessor, PostProcessorWithConsolidatedEventStream, FillNoFillSupport
OptimizedWithLastSample expects one parameter at initialization, which is the number of requested points.
If there are less samples in the time interval than requested (with a certain deadband), all samples
will be returned. If there are more samples than requested, the samples will be collected into bins.
Mean, std, min, max and count of each bin is calculated and returned as a single sample.
This differs from the Optimized post processor in that if a bin is empty, instead of
repeating the last bin with samples, the bin uses the last value of the last recorded sample instead
(as mean, min and max; stddev is zero and number of samples is also zero).-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected LinkedHashMap<Long, org.epics.archiverappliance.retrieval.postprocessors.SummaryStatsPostProcessor.SummaryValue> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncustomStatsWrap(Callable<EventStream> callable) voidlongestimateMemoryConsumption(String pvName, PVTypeInfo typeInfo, Instant start, Instant end, javax.servlet.http.HttpServletRequest req) Estimate the amount of memory required for the data generated by the post processors.longThis is the full form of the identity for the post processor and includes any parameters for the post processor.The string used by clients to identify this post processor when making retrieval requests.longvoidinitialize(String userarg, String pvName) Initialize this post processor for the given PV and request parameters.wrap(Callable<EventStream> callable) Primary data generation method.booleanFor some post processors, we do fill empty bins but with zeroes instead.
-
Field Details
-
consolidatedData
protected LinkedHashMap<Long,org.epics.archiverappliance.retrieval.postprocessors.SummaryStatsPostProcessor.SummaryValue> consolidatedData
-
-
Constructor Details
-
OptimizedWithLastSample
public OptimizedWithLastSample()
-
-
Method Details
-
initialize
Description copied from interface:PostProcessorInitialize this post processor for the given PV and request parameters.- Specified by:
initializein interfacePostProcessor- Parameters:
userarg- This is the full form (extension) of the identity for the post processor.pvName- The name of PV- Throws:
IOException-
-
estimateMemoryConsumption
public long estimateMemoryConsumption(String pvName, PVTypeInfo typeInfo, Instant start, Instant end, javax.servlet.http.HttpServletRequest req) Description copied from interface:PostProcessorEstimate the amount of memory required for the data generated by the post processors.- Specified by:
estimateMemoryConsumptionin interfacePostProcessor- Parameters:
pvName- The name of PVtypeInfo- PVTypeInfostart- Instantend- Instantreq- HttpServletRequest- Returns:
- Estimated Memory comsumption
-
doNotInheritValuesFromPrevioisBins
public void doNotInheritValuesFromPrevioisBins()- Specified by:
doNotInheritValuesFromPrevioisBinsin interfaceFillNoFillSupport
-
zeroOutEmptyBins
public boolean zeroOutEmptyBins()Description copied from interface:FillNoFillSupportFor some post processors, we do fill empty bins but with zeroes instead.- Specified by:
zeroOutEmptyBinsin interfaceFillNoFillSupport- Returns:
- boolean True or False
-
getConsolidatedEventStream
- Specified by:
getConsolidatedEventStreamin interfacePostProcessorWithConsolidatedEventStream
-
getStartBinEpochSeconds
public long getStartBinEpochSeconds()- Specified by:
getStartBinEpochSecondsin interfacePostProcessorWithConsolidatedEventStream
-
getEndBinEpochSeconds
public long getEndBinEpochSeconds()- Specified by:
getEndBinEpochSecondsin interfacePostProcessorWithConsolidatedEventStream
-
getBinTimestamps
- Specified by:
getBinTimestampsin interfacePostProcessorWithConsolidatedEventStream
-
getIdentity
Description copied from interface:PostProcessorThe string used by clients to identify this post processor when making retrieval requests. For example to identify the FirstSamplePP postprocessor, users would add a pp=firstSample to the request for data. The situation is a little more complex; if a post processor has parameters then it needs to combine these into a string and offer that as an extension. The identity is just the starting part of this.- For example, pp=firstSample_600 asks the server to sparsify with an interval of 600 seconds.
- identity is firstSample.
- extension is firstSample_600.
- User specifies firstSample_600.
- ETL caches the data as firstSample_600 if asked to.
- Specified by:
getIdentityin interfacePostProcessor- Returns:
- identify
-
getExtension
Description copied from interface:PostProcessorThis is the full form of the identity for the post processor and includes any parameters for the post processor. The exact format and interpretation of this is left to the post processor; however the convention is to use underscores to separate the params and have them in a specific order.- Specified by:
getExtensionin interfacePostProcessor- Returns:
- extension
- See Also:
-
wrap
Description copied from interface:PostProcessorPrimary data generation method. Using the event stream provided, do your magic and generate processed data- Specified by:
wrapin interfacePostProcessor- Parameters:
callable-- Returns:
- EventStream
-
customStatsWrap
-