Package io.pravega.client.stream.impl
Class PositionImpl
- java.lang.Object
-
- io.pravega.client.stream.impl.PositionInternal
-
- io.pravega.client.stream.impl.PositionImpl
-
- All Implemented Interfaces:
Position
public class PositionImpl extends PositionInternal
-
-
Constructor Summary
Constructors Constructor Description PositionImpl(java.util.Map<SegmentWithRange,java.lang.Long> segments)Instantiates Position with current and future owned segments.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description PositionImplasImpl()Used internally.static io.pravega.client.stream.impl.PositionImpl.PositionBuilderbuilder()booleanequals(java.lang.Object o)static PositionfromBytes(java.nio.ByteBuffer buff)Deserializes the position from its serialized from obtained from callingPosition.toBytes().java.util.Set<Segment>getCompletedSegments()java.lang.LonggetOffsetForOwnedSegment(Segment segmentId)java.util.Set<Segment>getOwnedSegments()java.util.Map<Segment,java.lang.Long>getOwnedSegmentsWithOffsets()inthashCode()java.nio.ByteBuffertoBytes()Serializes the position to a compact byte array.java.lang.StringtoString()
-
-
-
Constructor Detail
-
PositionImpl
public PositionImpl(java.util.Map<SegmentWithRange,java.lang.Long> segments)
Instantiates Position with current and future owned segments.- Parameters:
segments- Current segments that the position refers to.
-
-
Method Detail
-
getOwnedSegments
public java.util.Set<Segment> getOwnedSegments()
-
getOwnedSegmentsWithOffsets
public java.util.Map<Segment,java.lang.Long> getOwnedSegmentsWithOffsets()
-
getCompletedSegments
public java.util.Set<Segment> getCompletedSegments()
-
getOffsetForOwnedSegment
public java.lang.Long getOffsetForOwnedSegment(Segment segmentId)
-
asImpl
public PositionImpl asImpl()
Description copied from interface:PositionUsed internally. Do not call.- Returns:
- Implementation of position object interface
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toBytes
public java.nio.ByteBuffer toBytes()
Description copied from interface:PositionSerializes the position to a compact byte array.- Returns:
- compact byte array
-
fromBytes
public static Position fromBytes(java.nio.ByteBuffer buff)
Description copied from interface:PositionDeserializes the position from its serialized from obtained from callingPosition.toBytes().- Parameters:
buff- A serialized position.- Returns:
- The position object.
-
builder
public static io.pravega.client.stream.impl.PositionImpl.PositionBuilder builder()
-
-