Package io.pravega.client.stream.impl
Class PendingEvent
- java.lang.Object
-
- io.pravega.client.stream.impl.PendingEvent
-
public class PendingEvent extends java.lang.ObjectThis is a internal wrapper object used in the writer to pass along the routing key and the future with the actual event during write.
-
-
Field Summary
Fields Modifier and Type Field Description static intMAX_WRITE_SIZEThe serialized event max size.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancanEqual(java.lang.Object other)booleanequals(java.lang.Object o)java.util.concurrent.CompletableFuture<java.lang.Void>getAckFuture()Callback to be invoked when the data is written.io.netty.buffer.ByteBufgetData()The data to be written.intgetEventCount()java.lang.StringgetRoutingKey()The routing key that was provided to route the data.inthashCode()java.lang.StringtoString()static PendingEventwithHeader(@NonNull java.lang.String routingKey, @NonNull java.util.List<java.nio.ByteBuffer> batch, @NonNull java.util.concurrent.CompletableFuture<java.lang.Void> ackFuture)static PendingEventwithHeader(java.lang.String routingKey, java.nio.ByteBuffer data, java.util.concurrent.CompletableFuture<java.lang.Void> ackFuture)static PendingEventwithoutHeader(java.lang.String routingKey, java.nio.ByteBuffer data, java.util.concurrent.CompletableFuture<java.lang.Void> ackFuture)
-
-
-
Field Detail
-
MAX_WRITE_SIZE
public static final int MAX_WRITE_SIZE
The serialized event max size. Equals to the max event payload size plus additional 8 bytes for the wire command code and the payload size.- See Also:
for the details., Constant Field Values
-
-
Method Detail
-
withHeader
public static PendingEvent withHeader(java.lang.String routingKey, java.nio.ByteBuffer data, java.util.concurrent.CompletableFuture<java.lang.Void> ackFuture)
-
withHeader
public static PendingEvent withHeader(@NonNull @NonNull java.lang.String routingKey, @NonNull @NonNull java.util.List<java.nio.ByteBuffer> batch, @NonNull @NonNull java.util.concurrent.CompletableFuture<java.lang.Void> ackFuture)
-
withoutHeader
public static PendingEvent withoutHeader(java.lang.String routingKey, java.nio.ByteBuffer data, java.util.concurrent.CompletableFuture<java.lang.Void> ackFuture)
-
getRoutingKey
public java.lang.String getRoutingKey()
The routing key that was provided to route the data.
-
getData
public io.netty.buffer.ByteBuf getData()
The data to be written. Note this is limited to 8388616 bytes.
-
getEventCount
public int getEventCount()
-
getAckFuture
public java.util.concurrent.CompletableFuture<java.lang.Void> getAckFuture()
Callback to be invoked when the data is written.
-
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
-
-