CARMA C++
carma::dbms Namespace Reference

API for access to the CARMA database. More...

Classes

class  BlankingFlagSetFilter
 class to represent an SQL query filter for a set of blanking flags viz blankingFlag IN (UNDETERMINED, OK) More...
 
class  CallerFilter
 template to represent a one component caller filter. More...
 
class  Column
 template to mimic a db column. More...
 
class  DBConfigurator
 Class used for configuring a DBConnection. More...
 
class  DBConnection
 an abstract class from which database queries may be launched. More...
 
class  DBConnectionException
 an exception indicating there is a problem communicating with the database More...
 
class  DBConnectionFactory
 creating a database connection via the static createConnection() method More...
 
class  DbFFIOFileManager
 Class to manage database ingest files and symlinks using FFIO files. More...
 
class  DbFileManager
 Class to manage database ingest files and symlinks using stdio. More...
 
class  Filter
 abstract base class to represent an SQL query filter (part of a WHERE clause) . More...
 
class  LogDatabase
 This class contains methods for accessing the log table in the database. More...
 
class  LogIndexer
 This class is responsible for keeping the history of what syslog2Db has already processed and initializing LogProcessors so that they do not reprocessed previously processed log messages. More...
 
class  LogMessagePointFilter
 Represents an SQL query log message filter (part of a WHERE clause). More...
 
class  LogRecordSelector
 Class to represent an SQL selection (portion of SELECT clause) for a log message. More...
 
class  MalformedSyslogLineException
 An exception indicating that a file you wish to create already exists. More...
 
class  MessageFilter
 template to represent a one component log message filter. More...
 
class  MonitorConfigurationDatabase
 This class contains methods for accessing monitor configuration information. More...
 
class  MonitorDataDatabase
 This class contains methods for accessing monitor configuration information. More...
 
class  MonitorDataIndex
 Class for indexing monitor point data areas. More...
 
class  MonitorDataQueryManager
 Class to compose and execute a query of the monitor database. More...
 
class  MonitorDataTableFinisherThread
 Thread class for executing commands on a monitor data table after it has been populated. More...
 
class  MonitorDescription
 A MonitorDescription object holds all information on a monitor point which is stored in the database and/or an mpml description. More...
 
class  MonitorPointFilter
 Represents an SQL query monitor point filter (part of a WHERE clause). More...
 
class  MonitorPointNumericMaxValueFilter
 template to represent a one component filter for numeric searches on value columns in monitor point data tables. More...
 
class  MonitorPointNumericMinValueFilter
 template to represent a one component filter for numeric searches on min value columns in monitor point data tables. More...
 
class  MonitorPointNumericValueFilter
 template to represent a one component filter for numeric searches on value columns in monitor point data tables. More...
 
class  MonitorPointSelector
 Class to represent an SQL selection (portion of SELECT clause) based on the attributes of a monitor point. More...
 
class  MPMLException
 an exception indicating that there is a problem with the structure of an mpml document More...
 
class  MPSelectorCompare
 Class for sorting a set of MPSelector pointers. More...
 
class  MultiComponentFilter
 represents an SQL query multi-component filter (part of a WHERE clause) More...
 
class  MySQLDBConnection
 an DBConnection implementation for MySQL More...
 
class  NumericFilter
 template to represent a one component numeric search filter. More...
 
class  OneComponentFilter
 abstract base class to represent an SQL query one component filter (part of a WHERE clause) . More...
 
class  PhysicalDeviceIDAuthority
 A lookup class for mapping names and IDs of locations and devices. More...
 
class  PostgresDBConnection
 an DBConnection implementation for PostgreSQL More...
 
class  PriorityFilter
 class to represent an SQL query log priority filter (part of a WHERE clause) . More...
 
class  PrioritySetFilter
 class to represent an SQL query filter for a set of log priorities viz priority IN (INFO, WARN) More...
 
class  ResultsCache
 A class for caching and retrieving results of database queries. More...
 
class  Selector
 Abstract base class to represent an SQL selection (portion of SELECT clause) More...
 
class  SetFilter
 template to represent a one component set search filter (viz. More...
 
class  SQLException
 an exception indicating there is a problem executing an SQL statement (more often than not indicating there is a syntax error in the SQL statement More...
 
class  StringFilter
 template to represent a one component string filter. More...
 
class  SyslogMMAPFile
 This class is responsible for opening/closing the syslog mmap file. More...
 
class  SyslogMMAPOperator
 This class is responsible for performing various operations on the syslog cache. More...
 
class  Table
 Class to mimic a db table The Table class is meant to mimic a database table. More...
 
class  TableManager
 This class is responsible for managing the large, short lived tables produced by CARMA. More...
 
class  TagIDAuthority
 A lookup class for mapping names and IDs. More...
 
class  TagIDFilter
 class to represent an SQL query filter for a tagID (viz tagID==value) More...
 
class  TagIDSetFilter
 class to represent an SQL query filter for a set of tagIDs viz "tagID IN (400,600,900,1245)" More...
 
class  TimeFilter
 class to represent an SQL query one component filter (part of a WHERE clause) . More...
 
class  TimeRangeFilter
 represents an SQL query time range filter (part of a WHERE clause This class represents a (closed) time range filter of the form
testTime >[=] {minTime} AND testTime <[=] {maxTime},
where {minTime} and {maxTime} are fixed values passed as parameters to the constructor. More...
 
class  ValiditySetFilter
 class to represent an SQL query filter for a set of validities viz validity IN (VALID,VALID_GOOD) More...
 

Typedefs

typedef unsigned short dbPriorityType
 Database priority level. More...
 
typedef std::map< const int,
const
carma::dbms::MonitorDescription
ID2MDMap
 map of id (normally a tagID) -> monitor configuration More...
 
typedef std::set
< MonitorPointSelector
*, MPSelectorCompare
MPSelectorSet
 A set of MonitorPointSelector points ordered by tagID. More...
 
typedef std::map< const
dbPriorityType, const
std::string > 
PriorityMap
 A map of DB priority levels -> syslog priority (string) levels. More...
 

Enumerations

enum  DBColumn {
  COLUMN_BLANKINGFLAG, COLUMN_BLANKINGFLAGID, COLUMN_CALLER, COLUMN_DATATYPEID,
  COLUMN_DEVICEID, COLUMN_ENUMID, COLUMN_ENUMINDEX, COLUMN_ENUMVALUE,
  COLUMN_FRAMECOUNT, COLUMN_IMAGPART, COLUMN_INTEGRATEDIMAGPART, COLUMN_INTEGRATEDREALPART,
  COLUMN_INTEGRATEDVALUE, COLUMN_INTEGRATIONID, COLUMN_ISAMPLE, COLUMN_LOCATIONID,
  COLUMN_LOGNAME, COLUMN_MAX, COLUMN_MAXIMAGPART, COLUMN_MAXREALPART,
  COLUMN_MESSAGE, COLUMN_MIN, COLUMN_MINIMAGPART, COLUMN_MINREALPART,
  COLUMN_MPTYPEID, COLUMN_NAME, COLUMN_NDC, COLUMN_PRIORITYID,
  COLUMN_PRIORITY, COLUMN_REALPART, COLUMN_SIGNATURE, COLUMN_SUBSYSID,
  COLUMN_SUBSYSNAME, COLUMN_TAGID, COLUMN_VALIDITY, COLUMN_VALIDITYID,
  COLUMN_VALUE
}
 database columns More...
 
enum  DBTable {
  AGGREGATE_SUBSYSTEMS_TABLE, BLANKING_FLAGS_TABLE, CHANGEABLE_MONITOR_CONFIG_TABLE, DEVICES_TABLE,
  LOCATIONS_TABLE, LOG_MESSAGES_TABLE, LOG_PRIORITIES_TABLE, MONITOR_ENUM_TABLE,
  MONITOR_ENUM_INDEX_TABLE, MONITOR_INDEX_TABLE, MONITOR_POINT_DATATYPES_TABLE, MONITOR_POINT_TYPES_TABLE,
  PARTITIONS_TABLE, STATIC_MONITOR_CONFIG_TABLE, SUBSYSTEM_TABLE, TAGIDNAMESIGNATURES_TABLE,
  VALIDITIES_TABLE, STATIC_MONITOR_CONFIG_CHANGELOG_TABLE
}
 
enum  MonitorAggregateType {
  NUMERIC_TYPE, STRING_TYPE, SHORT_TYPE, COMPLEX_TYPE,
  MAX_AGGREGATE_DATA_TYPE
}
 aggregate data type of the monitor[point,data file, table] More...
 
enum  MonitorAverageType { FRAME_AVG, MINUTE_AVG, WBCORREL_AVG, SLCORREL_AVG }
 average type of the monitor[point,data file,table] More...
 
enum  MonitorDataAreaType { MP_WRITE_AREA, MP_LOAD_AREA, MP_TRANSFER_AREA, MP_SDP_AREA }
 type describing a particular set of directories used in writing, loading, and archiving monitor point data WRITE_AREA = where the monitor data are written LOAD_AREA = from where the monitor data are loaded into the db TRANSFER_AREA = from where the monitor data are transferred to the long term archive More...
 
enum  MonitorPointDataType {
  DATATYPE_BYTE, DATATYPE_SHORT, DATATYPE_INTEGER, DATATYPE_BOOLEAN,
  DATATYPE_FLOAT, DATATYPE_DOUBLE, DATATYPE_COMPLEX, DATATYPE_STRING,
  DATATYPE_SERIAL_NUMBER, DATATYPE_CHAR, DATATYPE_ENUMERATION, DATATYPE_ABSTIME,
  MAX_DATATYPE
}
 type of the monitor point. More...
 
enum  MonitorPointType { MPTYPE_SENSE, MPTYPE_SOFT, MPTYPE_CONTROL, MAX_MPTYPE }
 describes to what class this monitor point belongs More...
 
enum  Resource {
  DEFAULT_RDBMS, DEFAULT_DATASRC, DEFAULT_DBUSER, DEFAULT_DBNAME,
  DEFAULT_ODBCINI, DEFAULT_SOCKET, DEFAULT_PORT
}
 
enum  SortOrder { ASCENDING, DESCENDING }
 enum representing table sort order in an order by clause More...
 

Functions

unsigned short aggregateTypeToDB (const MonitorAggregateType &aggType)
 convert an aggregate type to the value which is written in the db More...
 
unsigned short averageTypeToDB (const MonitorAverageType &avgType)
 convert an average type to the value which is written in the db More...
 
unsigned short blankingFlagging2DB (const carma::monitor::MonitorPoint::BLANKING_FLAGGING &blanking)
 convert the MonitorPoint::BLANKING_FLAGGING value to the value which is written in the db More...
 
std::string blankingFlaggingToString (carma::monitor::MonitorPoint::BLANKING_FLAGGING bf)
 convert a monitor blanking flagging enumerator to string. More...
 
template<typename T , typename U >
std::map< T, U > columnsToMap (const carma::dbms::Column< T > &keyColumn, const carma::dbms::Column< U > &valueColumn)
 
MonitorAggregateType dataType2AggregateType (const MonitorPointDataType &dataType)
 get the aggregate data type that the specific data corresponds to More...
 
carma::monitor::MonitorPoint::BLANKING_FLAGGING db2BlankingFlagging (const unsigned short &dbBlanking)
 convert a db value to its MonitorPoint::BLANKING_FLAGGING counterpart More...
 
MonitorPointDataType db2mpDataType (const unsigned short &dbDataType)
 convert a db value to its MonitorPointDataType counterpart More...
 
MonitorPointType db2mpType (const unsigned short &dbType)
 convert a db value to its MonitorPointType counterpart More...
 
const std::string & db2Priority (const dbPriorityType dbPriority)
 convert a db value to its syslog priority string More...
 
carma::monitor::MonitorPoint::VALIDITY db2Validity (const unsigned short &dbValidity)
 convert a db value to its MonitorPoint::VALIDITY counterpart More...
 
MonitorAggregateType dbToAggregateType (const unsigned short &dbType)
 convert a db value to its MonitorAggregateType counterpart More...
 
MonitorAverageType dbToAverageType (const unsigned short &dbType)
 convert a db value to its MonitorAverageType counterpart More...
 
std::string getColumnName (const DBColumn &column)
 get the actual column name for the specified column More...
 
const PriorityMap getDB2PriorityMap ()
 
std::string getResource (const Resource &resource)
 
std::string getTableName (const DBTable &table)
 
unsigned short mpDataType2DB (const MonitorPointDataType &mpDataType)
 convert a MonitorPointDataType value to the value which is written in the db More...
 
unsigned short mpType2DB (const MonitorPointType &mpType)
 convert a monitor point type to the value which is written in the db More...
 
dbPriorityType priority2DB (const std::string &priority)
 convert the syslog priority string to the value which is written in the db More...
 
template<>
int Table::addElementsToPrivateColumns< std::string > (const Column< std::string > &col)
 
template<>
Column< std::string > Table::getPrivateColumn< std::string > (const unsigned &index) const
 
std::string toString (const SortOrder &sortOrder)
 get a string representing the specified sort order More...
 
std::string toString (const MonitorPointDataType &dataType)
 MonitorPointDataType -> string for error messages, etc. More...
 
std::string toString (const MonitorPointType &mpType)
 MonitorPointType -> string for error messages, etc. More...
 
std::string toString (const MonitorAggregateType &dataType)
 MonitorAggregateDataType -> string for error messages, etc. More...
 
std::string toString (const MonitorDataAreaType &areaType)
 MonitorDataAreaType -> string for error messages, etc. More...
 
std::string toString (const MonitorAverageType &avgType)
 
unsigned short validity2DB (const carma::monitor::MonitorPoint::VALIDITY &validity)
 convert the MonitorPoint::VALIDITY value to the value which is written in the db More...
 
std::string validityToString (carma::monitor::MonitorPoint::VALIDITY validity)
 convert monitor validity to string. More...
 

Detailed Description

API for access to the CARMA database.

Typedef Documentation

typedef unsigned short carma::dbms::dbPriorityType

Database priority level.

Definition at line 30 of file Typedefs.h.

typedef std::map<const int, const carma::dbms::MonitorDescription> carma::dbms::ID2MDMap

map of id (normally a tagID) -> monitor configuration

Definition at line 20 of file Typedefs.h.

A set of MonitorPointSelector points ordered by tagID.

Definition at line 357 of file MonitorPointSelector.h.

typedef std::map<const dbPriorityType, const std::string> carma::dbms::PriorityMap

A map of DB priority levels -> syslog priority (string) levels.

Definition at line 35 of file Typedefs.h.

Enumeration Type Documentation

database columns

Definition at line 26 of file ColumnNames.h.

aggregate data type of the monitor[point,data file, table]

Definition at line 54 of file MonitorSystemAndDBMSRelationships.h.

average type of the monitor[point,data file,table]

Definition at line 66 of file MonitorSystemAndDBMSRelationships.h.

type describing a particular set of directories used in writing, loading, and archiving monitor point data WRITE_AREA = where the monitor data are written LOAD_AREA = from where the monitor data are loaded into the db TRANSFER_AREA = from where the monitor data are transferred to the long term archive

Definition at line 82 of file MonitorSystemAndDBMSRelationships.h.

type of the monitor point.

The first nine correspond to the types defined in carma::monitor::MonitorValueType. The others are additional types defined in MPML files and carma/monitor/monitorPointSpecializations.h

Definition at line 35 of file MonitorSystemAndDBMSRelationships.h.

describes to what class this monitor point belongs

Definition at line 22 of file MonitorSystemAndDBMSRelationships.h.

enum representing table sort order in an order by clause

Definition at line 69 of file ColumnNames.h.

Function Documentation

unsigned short carma::dbms::aggregateTypeToDB ( const MonitorAggregateType &  aggType)

convert an aggregate type to the value which is written in the db

unsigned short carma::dbms::averageTypeToDB ( const MonitorAverageType &  avgType)

convert an average type to the value which is written in the db

unsigned short carma::dbms::blankingFlagging2DB ( const carma::monitor::MonitorPoint::BLANKING_FLAGGING blanking)

convert the MonitorPoint::BLANKING_FLAGGING value to the value which is written in the db

std::string carma::dbms::blankingFlaggingToString ( carma::monitor::MonitorPoint::BLANKING_FLAGGING  bf)

convert a monitor blanking flagging enumerator to string.

template<typename T , typename U >
std::map< T, U > columnsToMap ( const carma::dbms::Column< T > &  keyColumn,
const carma::dbms::Column< U > &  valueColumn 
)

Map the values in keyColumn to the values in valueColumn. This function will throw an carma::util::IllegalArgumentException if, either (or both) columns have at least one null value or if the columns have a different number of elements. Furthermore, keyColumn must have all unique elements since these elements will be the keys of the returned map. If the columns pass these tests, the returned map will have the elments of keyColumn as keys mapped to the elements of valueColumn. The mapping is done by index.

Parameters
keyColumnthe column whose elements will be the keys of the mapping
otherColumnthe column whose elements will be the values of the mapping
Returns
the mapping
Exceptions
carma::util::IllegalArgumentException

Definition at line 297 of file Column.h.

MonitorAggregateType carma::dbms::dataType2AggregateType ( const MonitorPointDataType &  dataType)

get the aggregate data type that the specific data corresponds to

carma::monitor::MonitorPoint::BLANKING_FLAGGING carma::dbms::db2BlankingFlagging ( const unsigned short &  dbBlanking)

convert a db value to its MonitorPoint::BLANKING_FLAGGING counterpart

MonitorPointDataType carma::dbms::db2mpDataType ( const unsigned short &  dbDataType)

convert a db value to its MonitorPointDataType counterpart

MonitorPointType carma::dbms::db2mpType ( const unsigned short &  dbType)

convert a db value to its MonitorPointType counterpart

const std::string& carma::dbms::db2Priority ( const dbPriorityType  dbPriority)

convert a db value to its syslog priority string

carma::monitor::MonitorPoint::VALIDITY carma::dbms::db2Validity ( const unsigned short &  dbValidity)

convert a db value to its MonitorPoint::VALIDITY counterpart

MonitorAggregateType carma::dbms::dbToAggregateType ( const unsigned short &  dbType)

convert a db value to its MonitorAggregateType counterpart

MonitorAverageType carma::dbms::dbToAverageType ( const unsigned short &  dbType)

convert a db value to its MonitorAverageType counterpart

std::string carma::dbms::getColumnName ( const DBColumn &  column)

get the actual column name for the specified column

Parameters
columnthe db column for which to get the name
Returns
the column name
unsigned short carma::dbms::mpDataType2DB ( const MonitorPointDataType &  mpDataType)

convert a MonitorPointDataType value to the value which is written in the db

unsigned short carma::dbms::mpType2DB ( const MonitorPointType &  mpType)

convert a monitor point type to the value which is written in the db

dbPriorityType carma::dbms::priority2DB ( const std::string &  priority)

convert the syslog priority string to the value which is written in the db

std::string carma::dbms::toString ( const SortOrder &  sortOrder)

get a string representing the specified sort order

std::string carma::dbms::toString ( const MonitorPointDataType &  dataType)

MonitorPointDataType -> string for error messages, etc.

Returns
string representation of the data type
std::string carma::dbms::toString ( const MonitorPointType &  mpType)

MonitorPointType -> string for error messages, etc.

Returns
string representation of the monitor point type
std::string carma::dbms::toString ( const MonitorAggregateType &  dataType)

MonitorAggregateDataType -> string for error messages, etc.

Returns
string representation of the aggregate data type
std::string carma::dbms::toString ( const MonitorDataAreaType &  areaType)

MonitorDataAreaType -> string for error messages, etc.

Returns
string representation of the data area type
unsigned short carma::dbms::validity2DB ( const carma::monitor::MonitorPoint::VALIDITY validity)

convert the MonitorPoint::VALIDITY value to the value which is written in the db

std::string carma::dbms::validityToString ( carma::monitor::MonitorPoint::VALIDITY  validity)

convert monitor validity to string.