Package io.pravega.shared.segment
Class SegmentToContainerMapper
- java.lang.Object
-
- io.pravega.shared.segment.SegmentToContainerMapper
-
public final class SegmentToContainerMapper extends java.lang.ObjectDefines 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 intgetContainerId(java.lang.String streamSegmentName)Determines the name of the container to use for the given StreamSegment.intgetTotalContainerCount()Gets a value representing the total number of available SegmentContainers available within the cluster.
-
-
-
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.
-
-