Package org.apache.pulsar.client.impl
Class RawBatchConverter
java.lang.Object
org.apache.pulsar.client.impl.RawBatchConverter
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic List<org.apache.commons.lang3.tuple.ImmutableTriple<org.apache.pulsar.client.api.MessageId,String, Integer>> 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) static List<MessageCompactionData>extractMessageCompactionData(RawMessage msg, org.apache.pulsar.common.api.proto.MessageMetadata metadata) static booleanstatic booleanisReadableBatch(org.apache.pulsar.common.api.proto.MessageMetadata metadata) static Optional<RawMessage>rebatchMessage(RawMessage msg, BiPredicate<String, org.apache.pulsar.client.api.MessageId> filter) 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) Take a batched message and a filter, and returns a message with the only the sub-messages which match the filter.
-
Constructor Details
-
RawBatchConverter
public RawBatchConverter()
-
-
Method Details
-
isReadableBatch
-
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, extractIdsAndKeysAndSizeInteger>> (RawMessage msg) throws IOException - Throws:
IOException
-
extractIdsAndKeysAndSize
public static List<org.apache.commons.lang3.tuple.ImmutableTriple<org.apache.pulsar.client.api.MessageId,String, extractIdsAndKeysAndSizeInteger>> (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 IOExceptionTake 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
-