Class FileRecord

  • All Implemented Interfaces:
    org.apache.pulsar.functions.api.Record<byte[]>

    public class FileRecord
    extends java.lang.Object
    implements org.apache.pulsar.functions.api.Record<byte[]>
    Implementation of the Record interface for File Source data. - The key is set to the source file name + the line number of the record. - The value is set to the file contents for the given line number (in bytes) - The following user properties are also set: - The source file name - The absolute path of the source file - The last modified time of the source file.
    • Constructor Summary

      Constructors 
      Constructor Description
      FileRecord​(java.io.File srcFile, int lineNumber, byte[] value)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Optional<java.lang.String> getKey()  
      java.util.Map<java.lang.String,​java.lang.String> getProperties()  
      byte[] getValue()  
      void setProperty​(java.lang.String key, java.lang.String value)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.apache.pulsar.functions.api.Record

        ack, fail, getDestinationTopic, getEventTime, getMessage, getPartitionId, getPartitionIndex, getRecordSequence, getSchema, getTopicName
    • Constructor Detail

      • FileRecord

        public FileRecord​(java.io.File srcFile,
                          int lineNumber,
                          byte[] value)
    • Method Detail

      • getKey

        public java.util.Optional<java.lang.String> getKey()
        Specified by:
        getKey in interface org.apache.pulsar.functions.api.Record<byte[]>
      • getValue

        public byte[] getValue()
        Specified by:
        getValue in interface org.apache.pulsar.functions.api.Record<byte[]>
      • getProperties

        public java.util.Map<java.lang.String,​java.lang.String> getProperties()
        Specified by:
        getProperties in interface org.apache.pulsar.functions.api.Record<byte[]>
      • setProperty

        public void setProperty​(java.lang.String key,
                                java.lang.String value)