Class GroupedIdSegmentDistributorSpec

java.lang.Object
me.ahoo.cosid.test.segment.distributor.IdSegmentDistributorSpec
me.ahoo.cosid.test.segment.distributor.GroupedIdSegmentDistributorSpec

public abstract class GroupedIdSegmentDistributorSpec extends IdSegmentDistributorSpec
  • Constructor Details

    • GroupedIdSegmentDistributorSpec

      public GroupedIdSegmentDistributorSpec()
  • Method Details

    • groupedSupplier

      protected GroupBySupplier groupedSupplier()
    • nextMaxIdWhenBack

      public void nextMaxIdWhenBack()
      Overrides:
      nextMaxIdWhenBack in class IdSegmentDistributorSpec
    • setMaxIdBack

      protected <T extends IdSegmentDistributor> void setMaxIdBack(T distributor, long maxId)
      Specified by:
      setMaxIdBack in class IdSegmentDistributorSpec
    • factory

      protected IdSegmentDistributorFactory factory()
      Overrides:
      factory in class IdSegmentDistributorSpec
    • getGroup

      @Test public void getGroup()
      Overrides:
      getGroup in class IdSegmentDistributorSpec
    • nextIdSegment

      @Test public void nextIdSegment()
      Overrides:
      nextIdSegment in class IdSegmentDistributorSpec
    • nextIdSegmentChain

      @Test public void nextIdSegmentChain()
      Overrides:
      nextIdSegmentChain in class IdSegmentDistributorSpec
    • generateGroupedCarriesTheGroup

      @Test public void generateGroupedCarriesTheGroup()
    • generateGroupedAsStringNeedsNoThreadLocalGroup

      @Test public void generateGroupedAsStringNeedsNoThreadLocalGroup()
    • generateAsStringUsesTheSegmentGroup

      @Test public void generateAsStringUsesTheSegmentGroup()
      A string segment id with a grouped prefix takes the group from the segment the id came from.
    • oneStepIdKeepsItsGroupAcrossRollover

      @Test public void oneStepIdKeepsItsGroupAcrossRollover()
      With step 1 every id comes from its own call to the distributor: the id and its group must come from the same grouped counter even when the group rolls over in between, or "2026-1" could be issued twice.