All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
Akumuli::PipelineSpout Struct Reference

#include <ingestion_pipeline.h>

Inheritance diagram for Akumuli::PipelineSpout:


struct  Padding
struct  TVal

Public Types

enum  { POOL_SIZE = 0x200, QCAP = 0x10 }
typedef std::atomic< uint64_t > SpoutCounter
typedef std::shared_ptr< TValPVal
typedef queue< TVal * > Queue
typedef std::shared_ptr< Queue > PQueue
typedef std::shared_ptr
< DbConnection

Public Member Functions

 PipelineSpout (std::shared_ptr< Queue > q, BackoffPolicy bp, std::shared_ptr< DbConnection > con)
void set_error_cb (PipelineErrorCb cb)
virtual void write (const aku_Sample &sample)
virtual void add_bulk_string (const Byte *buffer, size_t n)
int get_index_of_empty_slot ()
 Reserve index for the next TVal in the pool or negative value on error.
void get_error (std::ostream &ostr)
aku_Status series_to_param_id (const char *str, size_t strlen, aku_Sample *sample)
 Convert series name to param id.
bool is_empty () const

Public Attributes

SpoutCounter created_
Padding pad0
SpoutCounter deleted_
std::vector< PVal > pool_
Padding pad1
PQueue queue_
const BackoffPolicy backoff_
Logger logger_
PipelineErrorCb on_error_
PDatabase db_

Detailed Description

Pipeline's spout. Object of this class can be used to ingest data to pipeline. It should be connected with IngestionPipeline instance with the shared queue. Pooling is used to simplify allocator's life. All TVals should be deleted in the same thread where they was created. This shuld minimize contention inside allocator and limit overall memory usage (no need to create pool of objects beforehand).

Member Enumeration Documentation

anonymous enum

PVal pool size.

Member Function Documentation

void Akumuli::PipelineSpout::get_error ( std::ostream &  ostr)

Dump all errors to ostr or report that everything is OK

ostrstream to write
bool Akumuli::PipelineSpout::is_empty ( ) const

Returns true if all TVal's is processed

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