Package org.apache.flink.runtime.state
Class KeyGroupRangeOffsets
- java.lang.Object
-
- org.apache.flink.runtime.state.KeyGroupRangeOffsets
-
- All Implemented Interfaces:
Serializable
,Iterable<Tuple2<Integer,Long>>
public class KeyGroupRangeOffsets extends Object implements Iterable<Tuple2<Integer,Long>>, Serializable
This class combines a key-group range with offsets that correspond to the key-groups in the range.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description KeyGroupRangeOffsets(int rangeStart, int rangeEnd)
Creates key-group range with offsets from the given start key-group to end key-group.KeyGroupRangeOffsets(int rangeStart, int rangeEnd, long[] offsets)
Creates key-group range with offsets from the given start key-group to end key-group.KeyGroupRangeOffsets(KeyGroupRange keyGroupRange)
Creates key-group range with offsets for the given key-group range, where all offsets are initially zero.KeyGroupRangeOffsets(KeyGroupRange keyGroupRange, long[] offsets)
Creates key-group range with offsets from the given key-group range.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
KeyGroupRangeOffsets
getIntersection(KeyGroupRange keyGroupRange)
Returns a key-group range with offsets which is the intersection of the internal key-group range with the given key-group range.long
getKeyGroupOffset(int keyGroup)
Returns the offset for the given key-group.KeyGroupRange
getKeyGroupRange()
int
hashCode()
Iterator<Tuple2<Integer,Long>>
iterator()
static IllegalArgumentException
newIllegalKeyGroupException(int keyGroup, KeyGroupRange keyGroupRange)
void
setKeyGroupOffset(int keyGroup, long offset)
Sets the offset for the given key-group.String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
KeyGroupRangeOffsets
public KeyGroupRangeOffsets(KeyGroupRange keyGroupRange, long[] offsets)
Creates key-group range with offsets from the given key-group range. The order of given offsets must be aligned with respect to the key-groups in the range.- Parameters:
keyGroupRange
- The range of key-groups.offsets
- The aligned array of offsets for the given key-groups.
-
KeyGroupRangeOffsets
public KeyGroupRangeOffsets(int rangeStart, int rangeEnd, long[] offsets)
Creates key-group range with offsets from the given start key-group to end key-group. The order of given offsets must be aligned with respect to the key-groups in the range.- Parameters:
rangeStart
- Start key-group of the range (inclusive)rangeEnd
- End key-group of the range (inclusive)offsets
- The aligned array of offsets for the given key-groups.
-
KeyGroupRangeOffsets
public KeyGroupRangeOffsets(int rangeStart, int rangeEnd)
Creates key-group range with offsets from the given start key-group to end key-group. All offsets are initially zero.- Parameters:
rangeStart
- Start key-group of the range (inclusive)rangeEnd
- End key-group of the range (inclusive)
-
KeyGroupRangeOffsets
public KeyGroupRangeOffsets(KeyGroupRange keyGroupRange)
Creates key-group range with offsets for the given key-group range, where all offsets are initially zero.- Parameters:
keyGroupRange
- The range of key-groups.
-
-
Method Detail
-
newIllegalKeyGroupException
public static IllegalArgumentException newIllegalKeyGroupException(int keyGroup, KeyGroupRange keyGroupRange)
-
getKeyGroupOffset
public long getKeyGroupOffset(int keyGroup)
Returns the offset for the given key-group. The key-group must be contained in the range.- Parameters:
keyGroup
- Key-group for which we query the offset. Key-group must be contained in the range.- Returns:
- The offset for the given key-group which must be contained in the range.
-
setKeyGroupOffset
public void setKeyGroupOffset(int keyGroup, long offset)
Sets the offset for the given key-group. The key-group must be contained in the range.- Parameters:
keyGroup
- Key-group for which we set the offset. Must be contained in the range.offset
- Offset for the key-group.
-
getIntersection
public KeyGroupRangeOffsets getIntersection(KeyGroupRange keyGroupRange)
Returns a key-group range with offsets which is the intersection of the internal key-group range with the given key-group range.- Parameters:
keyGroupRange
- Key-group range to intersect with the internal key-group range.- Returns:
- The key-group range with offsets for the intersection of the internal key-group range with the given key-group range.
-
getKeyGroupRange
public KeyGroupRange getKeyGroupRange()
-
-