Class RawBatchConverter

java.lang.Object
org.apache.pulsar.client.impl.RawBatchConverter

public class RawBatchConverter extends Object
  • Constructor Details

    • RawBatchConverter

      public RawBatchConverter()
  • Method Details

    • isReadableBatch

      public static boolean isReadableBatch(RawMessage msg)
    • isReadableBatch

      public static boolean isReadableBatch(org.apache.pulsar.common.api.proto.MessageMetadata metadata)
    • extractMessageCompactionData

      public static List<MessageCompactionData> extractMessageCompactionData(RawMessage msg, org.apache.pulsar.common.api.proto.MessageMetadata metadata) throws IOException
      Throws:
      IOException
    • extractIdsAndKeysAndSize

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

      public static List<org.apache.commons.lang3.tuple.ImmutableTriple<org.apache.pulsar.client.api.MessageId,String,Integer>> extractIdsAndKeysAndSize(RawMessage msg, org.apache.pulsar.common.api.proto.MessageMetadata metadata) throws IOException
      Throws:
      IOException
    • rebatchMessage

      public static Optional<RawMessage> rebatchMessage(RawMessage msg, BiPredicate<String,org.apache.pulsar.client.api.MessageId> filter) throws IOException
      Throws:
      IOException
    • rebatchMessage

      public static Optional<RawMessage> rebatchMessage(RawMessage msg, org.apache.pulsar.common.api.proto.MessageMetadata metadata, BiPredicate<String,org.apache.pulsar.client.api.MessageId> filter, boolean retainNullKey) throws 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:
      IOException