Class RawBatchConverter


  • public class RawBatchConverter
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.List<org.apache.commons.lang3.tuple.ImmutableTriple<org.apache.pulsar.client.api.MessageId,​java.lang.String,​java.lang.Integer>> extractIdsAndKeysAndSize​(RawMessage msg)  
      static boolean isReadableBatch​(RawMessage msg)  
      static java.util.Optional<RawMessage> rebatchMessage​(RawMessage msg, java.util.function.BiPredicate<java.lang.String,​org.apache.pulsar.client.api.MessageId> filter)
      Take a batched message and a filter, and returns a message with the only the sub-messages which match the filter.
      • Methods inherited from class java.lang.Object

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

      • RawBatchConverter

        public RawBatchConverter()
    • Method Detail

      • isReadableBatch

        public static boolean isReadableBatch​(RawMessage msg)
      • extractIdsAndKeysAndSize

        public static java.util.List<org.apache.commons.lang3.tuple.ImmutableTriple<org.apache.pulsar.client.api.MessageId,​java.lang.String,​java.lang.Integer>> extractIdsAndKeysAndSize​(RawMessage msg)
                                                                                                                                                                                              throws java.io.IOException
        Throws:
        java.io.IOException
      • rebatchMessage

        public static java.util.Optional<RawMessage> rebatchMessage​(RawMessage msg,
                                                                    java.util.function.BiPredicate<java.lang.String,​org.apache.pulsar.client.api.MessageId> filter)
                                                             throws java.io.IOException
        Take a batched message and a filter, and returns a message with the only the sub-messages which match the filter. Returns an empty optional if no messages match. NOTE: this message does not alter the reference count of the RawMessage argument.
        Throws:
        java.io.IOException