Turi Create  4.0
turi::sarray_group_format_writer< T > Class Template Referenceabstract

#include <core/storage/sframe_data/sarray_file_format_interface.hpp>

Public Member Functions

virtual void open (std::string index_file, size_t segments_to_create, size_t columns_to_create)=0
 
virtual void set_options (const std::string &option, int64_t value)=0
 
virtual group_index_file_informationget_index_info ()=0
 
virtual void close ()=0
 
virtual void write_index_file ()=0
 
virtual void write_segment (size_t segmentid, const std::vector< T > &)=0
 
virtual void write_segment (size_t segmentid, std::vector< T > &&)=0
 
virtual void write_segment (size_t columnid, size_t segmentid, const T &)=0
 
virtual void write_segment (size_t columnid, size_t segmentid, T &&)=0
 
virtual void write_segment (size_t segmentid, const sframe_rows &rows)=0
 
virtual void write_column (size_t columnid, size_t segmentid, const std::vector< T > &t)=0
 
virtual void write_column (size_t columnid, size_t segmentid, std::vector< T > &&t)=0
 
virtual void flush_segment (size_t segmentid)
 
virtual size_t num_segments () const =0
 
virtual size_t num_columns () const =0
 

Detailed Description

template<typename T>
class turi::sarray_group_format_writer< T >

A generic sarray group file format writer interface. File format implementations should extend this.

The sarray_group is a collection of sarrays in a single file set.

The writer is assumed to always to writing to new file sets; we are never modifying an existing file set.

Definition at line 162 of file sarray_file_format_interface.hpp.

Member Function Documentation

◆ close()

template<typename T>
virtual void turi::sarray_group_format_writer< T >::close ( )
pure virtual

Closes all segments.

Implemented in turi::sarray_group_format_writer_v2< T >.

◆ flush_segment()

template<typename T>
virtual void turi::sarray_group_format_writer< T >::flush_segment ( size_t  segmentid)
inlinevirtual

Flush all writes for a particular segment

Reimplemented in turi::sarray_group_format_writer_v2< T >.

Definition at line 247 of file sarray_file_format_interface.hpp.

◆ get_index_info()

template<typename T>
virtual group_index_file_information& turi::sarray_group_format_writer< T >::get_index_info ( )
pure virtual

Gets a modifiable reference to the index file information which will be written to the index file. Can only be called after close()

Implemented in turi::sarray_group_format_writer_v2< T >.

◆ num_columns()

template<typename T>
virtual size_t turi::sarray_group_format_writer< T >::num_columns ( ) const
pure virtual

Return the number of columns in the sarray. Throws an exception if the array is not open.

Implemented in turi::sarray_group_format_writer_v2< T >.

◆ num_segments()

template<typename T>
virtual size_t turi::sarray_group_format_writer< T >::num_segments ( ) const
pure virtual

Return the number of segments in the sarray. Throws an exception if the array is not open.

Implemented in turi::sarray_group_format_writer_v2< T >.

◆ open()

template<typename T>
virtual void turi::sarray_group_format_writer< T >::open ( std::string  index_file,
size_t  segments_to_create,
size_t  columns_to_create 
)
pure virtual

Open has to be called before any of the other functions are called. No files are actually opened at this point.

Implemented in turi::sarray_group_format_writer_v2< T >.

◆ set_options()

template<typename T>
virtual void turi::sarray_group_format_writer< T >::set_options ( const std::string &  option,
int64_t  value 
)
pure virtual

Set write options. Available options are "disable_padding" = true or false

Implemented in turi::sarray_group_format_writer_v2< T >.

◆ write_column() [1/2]

template<typename T>
virtual void turi::sarray_group_format_writer< T >::write_column ( size_t  columnid,
size_t  segmentid,
const std::vector< T > &  t 
)
pure virtual

Writes a collection of rows to a column

Implemented in turi::sarray_group_format_writer_v2< T >.

◆ write_column() [2/2]

template<typename T>
virtual void turi::sarray_group_format_writer< T >::write_column ( size_t  columnid,
size_t  segmentid,
std::vector< T > &&  t 
)
pure virtual

Writes a collection of rows to a column

Implemented in turi::sarray_group_format_writer_v2< T >.

◆ write_index_file()

template<typename T>
virtual void turi::sarray_group_format_writer< T >::write_index_file ( )
pure virtual

◆ write_segment() [1/5]

template<typename T>
virtual void turi::sarray_group_format_writer< T >::write_segment ( size_t  segmentid,
const std::vector< T > &   
)
pure virtual

Writes a row to the array group

Implemented in turi::sarray_group_format_writer_v2< T >.

◆ write_segment() [2/5]

template<typename T>
virtual void turi::sarray_group_format_writer< T >::write_segment ( size_t  segmentid,
std::vector< T > &&   
)
pure virtual

Writes a row to the array group

Implemented in turi::sarray_group_format_writer_v2< T >.

◆ write_segment() [3/5]

template<typename T>
virtual void turi::sarray_group_format_writer< T >::write_segment ( size_t  columnid,
size_t  segmentid,
const T &   
)
pure virtual

Writes a row to the array group

Implemented in turi::sarray_group_format_writer_v2< T >.

◆ write_segment() [4/5]

template<typename T>
virtual void turi::sarray_group_format_writer< T >::write_segment ( size_t  columnid,
size_t  segmentid,
T &&   
)
pure virtual

Writes a row to the array group

Implemented in turi::sarray_group_format_writer_v2< T >.

◆ write_segment() [5/5]

template<typename T>
virtual void turi::sarray_group_format_writer< T >::write_segment ( size_t  segmentid,
const sframe_rows rows 
)
pure virtual

Writes a bunch of rows to the array group

Implemented in turi::sarray_group_format_writer_v2< T >, and turi::sarray_group_format_writer_v2< T >.


The documentation for this class was generated from the following file: