Class PositionImpl

    • 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: Position
        Used internally. Do not call.
        Returns:
        Implementation of position object interface
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toBytes

        public java.nio.ByteBuffer toBytes()
        Description copied from interface: Position
        Serializes the position to a compact byte array.
        Returns:
        compact byte array
      • fromBytes

        public static Position fromBytes​(java.nio.ByteBuffer buff)
        Description copied from interface: Position
        Deserializes the position from its serialized from obtained from calling Position.toBytes().
        Parameters:
        buff - A serialized position.
        Returns:
        The position object.
      • builder

        public static io.pravega.client.stream.impl.PositionImpl.PositionBuilder builder()