Class Utils


  • public class Utils
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      Utils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.nio.ByteBuffer serializeRecordToFlatBuffer​(com.google.flatbuffers.FlatBufferBuilder builder, org.apache.pulsar.functions.api.Record<byte[]> record)  
      static java.nio.ByteBuffer serializeRecordToFlatBuffer​(org.apache.pulsar.functions.api.Record<byte[]> record)
      Serialize record to flat-buffer.
      static java.lang.String serializeRecordToJson​(org.apache.pulsar.functions.api.Record<byte[]> record)
      Serializes sink-record into json format.
      • Methods inherited from class java.lang.Object

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

      • Utils

        public Utils()
    • Method Detail

      • serializeRecordToFlatBuffer

        public static java.nio.ByteBuffer serializeRecordToFlatBuffer​(org.apache.pulsar.functions.api.Record<byte[]> record)
        Serialize record to flat-buffer. it's not a thread-safe method.
        Parameters:
        record -
        Returns:
      • serializeRecordToFlatBuffer

        public static java.nio.ByteBuffer serializeRecordToFlatBuffer​(com.google.flatbuffers.FlatBufferBuilder builder,
                                                                      org.apache.pulsar.functions.api.Record<byte[]> record)
      • serializeRecordToJson

        public static java.lang.String serializeRecordToJson​(org.apache.pulsar.functions.api.Record<byte[]> record)
        Serializes sink-record into json format. It encodes encryption-keys, encryption-param and payload in base64 format so, it can be sent in json.
        Parameters:
        record -
        Returns: