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 booleancanEqual(java.lang.Object other)booleanequals(java.lang.Object o)java.lang.StringgetCheckpointName()If a checkpoint has been requested this will return the checkpointName passed toReaderGroup.initiateCheckpoint(String,ScheduledExecutorService)otherwise this will return null.TgetEvent()Returns the event that is wrapped in this EventRead or null a timeout occurred or if a checkpoint was requested.EventPointergetEventPointer()Returns a pointer object for the event read.PositiongetPosition()The position in the stream that represents where the reader is immediately following this event.inthashCode()booleanisCheckpoint()A boolean indicating if this is a checkpoint.java.lang.StringtoString()
-
-
-
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:EventReadA boolean indicating if this is a checkpoint. In which caseEventRead.getCheckpointName()will be non-null andEventRead.getEvent()will be null.- Specified by:
isCheckpointin interfaceEventRead<T>- Returns:
- true if this is a checkpoint.
-
getEvent
public T getEvent()
Description copied from interface:EventReadReturns 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:EventReadThe 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:
getPositionin interfaceEventRead<T>- Returns:
- Position of the event
-
getEventPointer
public EventPointer getEventPointer()
Description copied from interface:EventReadReturns a pointer object for the event read. The event pointer enables a random read of the event at a future time.- Specified by:
getEventPointerin interfaceEventRead<T>- Returns:
- Pointer to an event
-
getCheckpointName
public java.lang.String getCheckpointName()
Description copied from interface:EventReadIf a checkpoint has been requested this will return the checkpointName passed toReaderGroup.initiateCheckpoint(String,ScheduledExecutorService)otherwise this will return null.- Specified by:
getCheckpointNamein interfaceEventRead<T>- Returns:
- The name of the checkpoint
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
canEqual
protected boolean canEqual(java.lang.Object other)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-