Interface SegmentAwarePublisherSupplier<R>
- Type Parameters:
R
- value type
- All Superinterfaces:
SegmentPublisherSupplier<R>
SegmentPublisherSupplier
except that it also allows listening for when a segment is
lost. The lost segment provides the same notification guarantees as the segment completion of the parent interface.
This interface is normally just for internal Infinispan usage as users shouldn't normally have to care about retrying.
Implementors of this do not do retries and instead notify of lost segments instead of retrying, which implementors
of SegmentPublisherSupplier
normally do.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Notification that can also contains lost segments.Nested classes/interfaces inherited from interface org.infinispan.reactive.publisher.impl.SegmentPublisherSupplier
SegmentPublisherSupplier.Notification<R>
-
Method Summary
Modifier and TypeMethodDescriptiondefault org.reactivestreams.Publisher
<SegmentAwarePublisherSupplier.NotificationWithLost<R>> Same asSegmentPublisherSupplier.publisherWithSegments()
, except that we also can notify a listener when a segment has been lost before publishing all its entries.org.reactivestreams.Publisher
<SegmentAwarePublisherSupplier.NotificationWithLost<R>> publisherWithLostSegments
(boolean reuseNotifications) Same asSegmentPublisherSupplier.publisherWithSegments()
, except that we also can notify a listener when a segment has been lost before publishing all its entriesorg.reactivestreams.Publisher
<R> When this method is used theDeliveryGuarantee
is ignored as the user isn't listening to completion or lost segmentsMethods inherited from interface org.infinispan.reactive.publisher.impl.SegmentPublisherSupplier
publisherWithSegments
-
Method Details
-
publisherWithoutSegments
org.reactivestreams.Publisher<R> publisherWithoutSegments()When this method is used theDeliveryGuarantee
is ignored as the user isn't listening to completion or lost segments- Specified by:
publisherWithoutSegments
in interfaceSegmentPublisherSupplier<R>
-
publisherWithLostSegments
default org.reactivestreams.Publisher<SegmentAwarePublisherSupplier.NotificationWithLost<R>> publisherWithLostSegments()Same asSegmentPublisherSupplier.publisherWithSegments()
, except that we also can notify a listener when a segment has been lost before publishing all its entries.The provided
DeliveryGuarantee
when creating this SegmentAwarePublisherSupplier will control how a lost segment notification is raisedSegmentAwarePublisherSupplier.NotificationWithLost.isLostSegment()
.Summary of Delivery Guarantee Effects
Delivery Guarantee Effect DeliveryGuarantee.AT_MOST_ONCE
A segment is lost only if this node is not the read owner when starting to read it. If ths segment is no longer readable after the publisher started, no more entries are returned and the segment is completed normally. DeliveryGuarantee.AT_LEAST_ONCE
Same as DeliveryGuarantee.EXACTLY_ONCE
.DeliveryGuarantee.EXACTLY_ONCE
A segment is lost if at any point while reading entries from it, this node is no longer a read owner of the given segment. Therefore if the segment is complete, the publisher is guaranteed to include all values for the given segment. If the cache is LOCAL only the
DeliveryGuarantee.AT_MOST_ONCE
should be used as there is no difference between the different guarantees, and it is more performant. -
publisherWithLostSegments
org.reactivestreams.Publisher<SegmentAwarePublisherSupplier.NotificationWithLost<R>> publisherWithLostSegments(boolean reuseNotifications) Same asSegmentPublisherSupplier.publisherWithSegments()
, except that we also can notify a listener when a segment has been lost before publishing all its entriesIf reuseNotifications parameter is true then the returned Notifications can be the same object containing different results. This means any consumer must not store the Notification or process them asynchronously or else you could find incorrect values. This parameter is solely for memory and performance uses when it is known that the returned Publisher will be consumed synchronously and process the values and segments immediately.
- Parameters:
reuseNotifications
- If the returned Publisher can reuse notification objects to save memory
-