Package cz.o2.proxima.direct.core.batch
Interface Offset
-
- All Superinterfaces:
java.io.Serializable
- All Known Implementing Classes:
Offset.SimpleOffset
public interface Offset extends java.io.Serializable
Offset representing a "pointer" to an element within a batchpartition
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
Offset.SimpleOffset
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description long
getElementIndex()
Index of the element within the partition.Partition
getPartition()
Partition the offset belongs to.boolean
isLast()
Is there any other element in the partition?static Offset.SimpleOffset
of(Partition partition, long elementIndex, boolean last)
Construct an immutable offset from given values.
-
-
-
Method Detail
-
of
static Offset.SimpleOffset of(Partition partition, long elementIndex, boolean last)
Construct an immutable offset from given values.- Parameters:
partition
- Batch partition.elementIndex
- Index of element within the partition.last
- Flag whether offset is representing the last element in the partition.- Returns:
- Offset.
-
getPartition
Partition getPartition()
Partition the offset belongs to.- Returns:
- Partition.
-
getElementIndex
long getElementIndex()
Index of the element within the partition. Elements are indexed from zero. Value of `-1` means, no element has been consumed from the partition.- Returns:
- Index of the element or `-1` if no element has been consumed.
-
isLast
boolean isLast()
Is there any other element in the partition?- Returns:
- True if there are no more elements in the partition.
-
-