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 Summary
Constructors Modifier Constructor Description protectedPeriodicReporter(int nodeLogInterval, int propertyLogInterval)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidreportNode(@NotNull ReportingNodeState nodeState)Callback reporting that the givennodeStatewas accessed.protected abstract voidreportPeriodicNode(long count, @NotNull ReportingNodeState nodeState)Callback called every nth time a node is accessed.protected abstract voidreportPeriodicProperty(long count, @NotNull ReportingNodeState parent, @NotNull String propertyName)Callback called every nth time a property is accessed.voidreportProperty(@NotNull ReportingNodeState parent, @NotNull String propertyName)Callback reporting that the property namedpropertyNamewas accessed on theparentnode.protected voidreset()Reset the node and property counts to 0.protected booleanskipNodeState(@NotNull ReportingNodeState nodeState)
-
-
-
Method Detail
-
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:ReporterCallback reporting that the givennodeStatewas accessed.- Specified by:
reportNodein interfaceReporter- Parameters:
nodeState- The accessedReportingNodeStateinstance.
-
reportProperty
public final void reportProperty(@NotNull @NotNull ReportingNodeState parent, @NotNull @NotNull String propertyName)Description copied from interface:ReporterCallback reporting that the property namedpropertyNamewas accessed on theparentnode.- Specified by:
reportPropertyin interfaceReporter- Parameters:
parent- The parent node state of the reported property.propertyName- The name of the reported property.
-
-