Package org.apache.pulsar.client.impl
Class RawBatchConverter
- java.lang.Object
-
- org.apache.pulsar.client.impl.RawBatchConverter
-
public class RawBatchConverter extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description RawBatchConverter()
-
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 booleanisReadableBatch(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.
-
-
-
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
-
-