Package org.apache.pulsar.io.file
Class FileRecord
- java.lang.Object
-
- org.apache.pulsar.io.file.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.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringFILE_ABSOLUTE_PATHstatic java.lang.StringFILE_MODIFIED_TIMEstatic java.lang.StringFILE_NAME
-
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()voidsetProperty(java.lang.String key, java.lang.String value)
-
-
-
Field Detail
-
FILE_NAME
public static final java.lang.String FILE_NAME
- See Also:
- Constant Field Values
-
FILE_ABSOLUTE_PATH
public static final java.lang.String FILE_ABSOLUTE_PATH
- See Also:
- Constant Field Values
-
FILE_MODIFIED_TIME
public static final java.lang.String FILE_MODIFIED_TIME
- See Also:
- Constant Field Values
-
-
Method Detail
-
getKey
public java.util.Optional<java.lang.String> getKey()
- Specified by:
getKeyin interfaceorg.apache.pulsar.functions.api.Record<byte[]>
-
getValue
public byte[] getValue()
- Specified by:
getValuein interfaceorg.apache.pulsar.functions.api.Record<byte[]>
-
getProperties
public java.util.Map<java.lang.String,java.lang.String> getProperties()
- Specified by:
getPropertiesin interfaceorg.apache.pulsar.functions.api.Record<byte[]>
-
setProperty
public void setProperty(java.lang.String key, java.lang.String value)
-
-