OmniSciDB
a5dc49c757
|
#include <FileReader.h>
Public Member Functions | |
MultiFileReader (const std::string &file_path, const import_export::CopyParams ©_params) | |
MultiFileReader (const std::string &file_path, const import_export::CopyParams ©_params, const rapidjson::Value &value) | |
size_t | getRemainingSize () override |
bool | isRemainingSizeKnown () override |
size_t | read (void *buffer, size_t max_size) override |
size_t | readRegion (void *buffer, size_t offset, size_t size) override |
bool | isScanFinished () const override |
void | serialize (rapidjson::Value &value, rapidjson::Document::AllocatorType &allocator) const override |
FirstLineByFilePath | getFirstLineForEachFile () const override |
bool | isEndOfLastFile () override |
std::string | getCurrentFilePath () const override |
virtual std::set< std::string > | checkForRolledOffFiles (const shared::FilePathOptions &file_path_options) |
Public Member Functions inherited from foreign_storage::FileReader | |
FileReader (const std::string &file_path, const import_export::CopyParams ©_params) | |
virtual | ~FileReader ()=default |
virtual void | checkForMoreRows (size_t file_offset, const shared::FilePathOptions &options, const ForeignServer *server_options=nullptr, const UserMapping *user_mapping=nullptr) |
Protected Member Functions | |
virtual std::vector< std::string > | getAllFilePaths (const shared::FilePathOptions &file_path_options) const =0 |
Protected Attributes | |
std::vector< std::unique_ptr < FileReader > > | files_ |
std::vector< std::string > | file_locations_ |
std::vector< size_t > | cumulative_sizes_ |
size_t | current_index_ |
size_t | current_offset_ |
size_t | starting_offset_ |
bool | is_end_of_last_file_ |
Protected Attributes inherited from foreign_storage::FileReader | |
import_export::CopyParams | copy_params_ |
std::string | file_path_ |
Definition at line 346 of file FileReader.h.
foreign_storage::MultiFileReader::MultiFileReader | ( | const std::string & | file_path, |
const import_export::CopyParams & | copy_params | ||
) |
Definition at line 530 of file FileReader.cpp.
foreign_storage::MultiFileReader::MultiFileReader | ( | const std::string & | file_path, |
const import_export::CopyParams & | copy_params, | ||
const rapidjson::Value & | value | ||
) |
Definition at line 538 of file FileReader.cpp.
References CHECK, cumulative_sizes_, current_index_, current_offset_, file_locations_, json_utils::get_value_from_object(), and starting_offset_.
|
virtual |
Definition at line 615 of file FileReader.cpp.
References shared::check_for_rolled_off_file_paths(), CHECK_LE, cumulative_sizes_, current_index_, file_locations_, files_, getAllFilePaths(), and starting_offset_.
Referenced by foreign_storage::AbstractTextFileDataWrapper::populateChunkMetadata().
|
protectedpure virtual |
Implemented in foreign_storage::LocalMultiFileReader.
Referenced by checkForRolledOffFiles().
|
overridevirtual |
Returns the path of the currently processed file.
Implements foreign_storage::FileReader.
Definition at line 607 of file FileReader.cpp.
References CHECK_LT, current_index_, files_, and isScanFinished().
|
overridevirtual |
Returns a map containing the first line for each file that will be read.
Implements foreign_storage::FileReader.
Definition at line 595 of file FileReader.cpp.
References files_.
|
overridevirtual |
Implements foreign_storage::FileReader.
Definition at line 579 of file FileReader.cpp.
References current_index_, and files_.
|
overridevirtual |
Returns a boolean indicating whether the reader is at the end of the last file that was read.
Implements foreign_storage::FileReader.
Definition at line 603 of file FileReader.cpp.
References is_end_of_last_file_, and isScanFinished().
|
overridevirtual |
Implements foreign_storage::FileReader.
Definition at line 587 of file FileReader.cpp.
References current_index_, and files_.
|
inlineoverridevirtual |
Implements foreign_storage::FileReader.
Definition at line 362 of file FileReader.h.
References current_index_, and files_.
Referenced by foreign_storage::LocalMultiFileReader::checkForMoreRows(), getCurrentFilePath(), isEndOfLastFile(), read(), and readRegion().
|
overridevirtual |
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 |
Implements foreign_storage::FileReader.
Definition at line 734 of file FileReader.cpp.
References foreign_storage::anonymous_namespace{FileReader.cpp}::adjust_eof(), foreign_storage::FileReader::copy_params_, cumulative_sizes_, current_index_, current_offset_, files_, is_end_of_last_file_, isScanFinished(), and import_export::CopyParams::line_delim.
|
overridevirtual |
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 |
Implements foreign_storage::FileReader.
Definition at line 754 of file FileReader.cpp.
References CHECK, foreign_storage::FileReader::copy_params_, cumulative_sizes_, files_, isScanFinished(), import_export::CopyParams::line_delim, foreign_storage::anonymous_namespace{FileReader.cpp}::offset_to_index(), and starting_offset_.
|
overridevirtual |
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 |
Implements foreign_storage::FileReader.
Definition at line 560 of file FileReader.cpp.
References json_utils::add_value_to_object(), cumulative_sizes_, current_index_, current_offset_, file_locations_, files_, and starting_offset_.
|
protected |
Definition at line 384 of file FileReader.h.
Referenced by foreign_storage::LocalMultiFileReader::checkForMoreRows(), checkForRolledOffFiles(), MultiFileReader(), read(), readRegion(), and serialize().
|
protected |
Definition at line 386 of file FileReader.h.
Referenced by foreign_storage::LocalMultiFileReader::checkForMoreRows(), checkForRolledOffFiles(), getCurrentFilePath(), getRemainingSize(), isRemainingSizeKnown(), isScanFinished(), MultiFileReader(), read(), and serialize().
|
protected |
Definition at line 388 of file FileReader.h.
Referenced by foreign_storage::LocalMultiFileReader::checkForMoreRows(), MultiFileReader(), read(), and serialize().
|
protected |
Definition at line 381 of file FileReader.h.
Referenced by foreign_storage::LocalMultiFileReader::checkForMoreRows(), checkForRolledOffFiles(), foreign_storage::LocalMultiFileReader::insertFile(), foreign_storage::LocalMultiFileReader::LocalMultiFileReader(), MultiFileReader(), and serialize().
|
protected |
Definition at line 380 of file FileReader.h.
Referenced by foreign_storage::LocalMultiFileReader::checkForMoreRows(), checkForRolledOffFiles(), getCurrentFilePath(), getFirstLineForEachFile(), getRemainingSize(), foreign_storage::LocalMultiFileReader::insertFile(), isRemainingSizeKnown(), isScanFinished(), foreign_storage::LocalMultiFileReader::LocalMultiFileReader(), read(), readRegion(), and serialize().
|
protected |
Definition at line 392 of file FileReader.h.
Referenced by foreign_storage::LocalMultiFileReader::checkForMoreRows(), isEndOfLastFile(), and read().
|
protected |
Definition at line 390 of file FileReader.h.
Referenced by foreign_storage::LocalMultiFileReader::checkForMoreRows(), checkForRolledOffFiles(), MultiFileReader(), readRegion(), and serialize().