Interface LogAppender<M extends Externalizable>

    • Method Detail

      • name

        Name name()
        Returns the Log's name.
      • size

        int size()
        Returns the number of partitions in the Log.
      • append

        LogOffset append​(int partition,
                         M message)
        Append a message into a partition, returns LogOffset position of the message. This method is thread safe, a queue can be shared by multiple producers.
        Parameters:
        partition - index lower than size()
      • waitFor

        boolean waitFor​(LogOffset offset,
                        Name group,
                        Duration timeout)
                 throws InterruptedException
        Wait for consumer to process a message up to the offset. The message is processed if a consumer of the group commits a greater or equals offset. Return true if the message has been consumed, false in case of timeout.
        Throws:
        InterruptedException
      • closed

        boolean closed()
        Returns true if the appender has been closed by the manager.
      • getCodec

        Codec<M> getCodec()
        Returns the codec used to write record. A null codec is the default legacy encoding.
        Since:
        10.2