Class DTCPipelineProgressTextReporter

java.lang.Object
com.deltaxml.core.DTCPipelineProgressTextReporter
All Implemented Interfaces:
DocumentProgressListener, com.deltaxml.core.FeatureProgressListener, PipelineProgressListener

public class DTCPipelineProgressTextReporter extends Object implements DocumentProgressListener
Reports pipeline progress to System.err using textual messages. Each line of the 'progress report' indicates the completion of a pipeline stage (start events are not reported). The report can include timing information and information to identify filters and other pipeline stages. One of the constructors supports these controls. The report can also be set to include the other 'incidental' messages, which are: the initial filter size message; the start filter step messages; the subchain entry and exit messages; and the skipped disabled step or subchain messages.
Since:
17.0
Author:
John Morgan
  • Constructor Details

    • DTCPipelineProgressTextReporter

      public DTCPipelineProgressTextReporter()
      Constructs a progress reporter that reports times and filter names.
    • DTCPipelineProgressTextReporter

      public DTCPipelineProgressTextReporter(boolean reportTimes)
      Constructs a configurable progress reporter.
      Parameters:
      reportTimes - when true timing information is reported where available
    • DTCPipelineProgressTextReporter

      public DTCPipelineProgressTextReporter(boolean reportTimes, boolean reportComparisonHeartbeat)
      Constructs a configurable progress reporter.
      Parameters:
      reportTimes - when true timing information is reported where available
      reportComparisonHeartbeat - when true a comparison 'heartbeat' is output at approximately one second intervals
  • Method Details

    • reportFlatteningPreProcessingStart

      public void reportFlatteningPreProcessingStart(PipelineLocationEntry ple)
      Report the flattening pre-processing stage starts.
      Specified by:
      reportFlatteningPreProcessingStart in interface com.deltaxml.core.FeatureProgressListener
      Parameters:
      ple - The location, which will be either 'input-a' or 'input-b'.
    • reportFlatteningPreProcessingFinish

      public void reportFlatteningPreProcessingFinish(PipelineLocationEntry ple, long elapsedTimeNS, long threadCPUTimeNS)
      Report the flattening pre-processing stage finishes.
      Specified by:
      reportFlatteningPreProcessingFinish in interface com.deltaxml.core.FeatureProgressListener
      Parameters:
      ple - The location, which will be either 'input-a' or 'input-b'.
      elapsedTimeNS - The elapsed time taken to execute the filter (in nanoseconds).
      threadCPUTimeNS - The CPU time taken to execute this filter (in nanoseconds).
    • setReportTimes

      public void setReportTimes(boolean reportTimes)
      Controls whether timing information is reported.
      Parameters:
      reportTimes - when true timing information is reported where available
    • setReportIncidentals

      public void setReportIncidentals(boolean reportTimes)
      Set report incidentals. Here, the incidental messages are: the initial filter size message; the start filter step messages; the subchain entry and exit messages; and the skipped disabled step or subchain messages.
      Parameters:
      reportTimes - when true timing information is reported where available
    • reportNumberOfStages

      public void reportNumberOfStages(int enabledStages)
      Report the number of enabled stages. Each enabled stage has two associated progress report messages that marks when a stage has been Started and Finished. Note that all other progress report messages, such as those marking when a subchain has been Entered and Exited or those marking when a disabled stage or chain has been Skipped, are not part of the enabled stage count.
      Specified by:
      reportNumberOfStages in interface PipelineProgressListener
      Parameters:
      enabledStages - The number of enabled stages.
    • reportCompareFinish

      public void reportCompareFinish(long elapsedTime, long threadCPUTime)
      Reports when the comparison has completed.
      Specified by:
      reportCompareFinish in interface PipelineProgressListener
      Parameters:
      elapsedTime - The elapsed time taken to perform the comparison (in nanoseconds).
      threadCPUTime - The CPU time taken to perform the comparison (in nanoseconds).
    • reportCompareHeartbeat

      public void reportCompareHeartbeat()
      Reports that progress has been made in the current comparison. This will be called at most once a second.

      Notes:

      • Not receiving this event should not be interpreted as the comparison stopping or being broken, but usually a sign that the comparison is busy processing.
      • This runs on the same thread as the comparison, so the code you add here will increase the comparison time.
      Specified by:
      reportCompareHeartbeat in interface PipelineProgressListener
    • reportCompareStart

      public void reportCompareStart()
      Reports when the comparison has started.
      Specified by:
      reportCompareStart in interface PipelineProgressListener
    • reportFilterFinish

      public void reportFilterFinish(PipelineLocationEntry ple, long elapsedTimeNS, long threadCPUTimeNS)
      Reports when a pipeline filter finishes.
      Specified by:
      reportFilterFinish in interface PipelineProgressListener
      Parameters:
      ple - The filter's location within the pipeline.
      elapsedTimeNS - The elapsed time taken to execute the filter (in nanoseconds).
      threadCPUTimeNS - The CPU time taken to execute this filter (in nanoseconds).
    • reportFilterStart

      public void reportFilterStart(PipelineLocationEntry ple)
      Reports when a pipeline filter starts.
      Specified by:
      reportFilterStart in interface PipelineProgressListener
      Parameters:
      ple - The filter's location within the pipeline.
    • reportFilterOrSubchainSkipped

      public void reportFilterOrSubchainSkipped(PipelineLocationEntry ple, int numberOfStepsSkipped)
      Reports when a pipeline filter or subchain is skipped. Filters and subchains are skipped when they are disabled.
      Specified by:
      reportFilterOrSubchainSkipped in interface PipelineProgressListener
      Parameters:
      ple - The filter or subchain's location within the pipeline.
      numberOfStepsSkipped - The number of filter stages skipped.
    • reportLoadFinish

      public void reportLoadFinish(PipelineLocationEntry ple, long elapsedTime, long threadCPUTime)
      Reports when pipeline has been loaded.
      Specified by:
      reportLoadFinish in interface PipelineProgressListener
      Parameters:
      ple - The name of the pipeline; typically "input-a", "input-b", or "result".
      elapsedTime - The elapsed time taken to load a pipeline (in nanoseconds).
      threadCPUTime - The CPU time taken to load a pipeline (in nanoseconds).
    • reportLoadStart

      public void reportLoadStart(PipelineLocationEntry ple)
      Reports when pipeline starts to load.
      Specified by:
      reportLoadStart in interface PipelineProgressListener
      Parameters:
      ple - The name of the pipeline; typically "input-a", "input-b", or "result".
    • reportSaveFinish

      public void reportSaveFinish(long elapsedTime, long threadCPUTime)
      Reports when the output has been completed.
      Specified by:
      reportSaveFinish in interface PipelineProgressListener
      Parameters:
      elapsedTime - The elapsed time taken to write the output (in nanoseconds).
      threadCPUTime - The CPU time taken to write the output (in nanoseconds).
    • reportSaveStart

      public void reportSaveStart()
      Reports when the output is starting to be written.
      Specified by:
      reportSaveStart in interface PipelineProgressListener
    • reportSubchainEnter

      public void reportSubchainEnter(PipelineLocationEntry ple)
      Description copied from interface: PipelineProgressListener
      Reports when a subchain within the pipeline is entered.
      Specified by:
      reportSubchainEnter in interface PipelineProgressListener
      Parameters:
      ple - The subchain's location within the pipeline.
    • reportSubchainExit

      public void reportSubchainExit(PipelineLocationEntry ple, long elapsedTime, long threadCPUTime)
      Description copied from interface: PipelineProgressListener
      Reports when a subchain within the pipeline is exited.
      Specified by:
      reportSubchainExit in interface PipelineProgressListener
      Parameters:
      ple - The subchain's location within the pipeline.
      elapsedTime - The elapsed time taken to execute the subchain (in nanoseconds).
      threadCPUTime - The CPU time taken to execute this subchain (in nanoseconds).