Class RecordReaderFactory
- java.lang.Object
-
- org.apache.pinot.spi.data.readers.RecordReaderFactory
-
public class RecordReaderFactory extends Object
-
-
Method Summary
Modifier and Type Method Description static RecordReadergetRecordReader(String fileFormat, File dataFile, Set<String> fieldsToRead, RecordReaderConfig recordReaderConfig)Constructs and initializes a RecordReader based on the given file format and RecordReader config.static RecordReadergetRecordReader(FileFormat fileFormat, File dataFile, Set<String> fieldsToRead, RecordReaderConfig recordReaderConfig)Constructs and initializes a RecordReader based on the given file format and RecordReader config.static RecordReadergetRecordReaderByClass(String recordReaderClassName, File dataFile, Set<String> fieldsToRead, RecordReaderConfig recordReaderConfig)Constructs and initializes a RecordReader based on the given RecordReader class name and config.static StringgetRecordReaderClassName(String fileFormatStr)Get registered RecordReader class name given a file format.static RecordReaderConfiggetRecordReaderConfig(FileFormat fileFormat, String readerConfigFile)Construct a RecordReaderConfig instance from a given file.static RecordReaderConfiggetRecordReaderConfig(FileFormat fileFormat, Map<String,String> configs)Creates aRecordReaderConfiginstance using file format and reader config propertiesstatic RecordReaderConfiggetRecordReaderConfigByClassName(String recordReaderConfigClassName, File readerConfigFile)Construct a RecordReaderConfig instance from a given file.static RecordReaderConfiggetRecordReaderConfigByClassName(String recordReaderConfigClassName, String readerConfigFile)Construct a RecordReaderConfig instance from a given file path.static StringgetRecordReaderConfigClassName(String fileFormatStr)Get registered RecordReaderConfig class name given a file format.static voidregister(String fileFormat, String recordReaderClassName, String recordReaderConfigClassName)static voidregister(FileFormat fileFormat, String recordReaderClassName, String recordReaderConfigClassName)
-
-
-
Method Detail
-
register
public static void register(String fileFormat, String recordReaderClassName, String recordReaderConfigClassName)
-
register
public static void register(FileFormat fileFormat, String recordReaderClassName, String recordReaderConfigClassName)
-
getRecordReaderConfigByClassName
public static RecordReaderConfig getRecordReaderConfigByClassName(String recordReaderConfigClassName, String readerConfigFile) throws IOException, ClassNotFoundException
Construct a RecordReaderConfig instance from a given file path.- Parameters:
recordReaderConfigClassName-readerConfigFile-- Returns:
- Throws:
IOExceptionClassNotFoundException
-
getRecordReaderConfigByClassName
public static RecordReaderConfig getRecordReaderConfigByClassName(String recordReaderConfigClassName, File readerConfigFile) throws IOException, ClassNotFoundException
Construct a RecordReaderConfig instance from a given file.- Parameters:
recordReaderConfigClassName-readerConfigFile-- Returns:
- Throws:
IOExceptionClassNotFoundException
-
getRecordReaderConfig
public static RecordReaderConfig getRecordReaderConfig(FileFormat fileFormat, String readerConfigFile) throws Exception
Construct a RecordReaderConfig instance from a given file.- Parameters:
fileFormat-readerConfigFile-- Returns:
- a RecordReaderConfig instance
- Throws:
Exception
-
getRecordReaderConfig
public static RecordReaderConfig getRecordReaderConfig(FileFormat fileFormat, Map<String,String> configs) throws ClassNotFoundException, IOException
Creates aRecordReaderConfiginstance using file format and reader config properties- Throws:
ClassNotFoundExceptionIOException
-
getRecordReaderByClass
public static RecordReader getRecordReaderByClass(String recordReaderClassName, File dataFile, Set<String> fieldsToRead, @Nullable RecordReaderConfig recordReaderConfig) throws Exception
Constructs and initializes a RecordReader based on the given RecordReader class name and config.- Throws:
Exception
-
getRecordReader
public static RecordReader getRecordReader(FileFormat fileFormat, File dataFile, Set<String> fieldsToRead, @Nullable RecordReaderConfig recordReaderConfig) throws Exception
Constructs and initializes a RecordReader based on the given file format and RecordReader config.- Throws:
Exception
-
getRecordReader
public static RecordReader getRecordReader(String fileFormat, File dataFile, Set<String> fieldsToRead, @Nullable RecordReaderConfig recordReaderConfig) throws Exception
Constructs and initializes a RecordReader based on the given file format and RecordReader config.- Throws:
Exception
-
getRecordReaderClassName
public static String getRecordReaderClassName(String fileFormatStr)
Get registered RecordReader class name given a file format.- Parameters:
fileFormatStr-- Returns:
- recordReaderClassName
-
-