You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-08-01 06:46:55 +03:00
Reformat all code to coding standard
This commit is contained in:
@ -23,7 +23,7 @@
|
||||
/** @file
|
||||
* This class issues Transaction ID and keeps track of the current version ID
|
||||
*/
|
||||
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
@ -39,30 +39,31 @@
|
||||
using namespace std;
|
||||
using namespace BRM;
|
||||
|
||||
namespace execplan {
|
||||
namespace execplan
|
||||
{
|
||||
|
||||
|
||||
|
||||
SessionManager::SessionManager()
|
||||
{
|
||||
config::Config* conf;
|
||||
|
||||
conf = config::Config::makeConfig();
|
||||
txnidFilename = conf->getConfig("SessionManager", "TxnIDFile");
|
||||
{
|
||||
config::Config* conf;
|
||||
|
||||
conf = config::Config::makeConfig();
|
||||
txnidFilename = conf->getConfig("SessionManager", "TxnIDFile");
|
||||
}
|
||||
|
||||
SessionManager::SessionManager(bool nolock)
|
||||
{
|
||||
config::Config* conf;
|
||||
string stmp;
|
||||
|
||||
conf = config::Config::makeConfig();
|
||||
txnidFilename = conf->getConfig("SessionManager", "TxnIDFile");
|
||||
{
|
||||
config::Config* conf;
|
||||
string stmp;
|
||||
|
||||
conf = config::Config::makeConfig();
|
||||
txnidFilename = conf->getConfig("SessionManager", "TxnIDFile");
|
||||
}
|
||||
|
||||
SessionManager::SessionManager(const SessionManager& sm)
|
||||
{
|
||||
txnidFilename = sm.txnidFilename;
|
||||
txnidFilename = sm.txnidFilename;
|
||||
}
|
||||
|
||||
SessionManager::~SessionManager()
|
||||
@ -71,136 +72,136 @@ SessionManager::~SessionManager()
|
||||
|
||||
const QueryContext SessionManager::verID()
|
||||
{
|
||||
return dbrm.verID();
|
||||
return dbrm.verID();
|
||||
}
|
||||
|
||||
const QueryContext SessionManager::sysCatVerID()
|
||||
{
|
||||
return dbrm.sysCatVerID();
|
||||
return dbrm.sysCatVerID();
|
||||
}
|
||||
|
||||
const TxnID SessionManager::newTxnID(const SID session, bool block, bool isDDL)
|
||||
const TxnID SessionManager::newTxnID(const SID session, bool block, bool isDDL)
|
||||
{
|
||||
TxnID ret;
|
||||
TxnID ret;
|
||||
|
||||
ret = dbrm.newTxnID(session, block, isDDL);
|
||||
return ret;
|
||||
ret = dbrm.newTxnID(session, block, isDDL);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void SessionManager::committed(TxnID& txn)
|
||||
{
|
||||
TxnID tmp;
|
||||
TxnID tmp;
|
||||
|
||||
tmp.id = txn.id;
|
||||
tmp.valid = txn.valid;
|
||||
dbrm.committed(tmp);
|
||||
txn.id = tmp.id;
|
||||
txn.valid = tmp.valid;
|
||||
tmp.id = txn.id;
|
||||
tmp.valid = txn.valid;
|
||||
dbrm.committed(tmp);
|
||||
txn.id = tmp.id;
|
||||
txn.valid = tmp.valid;
|
||||
}
|
||||
|
||||
void SessionManager::rolledback(TxnID& txn)
|
||||
{
|
||||
TxnID tmp;
|
||||
TxnID tmp;
|
||||
|
||||
tmp.id = txn.id;
|
||||
tmp.valid = txn.valid;
|
||||
dbrm.rolledback(tmp);
|
||||
txn.id = tmp.id;
|
||||
txn.valid = tmp.valid;
|
||||
tmp.id = txn.id;
|
||||
tmp.valid = txn.valid;
|
||||
dbrm.rolledback(tmp);
|
||||
txn.id = tmp.id;
|
||||
txn.valid = tmp.valid;
|
||||
}
|
||||
|
||||
const TxnID SessionManager::getTxnID(const SID session)
|
||||
{
|
||||
TxnID tmp;
|
||||
TxnID ret;
|
||||
TxnID tmp;
|
||||
TxnID ret;
|
||||
|
||||
tmp = dbrm.getTxnID(session);
|
||||
ret.id = tmp.id;
|
||||
ret.valid = tmp.valid;
|
||||
tmp = dbrm.getTxnID(session);
|
||||
ret.id = tmp.id;
|
||||
ret.valid = tmp.valid;
|
||||
|
||||
return ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
boost::shared_array<SIDTIDEntry> SessionManager::SIDTIDMap(int& len)
|
||||
{
|
||||
// is this cast valid?
|
||||
return dbrm.SIDTIDMap(len);
|
||||
// is this cast valid?
|
||||
return dbrm.SIDTIDMap(len);
|
||||
}
|
||||
|
||||
string SessionManager::getTxnIDFilename() const
|
||||
string SessionManager::getTxnIDFilename() const
|
||||
{
|
||||
return txnidFilename;
|
||||
return txnidFilename;
|
||||
}
|
||||
|
||||
int SessionManager::verifySize()
|
||||
{
|
||||
return 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
void SessionManager::reset()
|
||||
{
|
||||
dbrm.sessionmanager_reset();
|
||||
dbrm.sessionmanager_reset();
|
||||
}
|
||||
|
||||
const uint32_t SessionManager::getUnique32()
|
||||
{
|
||||
return dbrm.getUnique32();
|
||||
return dbrm.getUnique32();
|
||||
}
|
||||
|
||||
const bool SessionManager::checkActiveTransaction( const SID sessionId, bool& bIsDbrmUp, SIDTIDEntry& blocker )
|
||||
{
|
||||
bIsDbrmUp = true;
|
||||
int arrayLenth = 0;
|
||||
bool ret = false;
|
||||
boost::shared_array<SIDTIDEntry> sIDTIDMap;
|
||||
bIsDbrmUp = true;
|
||||
int arrayLenth = 0;
|
||||
bool ret = false;
|
||||
boost::shared_array<SIDTIDEntry> sIDTIDMap;
|
||||
|
||||
sIDTIDMap = SIDTIDMap( arrayLenth );
|
||||
|
||||
if (sIDTIDMap)
|
||||
{
|
||||
for ( int i = 0; i < arrayLenth; i++ )
|
||||
{
|
||||
if ( sIDTIDMap[i].txnid.valid && ( sIDTIDMap[i].sessionid != sessionId || sessionId == 0 ) )
|
||||
{
|
||||
blocker = sIDTIDMap[i];
|
||||
ret = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
bIsDbrmUp = false;
|
||||
}
|
||||
sIDTIDMap = SIDTIDMap( arrayLenth );
|
||||
|
||||
return ret;
|
||||
if (sIDTIDMap)
|
||||
{
|
||||
for ( int i = 0; i < arrayLenth; i++ )
|
||||
{
|
||||
if ( sIDTIDMap[i].txnid.valid && ( sIDTIDMap[i].sessionid != sessionId || sessionId == 0 ) )
|
||||
{
|
||||
blocker = sIDTIDMap[i];
|
||||
ret = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
bIsDbrmUp = false;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
const bool SessionManager::isTransactionActive(const SID sessionId, bool& bIsDbrmUp)
|
||||
{
|
||||
bIsDbrmUp = true;
|
||||
int arrayLenth = 0;
|
||||
bool ret = false;
|
||||
boost::shared_array<SIDTIDEntry> sIDTIDMap;
|
||||
bIsDbrmUp = true;
|
||||
int arrayLenth = 0;
|
||||
bool ret = false;
|
||||
boost::shared_array<SIDTIDEntry> sIDTIDMap;
|
||||
|
||||
sIDTIDMap = SIDTIDMap(arrayLenth);
|
||||
sIDTIDMap = SIDTIDMap(arrayLenth);
|
||||
|
||||
if (sIDTIDMap)
|
||||
{
|
||||
for ( int i = 0; i < arrayLenth; i++ )
|
||||
{
|
||||
if (sIDTIDMap[i].txnid.valid && (sIDTIDMap[i].sessionid == sessionId))
|
||||
{
|
||||
ret = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
bIsDbrmUp = false;
|
||||
}
|
||||
if (sIDTIDMap)
|
||||
{
|
||||
for ( int i = 0; i < arrayLenth; i++ )
|
||||
{
|
||||
if (sIDTIDMap[i].txnid.valid && (sIDTIDMap[i].sessionid == sessionId))
|
||||
{
|
||||
ret = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
bIsDbrmUp = false;
|
||||
}
|
||||
|
||||
return ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
} //namespace
|
||||
|
Reference in New Issue
Block a user