Akumuli
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
Akumuli::QueryResultsPooler Struct Reference
Inheritance diagram for Akumuli::QueryResultsPooler:
Akumuli::ReadOperation

Public Member Functions

 QueryResultsPooler (std::shared_ptr< DbConnection > con, int readbufsize)
 
void throw_if_started () const
 
void throw_if_not_started () const
 
virtual void start ()
 
virtual void append (const char *data, size_t data_size)
 
virtual aku_Status get_error ()
 
virtual std::tuple< size_t, bool > read_some (char *buf, size_t buf_size)
 
virtual void close ()
 

Public Attributes

std::string query_text_
 
std::shared_ptr< DbConnectionconnection_
 
std::shared_ptr< DbCursorcursor_
 
std::unique_ptr< OutputFormatterformatter_
 
std::vector< char > rdbuf_
 
int rdbuf_pos_
 Read buffer.
 
int rdbuf_top_
 Read position in buffer.
 

Static Public Attributes

static const size_t DEFAULT_RDBUF_SIZE_ = 1000u
 Last initialized item index in rdbuf_
 
static const size_t DEFAULT_ITEM_SIZE_ = sizeof(aku_Sample)
 

Member Function Documentation

void Akumuli::QueryResultsPooler::append ( const char *  data,
size_t  data_size 
)
virtual

Append query data to cursor

Implements Akumuli::ReadOperation.

void Akumuli::QueryResultsPooler::close ( )
virtual

Close cursor. Should be called after read operation was completed or interrupted.

Implements Akumuli::ReadOperation.

aku_Status Akumuli::QueryResultsPooler::get_error ( )
virtual

Return error code or AKU_SUCCESS. This error code represent result of the query parsing and initial processing. It can indicate error in the query. Result of the call to this function shouldn't change while reading data. If error occurs during reading read_some method should throw an error.

Implements Akumuli::ReadOperation.

std::tuple< size_t, bool > Akumuli::QueryResultsPooler::read_some ( char *  buf,
size_t  buf_size 
)
virtual

Read some data from cursor. This method should be called only if get_error have returned AKU_SUCCESS. If some error occured during read operation this method should throw. Method returns tuple (num_elements, is_done). If there is no more results, method returns (any, true) otherwise it returns (any, false). Number of elements can be 0, in this case if second tuple element is false client should call this method again.

Implements Akumuli::ReadOperation.

void Akumuli::QueryResultsPooler::start ( )
virtual

Start query execution

Implements Akumuli::ReadOperation.


The documentation for this struct was generated from the following files: