Class PeriodicReporter

java.lang.Object
org.apache.jackrabbit.oak.plugins.migration.report.PeriodicReporter
All Implemented Interfaces:
Reporter
Direct Known Subclasses:
LoggingReporter

public abstract class PeriodicReporter extends Object implements Reporter
Abstract class that simplifies development of a Reporter that should only report every nth event (node or property seen).
  • Constructor Details

    • PeriodicReporter

      protected PeriodicReporter(int nodeLogInterval, int propertyLogInterval)
  • Method Details

    • reset

      protected void reset()
      Reset the node and property counts to 0. Inheriting implementations may reset their own internal state.
    • reportPeriodicNode

      protected abstract void reportPeriodicNode(long count, @NotNull @NotNull ReportingNodeState nodeState)
      Callback called every nth time a node is accessed.
      Parameters:
      count - The count of reported nodes.
      nodeState - The node that was reported.
    • reportPeriodicProperty

      protected abstract void reportPeriodicProperty(long count, @NotNull @NotNull ReportingNodeState parent, @NotNull @NotNull String propertyName)
      Callback called every nth time a property is accessed.
      Parameters:
      count - The count of reported properties.
      parent - The parent node of the reported property.
      propertyName - The name of the reported property.
    • skipNodeState

      protected boolean skipNodeState(@NotNull @NotNull ReportingNodeState nodeState)
    • reportNode

      public final void reportNode(@NotNull @NotNull ReportingNodeState nodeState)
      Description copied from interface: Reporter
      Callback reporting that the given nodeState was accessed.
      Specified by:
      reportNode in interface Reporter
      Parameters:
      nodeState - The accessed ReportingNodeState instance.
    • reportProperty

      public final void reportProperty(@NotNull @NotNull ReportingNodeState parent, @NotNull @NotNull String propertyName)
      Description copied from interface: Reporter
      Callback reporting that the property named propertyName was accessed on the parent node.
      Specified by:
      reportProperty in interface Reporter
      Parameters:
      parent - The parent node state of the reported property.
      propertyName - The name of the reported property.