Class AbstractTimestampFilter<T>

java.lang.Object
teetime.framework.AbstractStage
teetime.framework.AbstractConsumerStage<T>
kieker.analysis.generic.time.AbstractTimestampFilter<T>
Type Parameters:
T - Generic type of incoming records. Subclasses use concrete types.
Direct Known Subclasses:
EventRecordTimestampFilter, MonitioringRecordTimestampFilter, OperationExecutionRecordTimestampFilter, TraceMetadataTimestampFilter

public abstract class AbstractTimestampFilter<T>
extends teetime.framework.AbstractConsumerStage<T>
Allows to filter monitoring records objects based on their given timestamps. If the received record is within the defined timestamps, the object is delivered unmodified to the nameWithinPeriodOutputPort otherwise to the nameOutsidePeriodOutputPort. In a concrete P&F architecture this stage should be used behind TeeTime's InstanceOfFilter to forward records to either TraceMetadataTimestampFilter, OperationExecutionRecordTimestampFilter or MonitioringRecordTimestampFilter.
Since:
1.2
Author:
Andre van Hoorn, Jan Waller, Lars Bluemke
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected teetime.framework.OutputPort<T> recordOutsideTimePeriodOutputPort  
    protected teetime.framework.OutputPort<T> recordWithinTimePeriodOutputPort  

    Fields inherited from class teetime.framework.AbstractConsumerStage

    inputPort

    Fields inherited from class teetime.framework.AbstractStage

    logger
  • Constructor Summary

    Constructors 
    Constructor Description
    AbstractTimestampFilter​(long ignoreBeforeTimestamp, long ignoreAfterTimestamp)
    Creates a new instance of this class using the given parameters.
  • Method Summary

    Modifier and Type Method Description
    protected void execute​(T record)  
    teetime.framework.OutputPort<T> getRecordOutsideTimePeriodOutputPort()  
    protected abstract long getRecordSpecificTimestamp​(T record)
    Returns the most accurate timestamp available for each record.
    teetime.framework.OutputPort<T> getRecordWithinTimePeriodOutputPort()  
    protected boolean inRange​(long timestamp)
    A simple helper method which checks whether the given timestamp is in the configured limits.

    Methods inherited from class teetime.framework.AbstractConsumerStage

    createInputPort, execute, getInputPort

    Methods inherited from class teetime.framework.AbstractStage

    abort, addInputPortRemovedListener, addOutputPortRemovedListener, compareAndSetBeingExecuted, createInputPort, createInputPort, createInputPort, createOutputPort, createOutputPort, createOutputPort, createOutputPort, declareActive, declarePassive, executeByFramework, getCurrentState, getId, getInputPorts, getOutputPorts, getOwningThread, getTerminationStrategy, isActive, isBeingExecuted, isPaused, isProducer, isStateless, onSignal, onStarting, onTerminating, onValidating, removeDynamicPort, removeDynamicPort, setPaused, setStateless, shouldBeTerminated, signalAlreadyReceived, terminateStage, toString, workCompleted

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • AbstractTimestampFilter

      public AbstractTimestampFilter​(long ignoreBeforeTimestamp, long ignoreAfterTimestamp)
      Creates a new instance of this class using the given parameters.
      Parameters:
      ignoreBeforeTimestamp - The lower limit for the time stamps of the records.
      ignoreAfterTimestamp - The upper limit for the time stamps of the records.
  • Method Details

    • inRange

      protected final boolean inRange​(long timestamp)
      A simple helper method which checks whether the given timestamp is in the configured limits.
      Parameters:
      timestamp - The timestamp to be checked.
      Returns:
      true if and only if the given timestamp is between or equals ignoreBeforeTimestamp and ignoreAfterTimestamp.
    • execute

      protected void execute​(T record)
      Specified by:
      execute in class teetime.framework.AbstractConsumerStage<T>
    • getRecordSpecificTimestamp

      protected abstract long getRecordSpecificTimestamp​(T record)
      Returns the most accurate timestamp available for each record. This might be record.getTimestamp or record.getLoggingTimestamp.
      Parameters:
      record - An EventRecord, OperationExecutionRecord, TraceMetadata or MonitoringRecord for example.
      Returns:
      Timestamp of the given record.
    • getRecordWithinTimePeriodOutputPort

      public teetime.framework.OutputPort<T> getRecordWithinTimePeriodOutputPort()
    • getRecordOutsideTimePeriodOutputPort

      public teetime.framework.OutputPort<T> getRecordOutsideTimePeriodOutputPort()