Package io.pravega.client.stream.impl
Class EventReadImpl<T>
- java.lang.Object
-
- io.pravega.client.stream.impl.EventReadImpl<T>
-
-
Constructor Summary
Constructors Constructor Description EventReadImpl(T event, Position position, EventPointer eventPointer, java.lang.String checkpointName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
canEqual(java.lang.Object other)
boolean
equals(java.lang.Object o)
java.lang.String
getCheckpointName()
If a checkpoint has been requested this will return the checkpointName passed toReaderGroup.initiateCheckpoint(String,ScheduledExecutorService)
otherwise this will return null.T
getEvent()
Returns the event that is wrapped in this EventRead or null a timeout occurred or if a checkpoint was requested.EventPointer
getEventPointer()
Returns a pointer object for the event read.Position
getPosition()
The position in the stream that represents where the reader is immediately following this event.int
hashCode()
boolean
isCheckpoint()
A boolean indicating if this is a checkpoint.java.lang.String
toString()
-
-
-
Constructor Detail
-
EventReadImpl
@ConstructorProperties({"event","position","eventPointer","checkpointName"}) public EventReadImpl(T event, Position position, EventPointer eventPointer, java.lang.String checkpointName)
-
-
Method Detail
-
isCheckpoint
public boolean isCheckpoint()
Description copied from interface:EventRead
A boolean indicating if this is a checkpoint. In which caseEventRead.getCheckpointName()
will be non-null andEventRead.getEvent()
will be null.- Specified by:
isCheckpoint
in interfaceEventRead<T>
- Returns:
- true if this is a checkpoint.
-
getEvent
public T getEvent()
Description copied from interface:EventRead
Returns the event that is wrapped in this EventRead or null a timeout occurred or if a checkpoint was requested.
-
getPosition
public Position getPosition()
Description copied from interface:EventRead
The position in the stream that represents where the reader is immediately following this event. It is useful to store this so thatReaderGroup.readerOffline(String, Position)
can be called if the reader dies.- Specified by:
getPosition
in interfaceEventRead<T>
- Returns:
- Position of the event
-
getEventPointer
public EventPointer getEventPointer()
Description copied from interface:EventRead
Returns a pointer object for the event read. The event pointer enables a random read of the event at a future time.- Specified by:
getEventPointer
in interfaceEventRead<T>
- Returns:
- Pointer to an event
-
getCheckpointName
public java.lang.String getCheckpointName()
Description copied from interface:EventRead
If a checkpoint has been requested this will return the checkpointName passed toReaderGroup.initiateCheckpoint(String,ScheduledExecutorService)
otherwise this will return null.- Specified by:
getCheckpointName
in interfaceEventRead<T>
- Returns:
- The name of the checkpoint
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
canEqual
protected boolean canEqual(java.lang.Object other)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-