Interface MaxSegmentProvider

All Superinterfaces:
Function<String,Integer>

public interface MaxSegmentProvider extends Function<String,Integer>
Functional interface returning the maximum amount of segments a Coordinator may claim, based on the given processingGroup.
Since:
4.10.0
Author:
Manish
  • Method Details

    • getMaxSegments

      int getMaxSegments(String processingGroup)
      Returns the maximum amount of segments to claim for the given processingGroup.
      Parameters:
      processingGroup - The name of a processing group for which to provide the maximum amount of segments it can claim.
      Returns:
      The maximum number of segments that can be claimed for the given processingGroup.
    • apply

      default Integer apply(String processingGroup)
      Returns the maximum amount of segments to claim for the given processingGroup.
      Specified by:
      apply in interface Function<String,Integer>
      Parameters:
      processingGroup - The name of a processing group for which to provide the maximum amount of segments it can claim.
      Returns:
      The maximum number of segments that can be claimed for the given processingGroup.
    • maxShort

      static MaxSegmentProvider maxShort()
      A MaxSegmentProvider that always returns Short.MAX_VALUE.
      Returns:
      A MaxSegmentProvider that always returns Short.MAX_VALUE.