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

#include <storage.h>

Public Types

typedef std::mutex LockType
typedef std::shared_ptr< VolumePVolume
typedef std::shared_ptr
< MetadataStorage
typedef std::shared_ptr
< SeriesMatcher
typedef std::shared_ptr
< ChunkCache

Public Member Functions

 Storage (const char *path, aku_FineTuneParams const &conf)
void set_thread_local_matcher (SeriesMatcher *spool) const
void select_active_page ()
 Select page that was active last time.
void prepopulate_cache (int64_t max_cache_size)
 Prepopulate cache.
void log_message (const char *message) const
void log_error (const char *message) const
void log_message (const char *message, uint64_t value) const
void close ()
 Close db (this call should be performed by writer thread)
void advance_volume_ (int ix)
aku_Status write_double (aku_ParamId param, aku_Timestamp ts, double value)
 Write double. More...
aku_Status _write_impl (TimeSeriesValue value, aku_MemRange data)
aku_Status series_to_param_id (const char *begin, const char *end, uint64_t *value)
int param_id_to_series (aku_ParamId id, char *buffer, size_t buffer_size) const
void search (Caller &caller, InternalCursor *cur, const char *query) const
 Search storage using cursor.
void get_stats (aku_StorageStats *rcv_stats)
aku_Status get_open_error () const
void debug_print () const

Static Public Member Functions

static apr_status_t new_storage (const char *file_name, const char *metadata_path, const char *volumes_path, int num_pages, aku_logger_cb_t logger, uint64_t page_size=0)
static apr_status_t remove_storage (const char *file_name, aku_logger_cb_t logger)

Public Attributes

aku_FineTuneParams config_
PVolume active_volume_
std::atomic< int > active_volume_index_
aku_Duration ttl_
aku_Status open_error_code_
std::vector< PVolume > volumes_
PMetadataStorage metadata_
PSeriesMatcher matcher_
LockType mutex_
apr_time_t creation_time_
aku_logger_cb_t logger_
Rand rand_
PCache cache_
< SeriesMatcher
 Local (per query) string pool.

Detailed Description

Interface to page manager

Constructor & Destructor Documentation

Akumuli::Storage::Storage ( const char *  path,
aku_FineTuneParams const &  conf 

Storage c-tor.

file_namepath to metadata file

Member Function Documentation

void Akumuli::Storage::advance_volume_ ( int  ix)

Switch volume in round robin manner

ixcurrent volume index
apr_status_t Akumuli::Storage::new_storage ( const char *  file_name,
const char *  metadata_path,
const char *  volumes_path,
int  num_pages,
aku_logger_cb_t  logger,
uint64_t  page_size = 0 

Create new storage and initialize it.

storage_namestorage name
metadata_pathpath to metadata dir
volumes_pathpath to volumes dir
page_sizesize of each page (default value is 0 means 4GB)
int Akumuli::Storage::param_id_to_series ( aku_ParamId  id,
char *  buffer,
size_t  buffer_size 
) const

Convert parameter id to series name.

apr_status_t Akumuli::Storage::remove_storage ( const char *  file_name,
aku_logger_cb_t  logger 

Remove all volumes

aku_Status Akumuli::Storage::series_to_param_id ( const char *  begin,
const char *  end,
uint64_t *  value 

Convert series name to parameter id

beginshould point to series name
endshould point to series name end
valueis a pointer to output parameter
status code
void Akumuli::Storage::set_thread_local_matcher ( SeriesMatcher spool) const

Override local series matcher. This method is const because it doesn't affect any storage data except thread local variable.

aku_Status Akumuli::Storage::write_double ( aku_ParamId  param,
aku_Timestamp  ts,
double  value 

Write double.

write binary data

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