6 #ifndef TURI_UNITY_SARRAY_FILE_FORMAT_INTERFACE_HPP 7 #define TURI_UNITY_SARRAY_FILE_FORMAT_INTERFACE_HPP 9 #define BOOST_SPIRIT_THREADSAFE 15 #include <core/storage/fileio/general_fstream.hpp> 16 #include <boost/property_tree/ptree.hpp> 17 #include <boost/property_tree/ini_parser.hpp> 18 #include <core/storage/sframe_data/sarray_index_file.hpp> 19 #include <core/data/flexible_type/flexible_type.hpp> 20 #include <core/storage/sframe_data/sframe_rows.hpp> 67 virtual void open(std::string sidx_file) = 0;
72 virtual void close() = 0;
84 virtual size_t segment_size(
size_t segmentsid)
const = 0;
98 virtual size_t read_rows(
size_t row_start,
100 std::vector<T>& out_obj) = 0;
113 template <
typename T>
116 virtual ~sarray_format_reader() {}
120 class sarray_format_reader<flexible_type>
123 virtual ~sarray_format_reader() {}
139 virtual size_t read_rows(
size_t row_start,
161 template <
typename T>
170 virtual void open(std::string index_file,
171 size_t segments_to_create,
172 size_t columns_to_create) = 0;
179 virtual void set_options(
const std::string& option, int64_t value) = 0;
190 virtual void close() = 0;
195 virtual void write_index_file() = 0;
201 virtual void write_segment(
size_t segmentid,
202 const std::vector<T>&) = 0;
207 virtual void write_segment(
size_t segmentid,
208 std::vector<T>&&) = 0;
213 virtual void write_segment(
size_t columnid,
220 virtual void write_segment(
size_t columnid,
227 virtual void write_segment(
size_t segmentid,
233 virtual void write_column(
size_t columnid,
235 const std::vector<T>& t) = 0;
240 virtual void write_column(
size_t columnid,
242 std::vector<T>&& t) = 0;
260 virtual size_t num_columns()
const = 0;
std::vector< ptr_to_decoded_column_type > & get_columns()
void resize(size_t num_cols, ssize_t num_rows=-1)