java.lang.Object
org.epics.archiverappliance.retrieval.postprocessors.CAPlotBinning
All Implemented Interfaces:
PostProcessor, PostProcessorWithConsolidatedEventStream

public class CAPlotBinning extends Object implements PostProcessor, PostProcessorWithConsolidatedEventStream
Approx implementation of ChannelArchiver plotbinning for Michael Davidsaver From the doc
  1. If there is no sample for the time span of a bin, the bin remains empty.
  2. If there is one sample, it is placed in the bin.
  3. If there are two samples, they are placed in the bin
  4. If there are more than two samples, the first and last one are placed in the bin. In addition, two artificial samples are created with a time stamp right between the first and last sample. One contains the minimum, the other the maximum of all raw samples who's time stamps fall into the bin. They are presented to the user in the sequence initial, minimum, maximum, final.
Author:
mshankar
  • Constructor Details

    • CAPlotBinning

      public CAPlotBinning()
  • Method Details

    • getIdentity

      public String getIdentity()
      Description copied from interface: PostProcessor
      The 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.
      1. For example, pp=firstSample_600 asks the server to sparsify with an interval of 600 seconds.
      2. identity is firstSample.
      3. extension is firstSample_600.
      4. User specifies firstSample_600.
      5. ETL caches the data as firstSample_600 if asked to.
      Specified by:
      getIdentity in interface PostProcessor
      Returns:
      identify  
    • estimateMemoryConsumption

      public long estimateMemoryConsumption(String pvName, PVTypeInfo typeInfo, Instant start, Instant end, jakarta.servlet.http.HttpServletRequest req)
      Description copied from interface: PostProcessor
      Estimate the amount of memory required for the data generated by the post processors.
      Specified by:
      estimateMemoryConsumption in interface PostProcessor
      Parameters:
      pvName - The name of PV
      typeInfo - PVTypeInfo
      start - Instant
      end - Instant
      req - HttpServletRequest
      Returns:
      Estimated Memory comsumption
    • initialize

      public void initialize(String userarg, String pvName) throws IOException
      Description copied from interface: PostProcessor
      Initialize this post processor for the given PV and request parameters.
      Specified by:
      initialize in interface PostProcessor
      Parameters:
      userarg - This is the full form (extension) of the identity for the post processor.
      pvName - The name of PV
      Throws:
      IOException -  
    • wrap

      public Callable<EventStream> wrap(Callable<EventStream> callable)
      Description copied from interface: PostProcessor
      Primary data generation method. Using the event stream provided, do your magic and generate processed data
      Specified by:
      wrap in interface PostProcessor
      Parameters:
      callable -  
      Returns:
      EventStream  
    • getExtension

      public String getExtension()
      Description copied from interface: PostProcessor
      This 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:
      getExtension in interface PostProcessor
      Returns:
      extension  
      See Also:
    • getConsolidatedEventStream

      public EventStream getConsolidatedEventStream()
      Specified by:
      getConsolidatedEventStream in interface PostProcessorWithConsolidatedEventStream
    • getStartBinEpochSeconds

      public long getStartBinEpochSeconds()
      Specified by:
      getStartBinEpochSeconds in interface PostProcessorWithConsolidatedEventStream
    • getEndBinEpochSeconds

      public long getEndBinEpochSeconds()
      Specified by:
      getEndBinEpochSeconds in interface PostProcessorWithConsolidatedEventStream
    • getBinTimestamps

      public LinkedList<TimeSpan> getBinTimestamps()
      Specified by:
      getBinTimestamps in interface PostProcessorWithConsolidatedEventStream
    • getBinTimestamps

      public static LinkedList<TimeSpan> getBinTimestamps(long firstBin, long lastBin, int intervalSecs)