Kea: isc::db::CqlVersionExchange Class Reference

| Kea 1.5.0

Public Member Functions | Static Public Attributes | List of all members
isc::db::CqlVersionExchange Class Reference

Exchange used to retrieve schema version from the keyspace. More...

`#include <cql_exchange.h>`

Inheritance diagram for isc::db::CqlVersionExchange:
[legend]

## Public Member Functions
| CqlVersionExchange ()
| Constructor. More...
virtual | ~CqlVersionExchange ()
| Destructor. More...
virtual void | createBindForSelect (AnyArray &data, StatementTag statement_tag=NULL) override
| Create BIND array to receive C++ data. More...
virtual boost::any | retrieve () override
| Copy received data into the <version,minor> pair. More...
virtual VersionPair | retrieveVersion (const CqlConnection &connection)
| Standalone method used to retrieve schema version. More...
Public Member Functions inherited from isc::db::CqlExchange
| CqlExchange ()
| Constructor. More...
virtual | ~CqlExchange ()
| Destructor. More...
void | executeMutation (const CqlConnection &connection, const AnyArray &assigned_values, StatementTag statement_tag)
| Executes INSERT, UPDATE or DELETE statements. More...
AnyArray | executeSelect (const CqlConnection &connection, const AnyArray &where_values, StatementTag statement_tag, const bool &single=false)
| Executes SELECT statements. More...
bool | statementApplied (CassFuture *future, size_t *row_count=NULL, size_t *column_count=NULL)
| Check if CQL statement has been applied. More...
Public Member Functions inherited from isc::db::SqlExchange
| SqlExchange ()
| Constructor. More...
virtual | ~SqlExchange ()
| Destructor. More...

## Static Public Attributes
static StatementMap | tagged_statements_
| Cassandra statements. More...
static constexpr StatementTag | GET_VERSION = "GET_VERSION"
| Statement tags definitions. More...

## Additional Inherited Members
Static Public Member Functions inherited from isc::db::CqlExchange
static void | convertToDatabaseTime (const time_t &cltt, const uint32_t &valid_lifetime, cass_int64_t &expire)
static void | convertFromDatabaseTime (const cass_int64_t &expire, const cass_int64_t &valid_lifetime, time_t &cltt)
| Converts time from Cassandra format. More...

## Detailed Description

Exchange used to retrieve schema version from the keyspace.

Definition at line 236 of file cql_exchange.h.

## Constructor & Destructor Documentation

## ◆ CqlVersionExchange()

isc::db::CqlVersionExchange::CqlVersionExchange | ( |  | ) |

Constructor.

Specifies table columns.

Definition at line 975 of file cql_exchange.cc.

## ◆ ~CqlVersionExchange()

isc::db::CqlVersionExchange::~CqlVersionExchange | ( |  | ) |
| virtual

Destructor.

Definition at line 978 of file cql_exchange.cc.

## Member Function Documentation

## ◆ createBindForSelect()

void isc::db::CqlVersionExchange::createBindForSelect | ( | AnyArray & | data,
|  | StatementTag | statement_tag = `NULL`
| ) |  |
| overridevirtual

Create BIND array to receive C++ data.

Used in executeSelect() to retrieve from database

Parameters

  data | array of bound objects representing data to be retrieved
  statement_tag | prepared statement being executed; defaults to an invalid index

Implements isc::db::CqlExchange.

Definition at line 982 of file cql_exchange.cc.

References isc::db::AnyArray::add().

Here is the call graph for this function:

## ◆ retrieve()

boost::any isc::db::CqlVersionExchange::retrieve | ( |  | ) |
| overridevirtual

Copy received data into the <version,minor> pair.

Copies information about the version to be retrieved into a pair. Called in executeSelect().

Returns
  a pointer to the object retrieved.

Implements isc::db::CqlExchange.

Definition at line 989 of file cql_exchange.cc.

## ◆ retrieveVersion()

VersionPair isc::db::CqlVersionExchange::retrieveVersion | ( | const CqlConnection & | connection | ) |
| virtual

Standalone method used to retrieve schema version.

Parameters

  connection | array of bound objects representing data to be retrieved

Returns
  version of schema specified in the prepared statement in the CqlConnection parameter

Definition at line 995 of file cql_exchange.cc.

References isc::db::CqlExchange::executeSelect(), and GET_VERSION.

Referenced by isc::dhcp::CqlLeaseMgr::getVersion(), and isc::dhcp::CqlHostDataSourceImpl::getVersion().

Here is the call graph for this function:

## Member Data Documentation

## ◆ GET_VERSION

constexpr StatementTag isc::db::CqlVersionExchange::GET_VERSION = "GET_VERSION"
| staticconstexpr

Statement tags definitions.

Definition at line 276 of file cql_exchange.h.

Referenced by retrieveVersion().

## ◆ tagged_statements_

StatementMap isc::db::CqlVersionExchange::tagged_statements_
| static

Initial value:
= {
{GET_VERSION, {GET_VERSION, "SELECT version, minor FROM schema_version "}}
}

Cassandra statements.

Definition at line 280 of file cql_exchange.h.

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

- cql_exchange.h
- cql_exchange.cc

isc::db::CqlVersionExchange::GET_VERSION
static constexpr StatementTag GET_VERSION
Statement tags definitions.
Definition: cql_exchange.h:276