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 protected
PeriodicReporter(int nodeLogInterval, int propertyLogInterval)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
reportNode(@NotNull ReportingNodeState nodeState)
Callback reporting that the givennodeState
was accessed.protected abstract void
reportPeriodicNode(long count, @NotNull ReportingNodeState nodeState)
Callback called every nth time a node is accessed.protected abstract void
reportPeriodicProperty(long count, @NotNull ReportingNodeState parent, @NotNull String propertyName)
Callback called every nth time a property is accessed.void
reportProperty(@NotNull ReportingNodeState parent, @NotNull String propertyName)
Callback reporting that the property namedpropertyName
was accessed on theparent
node.protected void
reset()
Reset the node and property counts to 0.protected boolean
skipNodeState(@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:Reporter
Callback reporting that the givennodeState
was accessed.- Specified by:
reportNode
in interfaceReporter
- Parameters:
nodeState
- The accessedReportingNodeState
instance.
-
reportProperty
public final void reportProperty(@NotNull @NotNull ReportingNodeState parent, @NotNull @NotNull String propertyName)
Description copied from interface:Reporter
Callback reporting that the property namedpropertyName
was accessed on theparent
node.- Specified by:
reportProperty
in interfaceReporter
- Parameters:
parent
- The parent node state of the reported property.propertyName
- The name of the reported property.
-
-