Class SegmentIdProperties.Chain

java.lang.Object
me.ahoo.cosid.spring.boot.starter.segment.SegmentIdProperties.Chain
Enclosing class:
SegmentIdProperties

public static class SegmentIdProperties.Chain extends Object
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.

  • 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

      public SegmentIdProperties.Chain.PrefetchWorker getPrefetchWorker()
      Gets the prefetch worker configuration.
      Returns:
      the prefetch worker configuration
    • setPrefetchWorker

      public void setPrefetchWorker(SegmentIdProperties.Chain.PrefetchWorker prefetchWorker)
      Sets the prefetch worker configuration.
      Parameters:
      prefetchWorker - the prefetch worker configuration to set