Class PrimaryOwnerOnlyCollector<T>

  • All Implemented Interfaces:
    Collector<T>

    public class PrimaryOwnerOnlyCollector<T>
    extends java.lang.Object
    implements Collector<T>
    A Collector implementation that only waits for the primary owner.
    Since:
    9.0
    Author:
    Pedro Ruivo
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.concurrent.CompletableFuture<T> getFuture()  
      void primaryException​(java.lang.Throwable throwable)
      The exception results of the primary owner.
      void primaryResult​(T result, boolean success)
      The write operation's return value.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PrimaryOwnerOnlyCollector

        public PrimaryOwnerOnlyCollector()
    • Method Detail

      • getFuture

        public java.util.concurrent.CompletableFuture<T> getFuture()
        Specified by:
        getFuture in interface Collector<T>
        Returns:
        The CompletableFuture that will be completed when all the acks are received.
      • primaryException

        public void primaryException​(java.lang.Throwable throwable)
        Description copied from interface: Collector
        The exception results of the primary owner.
        Specified by:
        primaryException in interface Collector<T>
        Parameters:
        throwable - the Throwable throw by the primary owner
      • primaryResult

        public void primaryResult​(T result,
                                  boolean success)
        Description copied from interface: Collector
        The write operation's return value.
        Specified by:
        primaryResult in interface Collector<T>
        Parameters:
        result - the operation's return value
        success - true if it was successful, false otherwise (for conditional operations).