Turi Create  4.0
turi::hash_bucket< T > Class Template Reference

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

Public Member Functions

 hash_bucket (size_t buffer_size, std::shared_ptr< sink_type > sink, size_t segmentid, comparator_type comparator, bool deduplicate=false)
 construct with given sarray and the segmentid as sink.
 
void add (const value_type &val)
 Add a new element to the container.
 
void flush ()
 Flush the last buffer.
 
template<typename OutIterator >
void sort_and_write (OutIterator out)
 

Detailed Description

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

Storing elements that gets hashed to the bucket in sorted order.

The container has an in memory buffer, and is backed by an sarray segment. When the buffer is full, it is sorted and written into the sarray segment as a sorted chunk.

The sort_and_write function then merges the sorted chunks and output to the destination array.

Definition at line 33 of file groupby.hpp.

Member Function Documentation

◆ sort_and_write()

template<typename T>
template<typename OutIterator >
void turi::hash_bucket< T >::sort_and_write ( OutIterator  out)

Sort all elements in the container and writes to the output. If deduplicate is true, only output unique elements.


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