Modifier and Type | Method and Description |
---|---|
static EventPosition |
earliest()
Corresponds to the location of the first event present in the partition.
|
boolean |
equals(Object obj) |
static EventPosition |
fromEnqueuedTime(Instant enqueuedDateTime)
Creates a position at the given
Instant . |
static EventPosition |
fromOffset(long offset)
Corresponds to the event in the partition at the provided offset, inclusive of that event.
|
static EventPosition |
fromSequenceNumber(long sequenceNumber)
Creates a position to an event in the partition at the provided sequence number.
|
static EventPosition |
fromSequenceNumber(long sequenceNumber,
boolean isInclusive)
Creates a position at the given sequence number.
|
Instant |
getEnqueuedDateTime()
Gets the instant, in UTC, from which the next available event should be chosen.
|
String |
getOffset()
Gets the relative position for event in the context of the stream.
|
Long |
getSequenceNumber()
Gets the sequence number of the event.
|
int |
hashCode() |
boolean |
isInclusive()
Gets the boolean value of if the event is included.
|
static EventPosition |
latest()
Corresponds to the end of the partition, where no more events are currently enqueued.
|
String |
toString() |
public static EventPosition earliest()
EventPosition
set to the start of an Event Hub stream.public static EventPosition latest()
receiveFromPartition()
invoked.EventPosition
set to the end of an Event Hubs stream and listens for new events.public static EventPosition fromEnqueuedTime(Instant enqueuedDateTime)
Instant
. Corresponds to a specific instance within a partition to begin
looking for an event. The event enqueued after the requested enqueuedDateTime
becomes the current
position.enqueuedDateTime
- The instant, in UTC, from which the next available event should be chosen.EventPosition
object.public static EventPosition fromOffset(long offset)
The offset is the relative position for event in the context of the stream. The offset should not be considered a stable value, as the same offset may refer to a different event as events reach the age limit for retention and are no longer visible within the stream.
offset
- The offset of the event within that partition.EventPosition
object.public static EventPosition fromSequenceNumber(long sequenceNumber)
sequenceNumber
- is the sequence number of the event.EventPosition
object.public static EventPosition fromSequenceNumber(long sequenceNumber, boolean isInclusive)
isInclusive
is true, the event with the same sequence
number is returned. Otherwise, the next event in the sequence is received.sequenceNumber
- is the sequence number of the event.isInclusive
- If true, the event with the sequenceNumber
is included; otherwise, the next event
will be received.EventPosition
object.public boolean isInclusive()
sequenceNumber
is
included; otherwise, the next event will be received.public String getOffset()
public Long getSequenceNumber()
public Instant getEnqueuedDateTime()
Copyright © 2019 Microsoft Corporation. All rights reserved.