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

#include <seriesparser.h>

Public Types

typedef StringTools::StringT StringT
 Pooled string.
 
typedef std::tuple< const char
*, int, uint64_t > 
SeriesNameT
 Series name descriptor - pointer to string, length, series id.
 
typedef StringTools::TableT TableT
 
typedef StringTools::InvT InvT
 

Public Member Functions

 SeriesMatcher (uint64_t starting_id)
 Mutex for shared data.
 
uint64_t add (const char *begin, const char *end)
 
void _add (std::string series, uint64_t id)
 
uint64_t match (const char *begin, const char *end)
 
StringT id2str (uint64_t tokenid) const
 Convert id to string.
 
void pull_new_names (std::vector< SeriesNameT > *buffer)
 
std::vector< uint64_t > get_all_ids () const
 

Public Attributes

StringPool pool
 
TableT table
 String pool that stores time-series.
 
InvT inv_table
 Series table (name to id mapping)
 
uint64_t series_id
 Ids table (id to name mapping)
 
std::vector< SeriesNameTnames
 Series ID counter.
 
std::mutex mutex
 List of recently added names.
 

Detailed Description

Series matcher. Table that maps series names to series ids. Should be initialized on startup from sqlite table.

Member Function Documentation

void Akumuli::SeriesMatcher::_add ( std::string  series,
uint64_t  id 
)

Add value from DB to matcher. This function should be used only to load data from database to matcher. Internal series_id counter shouldn't be affected by this call.

uint64_t Akumuli::SeriesMatcher::add ( const char *  begin,
const char *  end 
)

Add new string to matcher.

uint64_t Akumuli::SeriesMatcher::match ( const char *  begin,
const char *  end 
)

Match string and return it's id. If string is new return 0.

void Akumuli::SeriesMatcher::pull_new_names ( std::vector< SeriesNameT > *  buffer)

Push all new elements to the buffer.

Parameters
bufferis an output parameter that will receive new elements

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