Turi Create
4.0
|
#include <core/storage/sframe_data/sarray_file_format_interface.hpp>
Public Member Functions | |
virtual void | open (index_file_information index)=0 |
virtual void | open (std::string sidx_file)=0 |
virtual void | close ()=0 |
virtual size_t | num_segments () const =0 |
virtual size_t | segment_size (size_t segmentsid) const =0 |
virtual size_t | read_rows (size_t row_start, size_t row_end, std::vector< T > &out_obj)=0 |
virtual std::string | get_index_file () const =0 |
virtual const index_file_information & | get_index_info () const =0 |
A generic sarray file format reader interface. File format implementations should extend this.
The sarray file layout should generally be a file set (collection of files) with a common prefix. File format implementations can create or use as many prefixes as required. There must be an [prefix].sidx in the the Microsoft INI format with the following sections
* [sarray] * ; The version of the file format. Required. * version=0 *
Definition at line 46 of file sarray_file_format_interface.hpp.
|
pure virtual |
Closes an sarray file set. No-op if the array is already closed.
Implemented in turi::sarray_format_reader_v2< T >.
|
pure virtual |
Returns the file index of the array (the argument in open)
Implemented in turi::sarray_format_reader_v2< T >.
|
pure virtual |
Gets the contents of the index file information read from the index file
Implemented in turi::sarray_format_reader_v2< T >.
|
pure virtual |
Return the number of segments in the sarray. Throws an exception if the array is not open.
Implemented in turi::sarray_format_reader_v2< T >.
|
pure virtual |
Open has to be called before any of the other functions are called. Throws a string exception if it is unable to open the file set, or if there is a format error in the sarray.
Will throw an exception if a file set is already open.
Implemented in turi::sarray_format_reader_v2< T >.
|
pure virtual |
Open has to be called before any of the other functions are called. Throws a string exception if it is unable to open the file set, or if there is a format error in the sarray.
Will throw an exception if a file set is already open.
Implemented in turi::sarray_format_reader_v2< T >.
|
pure virtual |
Reads a collection of rows, storing the result in out_obj. This function is independent of the open_segment/read_segment/close_segment functions, and can be called anytime. This function is also fully concurrent.
row_start | First row to read |
row_end | one past the last row to read (i.e. EXCLUSIVE). row_end can be beyond the end of the array, in which case, fewer rows will be read. |
out_obj | The output array |
Implemented in turi::sarray_format_reader_v2< T >.
|
pure virtual |
Returns the number of elements in a given segment. should throw an exception if the segment ID does not exist,
Implemented in turi::sarray_format_reader_v2< T >.