Class SegmentToContainerMapper


  • public final class SegmentToContainerMapper
    extends java.lang.Object
    Defines a Mapper from StreamSegment Name to Container Id.
    • Constructor Summary

      Constructors 
      Constructor Description
      SegmentToContainerMapper​(int containerCount)
      Creates a new instance of the SegmentToContainerMapper class.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getContainerId​(java.lang.String streamSegmentName)
      Determines the name of the container to use for the given StreamSegment.
      int getTotalContainerCount()
      Gets a value representing the total number of available SegmentContainers available within the cluster.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SegmentToContainerMapper

        public SegmentToContainerMapper​(int containerCount)
        Creates a new instance of the SegmentToContainerMapper class.
        Parameters:
        containerCount - The number of containers that are available.
    • Method Detail

      • getTotalContainerCount

        public int getTotalContainerCount()
        Gets a value representing the total number of available SegmentContainers available within the cluster.
        Returns:
        Integer indicating the total number of available SegmentContainers available within the cluster.
      • getContainerId

        public int getContainerId​(java.lang.String streamSegmentName)
        Determines the name of the container to use for the given StreamSegment. This value is dependent on the following factors:
        • The StreamSegment Name itself.
        • The Number of Containers - getTotalContainerCount()
        • The mapping strategy implemented by instances of this interface.
        Parameters:
        streamSegmentName - The name of the StreamSegment.
        Returns:
        Integer indicating the container id for the given StreamSegment.