OmniSciDB
a5dc49c757
|
#include <FileReader.h>
Public Member Functions | |
FileReader (const std::string &file_path, const import_export::CopyParams ©_params) | |
virtual | ~FileReader ()=default |
virtual size_t | read (void *buffer, size_t max_size)=0 |
virtual bool | isScanFinished () const =0 |
virtual size_t | readRegion (void *buffer, size_t offset, size_t size)=0 |
virtual size_t | getRemainingSize ()=0 |
virtual bool | isRemainingSizeKnown ()=0 |
virtual void | checkForMoreRows (size_t file_offset, const shared::FilePathOptions &options, const ForeignServer *server_options=nullptr, const UserMapping *user_mapping=nullptr) |
virtual void | serialize (rapidjson::Value &value, rapidjson::Document::AllocatorType &allocator) const =0 |
virtual FirstLineByFilePath | getFirstLineForEachFile () const =0 |
virtual bool | isEndOfLastFile ()=0 |
virtual std::string | getCurrentFilePath () const =0 |
Protected Attributes | |
import_export::CopyParams | copy_params_ |
std::string | file_path_ |
Definition at line 43 of file FileReader.h.
|
inline |
Definition at line 45 of file FileReader.h.
|
virtualdefault |
|
inlinevirtual |
Rescan the target files Throws an exception if the rescan fails (ie files are not in a valid appended state or not supported)
file_offset | - where to resume the scan from (end of the last row) as not all of the bytes may have been consumed by the upstream compoennet |
server_options | - only needed for S3 backed files |
user_mapping | - only needed for S3 backed files |
Reimplemented in foreign_storage::LocalMultiFileReader, foreign_storage::CompressedFileReader, and foreign_storage::SingleTextFileReader.
Definition at line 93 of file FileReader.h.
|
pure virtual |
Returns the path of the currently processed file.
Implemented in foreign_storage::MultiFileReader, and foreign_storage::SingleFileReader.
Referenced by foreign_storage::dispatch_scan_requests().
|
pure virtual |
Returns a map containing the first line for each file that will be read.
Implemented in foreign_storage::MultiFileReader, and foreign_storage::SingleFileReader.
Referenced by foreign_storage::RegexFileBufferParser::validateFiles().
|
pure virtual |
Implemented in foreign_storage::MultiFileReader, foreign_storage::CompressedFileReader, and foreign_storage::SingleTextFileReader.
|
pure virtual |
Returns a boolean indicating whether the reader is at the end of the last file that was read.
Implemented in foreign_storage::MultiFileReader, and foreign_storage::SingleFileReader.
Referenced by foreign_storage::RegexFileBufferParser::findRowEndPosition().
|
pure virtual |
Implemented in foreign_storage::MultiFileReader, foreign_storage::CompressedFileReader, and foreign_storage::SingleTextFileReader.
|
pure virtual |
Implemented in foreign_storage::MultiFileReader, foreign_storage::CompressedFileReader, and foreign_storage::SingleTextFileReader.
Referenced by foreign_storage::dispatch_scan_requests(), import_export::delimited_parser::find_row_end_pos(), foreign_storage::RegexFileBufferParser::findRowEndPosition(), foreign_storage::anonymous_namespace{AbstractTextFileDataWrapper.cpp}::is_file_scan_finished(), and foreign_storage::SingleFileReader::isEndOfLastFile().
|
pure virtual |
Read up to max_size bytes from archive into buffer starting starting from the end of the last read
buffer | - buffer to load into |
max_size | - maximum number of bytes to read into the buffer |
Implemented in foreign_storage::MultiFileReader, foreign_storage::CompressedFileReader, and foreign_storage::SingleTextFileReader.
Referenced by foreign_storage::dispatch_scan_requests(), and import_export::delimited_parser::extend_buffer().
|
pure virtual |
Read up to max_size bytes from archive, starting at given offset isScanFinished() must return true to use readRegion
buffer | - buffer to load into |
offset | - starting point into the archive to read |
size | - maximum number of bytes to read into the buffer |
Implemented in foreign_storage::MultiFileReader, foreign_storage::CompressedFileReader, and foreign_storage::SingleTextFileReader.
Referenced by foreign_storage::parse_file_regions().
|
pure virtual |
Serialize internal state to given json object This Json will later be used to restore the reader state through a constructor must be called when isScanFinished() is true
value | - json object to store needed state to this function can store any needed data or none |
allocator | - allocator to use for json contruction |
Implemented in foreign_storage::MultiFileReader, foreign_storage::CompressedFileReader, and foreign_storage::SingleTextFileReader.
|
protected |
Definition at line 128 of file FileReader.h.
Referenced by foreign_storage::CompressedFileReader::consumeFirstLine(), foreign_storage::SingleTextFileReader::getFirstLine(), foreign_storage::CompressedFileReader::getFirstLine(), foreign_storage::LocalMultiFileReader::insertFile(), foreign_storage::LocalMultiFileReader::LocalMultiFileReader(), foreign_storage::MultiFileReader::read(), foreign_storage::CompressedFileReader::readInternal(), foreign_storage::MultiFileReader::readRegion(), foreign_storage::SingleTextFileReader::skipHeader(), and foreign_storage::CompressedFileReader::skipHeader().
|
protected |
Definition at line 129 of file FileReader.h.
Referenced by foreign_storage::SingleTextFileReader::checkForMoreRows(), foreign_storage::CompressedFileReader::checkForMoreRows(), foreign_storage::LocalMultiFileReader::checkForMoreRows(), foreign_storage::LocalMultiFileReader::getAllFilePaths(), foreign_storage::SingleFileReader::getCurrentFilePath(), foreign_storage::SingleTextFileReader::getFirstLine(), foreign_storage::CompressedFileReader::getFirstLine(), foreign_storage::SingleFileReader::getFirstLineForEachFile(), and foreign_storage::SingleTextFileReader::readRegion().