ClockWork DB CoreAPI 1.0.48
Abstract Time Series and Storage/Management Library
Loading...
Searching...
No Matches
tom::tsdb::datastore Class Referenceabstract

#include <tom-tsdb/datastore.hpp>

+ Inheritance diagram for tom::tsdb::datastore:
+ Collaboration diagram for tom::tsdb::datastore:

Public Member Functions

 datastore (const access_mode &mode)
 
virtual void close ()=0
 
tom::tsdb::sparse_series_sptr create_sparse_series (const char *name, native_data_type data_t, native_calendar_type calendar_t, aggregation_type)
 
virtual tom::tsdb::sparse_series_sptr create_sparse_series (const tom::observation &name, native_data_type data_t, native_calendar_type calendar_t, aggregation_type)
 
tom::tsdb::time_series_sptr create_time_series (const char *name, native_data_type data_t, native_calendar_type calendar_t, aggregation_type)
 
virtual tom::tsdb::time_series_sptr create_time_series (const tom::observation &name, native_data_type data_t, native_calendar_type calendar_t, aggregation_type)
 
bool delete_time_series (const char *name)
 
virtual bool delete_time_series (const tom::observation &name)=0
 
virtual tom::tsdb::connectionget_connection ()=0
 
virtual const tom::calendars::date_time & get_create_date_time () const =0
 
const datastore_metricsget_datastore_metrics ()
 
virtual const tom::stringget_description () const =0
 
virtual const tom::stringget_documentation () const =0
 
const access_modeget_mode () const
 
virtual const tom::calendars::date_time & get_modify_date_time () const =0
 
virtual const tom::stringget_name () const =0
 
tom::tsdb::time_series_sptr get_time_series (const char *name, bool lazy_eval=false)
 
virtual tom::tsdb::time_series_sptr get_time_series (const tom::observation &name, bool lazy_eval=false)=0
 
bool has_time_series (const char *name)
 
virtual bool has_time_series (const tom::observation &name)=0
 
virtual bool is_open () const =0
 
tom::tsdb::datastore_match_sptr regex_name_search (const char *regex)
 
virtual tom::tsdb::datastore_match_sptr regex_name_search (const tom::observation &regex)=0
 
virtual void save_time_series (const tom::tsdb::time_series &ts, bool overwrite=false)=0
 
virtual void set_description (const tom::observation &)=0
 
virtual void set_documentation (const tom::observation &)=0
 
- Public Member Functions inherited from tom::tsdb::logger
 logger (const char *domain)
 
tom::loggerget_logger ()
 
tom::loggerget_logger (const char *domain)
 

Static Public Member Functions

static tom::calendars::calendarget_calendar (unsigned int cal_t)
 
static unsigned int get_calendar_id (tom::calendars::calendar &cal)
 

Protected Member Functions

virtual tom::tsdb::sparse_series_sptr create_sparse_series (const tom::observation &name, native_data_type data_t, native_calendar_type calendar_t, aggregation_type, const tom::calendars::date_time &, const tom::calendars::date_time &)
 
virtual tom::tsdb::sparse_series_sptr create_sparse_series (const tom::observation &name, native_data_type data_t, native_calendar_type calendar_t, aggregation_type, const tom::calendars::date_time &, const tom::calendars::date_time &, bool ignore_same_value, bool ignore_missing_value, void *iter_begin, void *iter_end)
 
virtual tom::tsdb::time_series_sptr create_time_series (const tom::observation &name, native_data_type data_t, native_calendar_type calendar_t, aggregation_type, const tom::calendars::date_time &, const tom::calendars::date_time &)
 
virtual tom::tsdb::time_series_sptr create_time_series (const tom::observation &name, native_data_type data_t, native_calendar_type calendar_t, aggregation_type, const tom::calendars::date_time &, const tom::calendars::date_time &, tom::calendars::date_int_type first_date, tom::calendars::date_int_type last_date, tom::tsdb::time_series::populate_data_func)
 
virtual tom::tsdb::time_series_sptr create_time_series (const tom::observation &name, native_data_type data_t, native_calendar_type calendar_t, aggregation_type, const tom::calendars::date_time &, const tom::calendars::date_time &, tom::calendars::date_int_type start, void *iter_begin, void *iter_end)
 
virtual const tom::Stringget_attribute (const tom::string &obj_name, const tom::String &att_name)=0
 
virtual bool populate_alias_set (const tom::String &name, alias_set &aliases)=0
 
virtual void populate_datastore_metrics (datastore_metrics &metrics)=0
 
virtual void set_attribute (const tom::string &obj_name, const tom::String &att_name, const tom::String &att_value)=0
 

Static Protected Member Functions

static tom::tsdb::sparse_series_sptr build_sparse_series (datastore &ds, const tom::observation &name, native_data_type data_t, native_calendar_type calendar_t, aggregation_type)
 
static tom::tsdb::sparse_series_sptr build_sparse_series (datastore &ds, const tom::observation &name, native_data_type data_t, native_calendar_type calendar_t, aggregation_type, const tom::calendars::date_time &, const tom::calendars::date_time &)
 
static tom::tsdb::sparse_series_sptr build_sparse_series (datastore &ds, const tom::observation &name, native_data_type data_t, native_calendar_type calendar_t, aggregation_type, const tom::calendars::date_time &, const tom::calendars::date_time &, bool ignore_same_value, bool ignore_missing_value, void *iter_begin, void *iter_end)
 
static tom::tsdb::time_series_sptr build_time_series (datastore &ds, const tom::observation &name, native_data_type data_t, native_calendar_type calendar_t, aggregation_type)
 
static tom::tsdb::time_series_sptr build_time_series (datastore &ds, const tom::observation &name, native_data_type data_t, native_calendar_type calendar_t, aggregation_type, const tom::calendars::date_time &, const tom::calendars::date_time &)
 
static tom::tsdb::time_series_sptr build_time_series (datastore &ds, const tom::observation &name, native_data_type data_t, native_calendar_type calendar_t, aggregation_type, const tom::calendars::date_time &, const tom::calendars::date_time &, tom::calendars::date_int_type start, tom::calendars::date_int_type end, tom::tsdb::time_series::populate_data_func)
 
static tom::tsdb::time_series_sptr build_time_series (datastore &ds, const tom::observation &name, native_data_type data_t, native_calendar_type calendar_t, aggregation_type, const tom::calendars::date_time &, const tom::calendars::date_time &, tom::calendars::date_int_type start, void *iter_begin, void *iter_end)
 

Protected Attributes

datastore_metrics m_ds_metrics
 
access_mode m_mode
 

Friends

class time_series
 

Detailed Description

Datastore objects are the meat and potatoes of time-series creation, retrieval, updating, and deletion. All time-series start there life out deep in the bowels of some datastore. Whether creating one for the first time, or retrieving previously created ones, it is easiest to use the datastore object.

Member Function Documentation

◆ close()

virtual void tom::tsdb::datastore::close ( )
pure virtual

All datastore objects MUST be closed at the end of a session. It is the only resource that has any requirement at all. All other objects fall under the perview of the garbage collection framework, and have no such clean-up requirements

◆ create_sparse_series() [1/2]

tom::tsdb::sparse_series_sptr tom::tsdb::datastore::create_sparse_series ( const char *  name,
native_data_type  data_t,
native_calendar_type  calendar_t,
aggregation_type  agg_t 
)

create a sparse_series object with the name='name', the native_data_type, native_calendar_type, and aggregation_type. Users can directly invoke constructors for the underlying template classes but this can be considerably more ugly in code, so these helpers are provided. The resulting sparse_series objects have the current datastore object as its parent but do not actually get creating in the datastore until the save method of the sparse_series or the datastore is called on it.

◆ create_sparse_series() [2/2]

tom::tsdb::sparse_series_sptr tom::tsdb::datastore::create_sparse_series ( const tom::observation name,
native_data_type  data_t,
native_calendar_type  calendar_t,
aggregation_type  agg_t 
)
virtual

create a sparse_series object with the name='name', the native_data_type, native_calendar_type, and aggregation_type. Users can directly invoke constructors for the underlying template classes but this can be considerably more ugly in code, so these helpers are provided. The resulting sparse_series objects have the current datastore object as its parent but do not actually get creating in the datastore until the save method of the sparse_series or the datastore is called on it.

◆ create_time_series() [1/2]

tom::tsdb::time_series_sptr tom::tsdb::datastore::create_time_series ( const char *  name,
native_data_type  data_t,
native_calendar_type  calendar_t,
aggregation_type  agg_t 
)

create a time_series object with the name='name', the native_data_type, native_calendar_type, and aggregation_type. Users can directly invoke constructors for the underlying template classes but this can be considerably more ugly in code, so these helpers are provided. The resulting time_series objects have the current datastore object as its parent but do not actually get created in the datastore until the save method of the time_series or the datastore is called on it.

◆ create_time_series() [2/2]

tom::tsdb::time_series_sptr tom::tsdb::datastore::create_time_series ( const tom::observation name,
native_data_type  data_t,
native_calendar_type  calendar_t,
aggregation_type  agg_t 
)
virtual

create a time_series object with the name='name', the native_data_type, native_calendar_type, and aggregation_type. Users can directly invoke constructors for the underlying template classes but this can be considerably more ugly in code, so these helpers are provided. The resulting time_series objects have the current datastore object as its parent but do not actually get creating in the datastore until the save method of the time_series or the datastore is called on it.

◆ delete_time_series() [1/2]

bool tom::tsdb::datastore::delete_time_series ( const char *  name)

delete the time_series with name='name'. This method may also throw derivatives of std::runtime_error if internal failures occur, and should be hence wrapped in a try block.

◆ delete_time_series() [2/2]

virtual bool tom::tsdb::datastore::delete_time_series ( const tom::observation name)
pure virtual

delete the time_series with name='name'. This method may also throw derivatives of std::runtime_error if internal failures occur, and should be hence wrapped in a try block.

◆ get_connection()

virtual tom::tsdb::connection & tom::tsdb::datastore::get_connection ( )
pure virtual

get the parent connection that created this datastore object

◆ get_create_date_time()

virtual const tom::calendars::date_time & tom::tsdb::datastore::get_create_date_time ( ) const
pure virtual

get the create date_time stamp of the datastore object

◆ get_description()

virtual const tom::string & tom::tsdb::datastore::get_description ( ) const
pure virtual

get the description of the datastore object

◆ get_documentation()

virtual const tom::string & tom::tsdb::datastore::get_documentation ( ) const
pure virtual

get the documentation of the datastore object

◆ get_mode()

const access_mode & tom::tsdb::datastore::get_mode ( ) const
inline

get the access_mode used to open this datastore

◆ get_modify_date_time()

virtual const tom::calendars::date_time & tom::tsdb::datastore::get_modify_date_time ( ) const
pure virtual

get the modify date_time stamp of the datastore object

◆ get_name()

virtual const tom::string & tom::tsdb::datastore::get_name ( ) const
pure virtual

get the name of the datastore object

◆ get_time_series() [1/2]

tom::tsdb::time_series_sptr tom::tsdb::datastore::get_time_series ( const char *  name,
bool  lazy_eval = false 
)

get a time_series object with name = 'name' set lazy_eval to true will inform the back-end that no data need be read other than the time-series meta-data. This is useful for performance reasons when updating time-series during loads, etc. and the default is the normal course of use and may be left out. This method will throw a dervivative of std::runtime_error if the object does not exist and should be caught.

◆ get_time_series() [2/2]

virtual tom::tsdb::time_series_sptr tom::tsdb::datastore::get_time_series ( const tom::observation name,
bool  lazy_eval = false 
)
pure virtual

get a time_series object with name = 'name' set lazy_eval to true will inform the back-end that no data need be read other than the time-series meta-data. This is useful for performance reasons when updating time-series during loads, etc. and the default is the normal course of use and may be left out. This method will throw a dervivative of std::runtime_error if the object does not exist and should be caught.

◆ has_time_series() [1/2]

bool tom::tsdb::datastore::has_time_series ( const char *  name)
inline

Check if the time_series with the name='name' exists in the datastore. This is useful for example if bulk data operations are underway that may result in large number of time_series being created. This method avoids the overhead of the exception framework and has been found to save considerable time in loads and other large scale time_series creation.

◆ has_time_series() [2/2]

virtual bool tom::tsdb::datastore::has_time_series ( const tom::observation name)
pure virtual

Check if the time_series with the name='name' exists in the datastore. This is useful for example if bulk data operations are underway that may result in large number of time_series being created. This method avoids the overhead of the exception framework and has been found to save considerable time in loads and other large scale time_series creation.

◆ is_open()

virtual bool tom::tsdb::datastore::is_open ( ) const
pure virtual

check if the datastore has already been closed

◆ regex_name_search() [1/2]

std::shared_ptr< tom::tsdb::datastore_match > tom::tsdb::datastore::regex_name_search ( const char *  regex)

datastore objects provide full extended posix regex search capabilities on the datastore. This allows for rich querying of the datastore based on time_series names which typically follow semantics to create naturally grouped objects, e.g., regex_name_search( "IBM\..*" ); would return all objects starting with 'IBM.', e.g., IBM.CLOSE, IBM.OPEN, IBM.LOW, etc... This method returns a datastore_match object which can be used to walk the result set retrieving name, and other meta-data.

◆ regex_name_search() [2/2]

virtual tom::tsdb::datastore_match_sptr tom::tsdb::datastore::regex_name_search ( const tom::observation regex)
pure virtual

datastore objects provide full extended posix regex search capabilities on the datastore. This allows for rich querying of the datastore based on time_series names which typically follow semantics to create naturally grouped objects, e.g., regex_name_search( "IBM\..*" ); would return all objects starting with 'IBM.', e.g., IBM.CLOSE, IBM.OPEN, IBM.LOW, etc... This method returns a datastore_match object which can be used to walk the result set retrieving name, and other meta-data.

◆ save_time_series()

virtual void tom::tsdb::datastore::save_time_series ( const tom::tsdb::time_series ts,
bool  overwrite = false 
)
pure virtual

save a time_series object. If saving changes to a time_series, users may use the time_series::save( bool overwrite = false ) method. This method is mainly useful for moving time_series objects from one datastore to another. This is fully supported between datastores with any and all persistence back-ends, so moving time_series from FAME to ORACLE to BDB, etc., is all perfectly legal and simple. If the object already exists in the datastore overwrite must be set to true, or an exception derivative of std::runtime_error will be thrown and must be caught.

◆ set_description()

virtual void tom::tsdb::datastore::set_description ( const tom::observation )
pure virtual

set the description of the datastore object

◆ set_documentation()

virtual void tom::tsdb::datastore::set_documentation ( const tom::observation )
pure virtual

set the documentation of the datastore object


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