Package org.axonframework.eventsourcing
Class DefaultSnapshotterSpanFactory
java.lang.Object
org.axonframework.eventsourcing.DefaultSnapshotterSpanFactory
- All Implemented Interfaces:
SnapshotterSpanFactory
Default implementation of the
SnapshotterSpanFactory. Can be configured to include the aggregate type in the
span name (true by default) and to create a separate trace for the creation of the snapshot (false by default).- Since:
- 4.9.0
- Author:
- Mitchell Herrijgers
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder class to instantiate aDefaultSnapshotterSpanFactory. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreates a newDefaultSnapshotterSpanFactoryusing the providedbuilder. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a newDefaultSnapshotterSpanFactory.Builderto build aDefaultSnapshotterSpanFactorywith.createCreateSnapshotSpan(String aggregateType, String aggregateIdentifier) Creates a newSpanthat represents the actual creation of a snapshot.createScheduleSnapshotSpan(String aggregateType, String aggregateIdentifier) Creates a newSpanthat represents the scheduling of snapshot creation to the snapshotter's executor.
-
Constructor Details
-
DefaultSnapshotterSpanFactory
Creates a newDefaultSnapshotterSpanFactoryusing the providedbuilder.- Parameters:
builder- The builder to build theDefaultSnapshotterSpanFactoryfrom.
-
-
Method Details
-
createScheduleSnapshotSpan
Description copied from interface:SnapshotterSpanFactoryCreates a newSpanthat represents the scheduling of snapshot creation to the snapshotter's executor.- Specified by:
createScheduleSnapshotSpanin interfaceSnapshotterSpanFactory- Parameters:
aggregateType- The aggregate's type.aggregateIdentifier- The aggregate's identifier.- Returns:
- A
Spanrepresenting the scheduling of snapshot creation.
-
createCreateSnapshotSpan
Description copied from interface:SnapshotterSpanFactoryCreates a newSpanthat represents the actual creation of a snapshot. The creation of a snapshot might be done in a separate thread depending on the implementation of theSnapshotter.- Specified by:
createCreateSnapshotSpanin interfaceSnapshotterSpanFactory- Parameters:
aggregateType- The aggregate's type.aggregateIdentifier- The aggregate's identifier.- Returns:
- A
Spanrepresenting the creation of a snapshot.
-
builder
Creates a newDefaultSnapshotterSpanFactory.Builderto build aDefaultSnapshotterSpanFactorywith. The default values are:separateTracedefaults totrueaggregateTypeInSpanNamedefaults totrue
spanFactoryis a required field and should be provided.- Returns:
- The
DefaultSnapshotterSpanFactory.Builderto build aDefaultSnapshotterSpanFactorywith.
-