public class ReadMarker extends Object
Modifier and Type | Method and Description |
---|---|
static ReadMarker |
fromIdentifierOrNow(String id)
Like
#fromIdentifierOrTime(String, long, java.util.concurrent.TimeUnit) but uses the current time point
as the starting timestamp if the log has no record of the id. |
static ReadMarker |
fromIdentifierOrTime(String id,
java.time.Instant timestamp)
Starts reading the log from the last recorded point in the log for the given id.
|
static ReadMarker |
fromNow()
Starts reading the log such that it will start with the first entry written after now.
|
static ReadMarker |
fromTime(java.time.Instant timestamp)
Starts reading the log from the given timestamp onward.
|
String |
getIdentifier()
Returns the configured identifier of this marker or throws an exception if none exists.
|
java.time.Instant |
getStartTime(TimestampProvider times)
Returns the start time of this marker if such has been defined or the current time if not
|
boolean |
hasIdentifier()
Whether this read marker has a configured identifier
|
boolean |
hasStartTime() |
boolean |
isCompatible(ReadMarker newMarker) |
public boolean hasIdentifier()
public String getIdentifier()
public boolean hasStartTime()
public java.time.Instant getStartTime(TimestampProvider times)
public boolean isCompatible(ReadMarker newMarker)
newMarker
- public static ReadMarker fromNow()
public static ReadMarker fromTime(java.time.Instant timestamp)
timestamp
- public static ReadMarker fromIdentifierOrTime(String id, java.time.Instant timestamp)
id
- timestamp
- public static ReadMarker fromIdentifierOrNow(String id)
#fromIdentifierOrTime(String, long, java.util.concurrent.TimeUnit)
but uses the current time point
as the starting timestamp if the log has no record of the id.id
- Copyright © 2012–2017. All rights reserved.