Class SegmentIdProperties.Chain
java.lang.Object
me.ahoo.cosid.spring.boot.starter.segment.SegmentIdProperties.Chain
- Enclosing class:
- SegmentIdProperties
Configuration for chain-based segment ID generation.
Chain mode provides better performance by maintaining a chain of segments and prefetching new segments before the current one is exhausted.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classConfiguration for the prefetch worker that manages segment prefetching. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the prefetch worker configuration.intGets the safe distance for chain generation.voidsetPrefetchWorker(SegmentIdProperties.Chain.PrefetchWorker prefetchWorker) Sets the prefetch worker configuration.voidsetSafeDistance(int safeDistance) Sets the safe distance for chain generation.
-
Constructor Details
-
Chain
public Chain()Constructs a new Chain configuration with default prefetch worker.
-
-
Method Details
-
getSafeDistance
public int getSafeDistance()Gets the safe distance for chain generation.- Returns:
- the safe distance
-
setSafeDistance
public void setSafeDistance(int safeDistance) Sets the safe distance for chain generation.- Parameters:
safeDistance- the safe distance to set
-
getPrefetchWorker
Gets the prefetch worker configuration.- Returns:
- the prefetch worker configuration
-
setPrefetchWorker
Sets the prefetch worker configuration.- Parameters:
prefetchWorker- the prefetch worker configuration to set
-