[-]
[+]
|
Changed |
cego.changes
|
|
[-]
[+]
|
Changed |
cego.spec
^
|
|
[-]
[+]
|
Changed |
cego-2.12.3.tar.bz2/README
^
|
@@ -4,7 +4,7 @@
----
A relational and transactional database system
- Version 2.12.2
+ Version 2.12.3
(C)opyright 2006,2007,2008,2009,2010,2011,2012 by Bjoern Lemke
|
[-]
[+]
|
Changed |
cego-2.12.3.tar.bz2/samples/chkdb/chkblow
^
|
@@ -1,2 +1,2 @@
#!/bin/bash
-../../src/cgblow --mode=insert --server=localhost --port=2200 --iset=i:10000,s:3 --table=t1 --tableset=TS1 --user=lemke/lemke --append --interval=1000 --count=5000000 $@
+../../src/cgblow --mode=insert --server=localhost --port=2200 --iset=i:10000,s:3,s:10,s:5 --table=t1 --tableset=TS1 --user=lemke/lemke --append --interval=1000 --count=5000000 $@
|
[-]
[+]
|
Changed |
cego-2.12.3.tar.bz2/samples/chkdb/chkclt
^
|
@@ -1,2 +1,2 @@
#!/bin/bash
-../../src/cgclt --server=localhost --port=2200 --tableset=TS1 --user=lemke/lemke $@
+../../src/cgclt --server=localhost --port=2200 --tableset=sysmt --user=lemke/lemke $@
|
[-]
[+]
|
Changed |
cego-2.12.3.tar.bz2/samples/chkdb/db/chkdb.xml
^
|
@@ -1,6 +1,6 @@
<?xml version="1.0" ?>
<!DOCTYPE CEGO_DB_SPEC>
-<DATABASE NAME="chkdb" PAGESIZE="65536" HOSTNAME="localhost" ADMINPORT="2000" LOGPORT="3000" DATAPORT="2200" PIDFILE="./db/pid" MAXFID="32" MAXTSID="2" NUMRECSEMA="2141" NUMSYSPAGESEMA="41" NUMDATAPAGESEMA="41" NUMIDXPAGESEMA="41" NUMRBPAGESEMA="2141" NUMDATAFILESEMA="11" NUMBUFFERPOOLSEMA="11" MAXFIXTRIES="30" CSMODE="ON" QESCMODE="ON" LOGMNGPROG="./cglogmng">
 <MODULE NAME="ALL" LEVEL="DEBUG"></MODULE>
+<DATABASE NAME="chkdb" PAGESIZE="32768" HOSTNAME="localhost" ADMINPORT="2000" LOGPORT="3000" DATAPORT="2200" PIDFILE="./db/pid" MAXFID="32" MAXTSID="2" NUMRECSEMA="2141" NUMSYSPAGESEMA="41" NUMDATAPAGESEMA="41" NUMIDXPAGESEMA="41" NUMRBPAGESEMA="2141" NUMDATAFILESEMA="11" NUMBUFFERPOOLSEMA="11" MAXFIXTRIES="30" CSMODE="ON" QESCMODE="ON" LOGMNGPROG="./cglogmng">
 <MODULE NAME="ALL" LEVEL="NOTICE"></MODULE>
<USER NAME="cgadm" PASSWD="f9d1bb5de113b12009fd4b1672a23cfe" TRACE="OFF" ROLE="admin"></USER>
<ROLE NAME="ALL"> <PERM TABLESET="TS1" FILTER="ALL" PERM="ALL" PERMID="TS1_P"></PERM>
</ROLE>
|
[-]
[+]
|
Changed |
cego-2.12.3.tar.bz2/samples/chkdb/mkdb
^
|
@@ -14,7 +14,7 @@
DBXML=./db/chkdb.xml
DBNAME=chkdb
# PAGESIZE=131072
-PAGESIZE=65536
+PAGESIZE=32768
DBHOST=localhost
ADMPORT=2000
DBPORT=2200
@@ -23,8 +23,8 @@
ADMINUSER=cgadm
ADMINPWD=cgadm
-DEBUGLEVEL=DEBUG
-#DEBUGLEVEL=NOTICE
+# DEBUGLEVEL=DEBUG
+DEBUGLEVEL=NOTICE
### end of customizing ###
|
[-]
[+]
|
Changed |
cego-2.12.3.tar.bz2/src/CegoAdminHandler.cc
^
|
@@ -67,7 +67,10 @@
CegoAdminHandler::ResultType CegoAdminHandler::requestSession(const Chain& user, const Chain& password, bool doEncrypt)
{
+
+#ifdef DEBUG
_pModule->log(_modId, Logger::DEBUG, Chain("Request session for user ") + user + Chain("/") + password);
+#endif
_xml.getDocument()->clear();
@@ -94,15 +97,20 @@
_xml.getDocument()->clear();
_pN->setMsg(request, request.length());
+
+#ifdef DEBUG
_pModule->log(_modId, Logger::DEBUG, Chain("Requesting session ..."));
-
+#endif
+
_pN->writeMsg();
_pN->readMsg();
+#ifdef DEBUG
_pModule->log(_modId, Logger::DEBUG, Chain("--- XML ---"));
_pModule->log(_modId, Logger::DEBUG, _pN->getMsg());
_pModule->log(_modId, Logger::DEBUG, Chain("--- --- ---"));
+#endif
_xml.getDocument()->clear();
_xml.setChain( _pN->getMsg() );
@@ -112,12 +120,17 @@
if ( docType == Chain(XML_OK_DOC) )
{
+#ifdef DEBUG
_pModule->log(_modId, Logger::DEBUG, Chain("Session established"));
+#endif
return ADM_OK;
}
else // if ( docType == Chain(XML_ERROR_DOC) )
{
+#ifdef DEBUG
_pModule->log(_modId, Logger::DEBUG, Chain("Session rejected"));
+#endif
+
return ADM_ERROR;
}
@@ -140,9 +153,11 @@
_pN->readMsg();
+#ifdef DEBUG
_pModule->log(_modId, Logger::DEBUG, Chain("--- XML ---"));
_pModule->log(_modId, Logger::DEBUG, _pN->getMsg());
_pModule->log(_modId, Logger::DEBUG, Chain("--- --- ---"));
+#endif
_xml.getDocument()->clear();
_xml.setChain( _pN->getMsg() );
@@ -152,12 +167,18 @@
if ( docType == Chain(XML_OK_DOC) )
{
+#ifdef DEBUG
_pModule->log(_modId, Logger::DEBUG, Chain("Session closed"));
+#endif
+
return ADM_OK;
}
else // if ( docType == Chain(XML_ERROR_DOC) )
{
+#ifdef DEBUG
_pModule->log(_modId, Logger::DEBUG, Chain("Session close failed"));
+#endif
+
return ADM_ERROR;
}
}
@@ -165,8 +186,10 @@
bool CegoAdminHandler::acceptSession()
{
+#ifdef DEBUG
_pModule->log(_modId, Logger::DEBUG, Chain("Accepting session"));
-
+#endif
+
try {
_xml.getDocument()->clear();
@@ -193,10 +216,12 @@
Chain response;
_xml.getXMLChain(response);
+#ifdef DEBUG
_pModule->log(_modId, Logger::DEBUG, Chain("--- XML ---"));
_pModule->log(_modId, Logger::DEBUG, response);
_pModule->log(_modId, Logger::DEBUG, Chain("--- --- ---"));
-
+#endif
+
_pN->setMsg(response, response.length());
_pN->writeMsg();
@@ -246,17 +271,21 @@
CegoAdminHandler::RequestType CegoAdminHandler::acceptRequest()
{
+#ifdef DEBUG
_pModule->log(_modId, Logger::DEBUG, Chain("Accepting request"));
-
+#endif
+
if ( _pN->waitMsg(NETMNG_WAITMSG_TIMEOUT) == false )
return CegoAdminHandler::REQTIMEOUT;
_pN->readMsg();
+#ifdef DEBUG
_pModule->log(_modId, Logger::DEBUG, Chain("--- XML ---"));
_pModule->log(_modId, Logger::DEBUG, _pN->getMsg());
_pModule->log(_modId, Logger::DEBUG, Chain("--- --- ---"));
+#endif
_xml.getDocument()->clear();
_xml.setChain( _pN->getMsg() );
@@ -912,13 +941,17 @@
_pN->setMsg(request, request.length());
+#ifdef DEBUG
_pModule->log(_modId, Logger::DEBUG, Chain("Sending request ") + request);
+#endif
_pN->writeMsg();
_pN->readMsg();
+#ifdef DEBUG
_pModule->log(_modId, Logger::DEBUG, Chain("Got response ") + _pN->getMsg());
+#endif
_xml.getDocument()->clear();
_xml.setChain( _pN->getMsg() );
@@ -931,8 +964,11 @@
if ( docType == Chain(XML_OK_DOC) )
{
+#ifdef DEBUG
_pModule->log(_modId, Logger::DEBUG, Chain("Sending file data for ") + fileName);
+#endif
+
char buf[NETMNG_MSG_BUFLEN];
int len;
@@ -940,7 +976,10 @@
while ( ( len = copyFile.readByte(buf, NETMNG_MSG_BUFLEN) ) > 0 )
{
_pN->setMsg(buf, len);
+#ifdef DEBUG
_pModule->log(_modId, Logger::DEBUG, Chain("Sending ") + Chain(len) + Chain(" bytes"));
+#endif
+
_pN->writeMsg();
_pN->recvAck();
@@ -1693,19 +1732,23 @@
_xml.getDocument()->clear();
+#ifdef DEBUG
_pModule->log(_modId, Logger::DEBUG, Chain("--- XML ---"));
_pModule->log(_modId, Logger::DEBUG, request);
_pModule->log(_modId, Logger::DEBUG, Chain("--- --- ---"));
-
+#endif
+
_pN->setMsg(request, request.length());
_pN->writeMsg();
_pN->readMsg();
+#ifdef DEBUG
_pModule->log(_modId, Logger::DEBUG, Chain("--- XML ---"));
_pModule->log(_modId, Logger::DEBUG, _pN->getMsg());
_pModule->log(_modId, Logger::DEBUG, Chain("--- --- ---"));
+#endif
_xml.getDocument()->clear();
_xml.setChain( _pN->getMsg() );
@@ -2356,10 +2399,12 @@
_xml.getDocument()->clear();
+#ifdef DEBUG
_pModule->log(_modId, Logger::DEBUG, Chain("--- XML ---"));
_pModule->log(_modId, Logger::DEBUG, xmlString);
_pModule->log(_modId, Logger::DEBUG, Chain("--- --- ---"));
-
+#endif
+
_pN->setMsg(xmlString, xmlString.length());
_pN->writeMsg();
@@ -2381,19 +2426,26 @@
_xml.getXMLChain(xmlString);
+#ifdef DEBUG
_pModule->log(_modId, Logger::DEBUG, Chain("--- XML ---"));
_pModule->log(_modId, Logger::DEBUG, xmlString);
_pModule->log(_modId, Logger::DEBUG, Chain("--- --- ---"));
+#endif
_pN->setMsg(xmlString, xmlString.length());
_pN->writeMsg();
+#ifdef DEBUG
_pModule->log(_modId, Logger::DEBUG, Chain("Waiting for ack ..."));
+#endif
_pN->recvAck();
+#ifdef DEBUG
_pModule->log(_modId, Logger::DEBUG, Chain("Sending data of size ") + Chain(data.length()) + Chain(" ..."));
+#endif
+
_pN->setMsg(data, data.length());
_pN->writeMsg();
@@ -2448,10 +2500,12 @@
Chain xmlString;
_xml.getXMLChain(xmlString);
+#ifdef DEBUG
_pModule->log(_modId, Logger::DEBUG, Chain("--- XML ---"));
_pModule->log(_modId, Logger::DEBUG, xmlString);
_pModule->log(_modId, Logger::DEBUG, Chain("--- --- ---"));
-
+#endif
+
_pN->setMsg(xmlString, xmlString.length());
_pN->writeMsg();
@@ -2475,10 +2529,12 @@
Chain xmlString;
_xml.getXMLChain(xmlString);
+#ifdef DEBUG
_pModule->log(_modId, Logger::DEBUG, Chain("--- XML ---"));
_pModule->log(_modId, Logger::DEBUG, xmlString);
_pModule->log(_modId, Logger::DEBUG, Chain("--- --- ---"));
-
+#endif
+
_pN->setMsg(xmlString, xmlString.length());
_pN->writeMsg();
|
[-]
[+]
|
Changed |
cego-2.12.3.tar.bz2/src/CegoAdminThread.cc
^
|
@@ -97,7 +97,10 @@
if ( _pRequest )
{
+#ifdef DEBUG
_pDBMng->log(_modId, Logger::DEBUG, Chain("Thread ") + Chain(_idx) + Chain(": serving service request"));
+#endif
+
_pPool->setState(_idx, CegoAdminThreadPool::CONNECTED);
_pPool->incNumRequest(_idx);
@@ -128,7 +131,10 @@
}
_pDBMng->decreaseActiveAdmThread();
+#ifdef DEBUG
_pDBMng->log(_modId, Logger::DEBUG, Chain("Thread ") + Chain(_idx) + Chain(": service request finished"));
+#endif
+
_pPool->setState(_idx, CegoAdminThreadPool::READY);
delete _pRequest;
@@ -187,9 +193,12 @@
try
{
+#ifdef DEBUG
_pDBMng->log(_modId, Logger::DEBUG, Chain("Thread ") + Chain(_idx)
+ Chain(": Copying tableset ") + tableSet + Chain(" to secondary"));
+#endif
+
if ( _pDBMng->getTableSetRunState(tableSet) == Chain(XML_OFFLINE_VALUE) )
{
copyTableSet(copyId, tableSet, secondary, mediator, user, passwd, false);
@@ -232,8 +241,11 @@
void CegoAdminThread::serveSession(CegoAdminHandler *pAH)
{
+#ifdef DEBUG
_pDBMng->log(_modId, Logger::DEBUG, Chain("Thread ") + Chain(_idx) + Chain(": serving session"));
+#endif
+
if ( pAH->acceptSession() )
{
@@ -271,7 +283,11 @@
}
else
{
+
+#ifdef DEBUG
_pDBMng->log(_modId, Logger::DEBUG, Chain("Thread ") + Chain(_idx) + Chain(": admin client request timeout occured, waitung ..."));
+#endif
+
}
}
}
@@ -787,7 +803,9 @@
{
isTerminated=true;
+#ifdef DEBUG
_pDBMng->log(_modId, Logger::DEBUG, Chain(" Thread ") + Chain(_idx) + Chain(": terminating session"));
+#endif
pAH->sendResponse(Chain("Session Closed"));
break;
@@ -811,12 +829,17 @@
void CegoAdminThread::copyTableSet(int copyId, const Chain& tableSet, const Chain& secondary, const Chain& mediator, const Chain& user, const Chain& passwd, bool copyOnline)
{
+#ifdef DEBUG
_pDBMng->log(_modId, Logger::DEBUG, Chain("Thread ") + Chain(_idx) + Chain(": Copying tableset ") + tableSet + Chain("..."));
+#endif
+
int adminPort;
_pDBMng->getAdminPort(adminPort);
+#ifdef DEBUG
_pDBMng->log(_modId, Logger::DEBUG, Chain("Thread ") + Chain(_idx) + Chain(": Connecting to secondary ") + secondary + Chain("..."));
+#endif
Net n ( NETMNG_MSG_BUFLEN, NETMNG_SIZEBUFLEN );
@@ -2171,8 +2194,10 @@
{
pN->readMsg();
+#ifdef DEBUG
_pDBMng->log(_modId, Logger::DEBUG, Chain("Received ") + Chain(pN->getMsgSize()) + Chain(" bytes"));
-
+#endif
+
copyFile.writeByte(pN->getMsg(), pN->getMsgSize());
recvLen += pN->getMsgSize();
@@ -2705,9 +2730,11 @@
pAH->getTableSyncStateList(tsList, syncList);
+#ifdef DEBUG
_pDBMng->log(_modId, Logger::DEBUG, Chain("Setting host status <") + hostStatus + Chain("> for host <")
+ hostName + Chain(">"));
-
+#endif
+
_pDBMng->setHostStatus(hostName, hostStatus);
Chain *pTS = tsList.First();
@@ -2716,7 +2743,10 @@
while ( pTS && pSync )
{
- _pDBMng->log(_modId, Logger::DEBUG, Chain("Setting tableset status for <") + *pTS + Chain("> to ") + *pSync );
+#ifdef DEBUG
+ _pDBMng->log(_modId, Logger::DEBUG, Chain("Setting tableset status for <") + *pTS + Chain("> to ") + *pSync );
+#endif
+
_pDBMng->setTableSetSyncState(*pTS, *pSync);
pTS = tsList.Next();
pSync = syncList.Next();
@@ -3215,7 +3245,9 @@
while ( _pDBMng->getRecoveryMode(tabSetId) != CegoDatabaseManager::OFF )
{
+#ifdef DEBUG
_pDBMng->log(_modId, Logger::DEBUG, Chain("Waiting for recovery end ..."));
+#endif
Sleeper s;
s.secSleep(LOGMNG_RECOVERY_DELAY);
}
@@ -3224,7 +3256,10 @@
else
{
+#ifdef DEBUG
_pDBMng->log(_modId, Logger::DEBUG, Chain("Stopping recovery on secondary ..."));
+#endif
+
CegoAdminHandler::ResultType res = pSecondaryAH->reqStopRecovery(tableSet);
@@ -3880,7 +3915,10 @@
{
try
{
+#ifdef DEBUG
_pDBMng->log(_modId, Logger::DEBUG, Chain("Stopping tableset ") + tableSet);
+#endif
+
_pTabMng->stopTableSet(tableSet, true);
int tabSetId = _pDBMng->getTabSetId(tableSet);
@@ -3958,13 +3996,18 @@
while ( _pDBMng->getRecoveryMode(tabSetId) != CegoDatabaseManager::OFF )
{
+#ifdef DEBUG
_pDBMng->log(_modId, Logger::DEBUG, Chain("Waiting for recovery end ... "));
+#endif
Sleeper s;
s.secSleep(LOGMNG_RECOVERY_DELAY);
}
}
+#ifdef DEBUG
_pDBMng->log(_modId, Logger::DEBUG, Chain("Starting tableset ") + tableSet);
+#endif
+
_pTabMng->startDistTableSet(tableSet, newSecondary, false);
// load objects not really required, for performance reasons we do not
|
[-]
[+]
|
Changed |
cego-2.12.3.tar.bz2/src/CegoAdminThreadPool.cc
^
|
@@ -162,7 +162,10 @@
Net net( NETMNG_MSG_BUFLEN, NETMNG_SIZEBUFLEN );
+#ifdef DEBUG
_pDBMng->log(_modId, Logger::DEBUG, Chain("Serving admin requests on port ") + Chain(_adminPortNo));
+#endif
+
// cout << "Serving portno " << _adminPortNo << endl;
net.serve(_adminHostName, _adminPortNo);
@@ -225,8 +228,11 @@
while ( i < _poolLimit )
{
+#ifdef DEBUG
_pDBMng->log(_modId, Logger::DEBUG, Chain("Waiting for admin thread with tid ")
+ Chain(_threadList[i]->getTid()) + Chain(" to terminate"));
+#endif
+
join(_threadList[i]->getTid());
i++;
|
[-]
[+]
|
Changed |
cego-2.12.3.tar.bz2/src/CegoBeatThread.cc
^
|
@@ -79,7 +79,10 @@
{
if ( beatList.Find((*pBC)->getHostName()) == 0 )
{
+#ifdef DEBUG
_pDBMng->log(_modId, Logger::DEBUG, Chain("Removing beat connection to ") + (*pBC)->getHostName() + Chain(" ..."));
+#endif
+
(*pBC)->disconnect();
_pDBMng->setHostStatus((*pBC)->getHostName(), XML_OFFLINE_VALUE);
@@ -113,7 +116,9 @@
if ( notFound )
{
+#ifdef DEBUG
_pDBMng->log(_modId, Logger::DEBUG, Chain("Adding beat connection to ") + *pBeatHost + Chain(" ..."));
+#endif
int adminPort;
Chain adminUser;
|
[-]
[+]
|
Changed |
cego-2.12.3.tar.bz2/src/CegoBufferPool.cc
^
|
@@ -69,7 +69,9 @@
void CegoBufferPool::initPool(long numPages)
{
+#ifdef DEBUG
log(_modId, Logger::DEBUG, Chain("Reading xml def ..."));
+#endif
xml2Doc();
@@ -345,8 +347,9 @@
{
_numDiskWrite++;
+#ifdef DEBUG
log(_modId, Logger::DEBUG, Chain("Async write of page [") + Chain(bh.fileId) + Chain(",") + Chain(bh.pageId) + Chain("]"));
-
+#endif
// cout << "---- >>>> Async write of page [" << bh.fileId << "," << bh.pageId << "]" << endl;
@@ -640,8 +643,9 @@
if ( isMarked(bh.fileId, bh.pageId) == false )
{
+#ifdef DEBUG
log(_modId, Logger::DEBUG, Chain("Reading page (") + Chain(bh.fileId) + Chain(",") + Chain(bh.pageId) + Chain(") to log ..."));
-
+#endif
int ts;
int fixStat;
char *pageData = new char[_pageSize];
@@ -661,8 +665,9 @@
Chain logFile;
int logSize = 0 ;
+#ifdef DEBUG
log(_modId, Logger::DEBUG, Chain("Switching logFiles ..."));
-
+#endif
while ( switchLogFile(tabSetId) == false )
{
|
[-]
[+]
|
Changed |
cego-2.12.3.tar.bz2/src/CegoClient.cc
^
|
@@ -639,8 +639,10 @@
CegoDbHandler* pSH = new CegoDbHandler(pN, pModule);
+#ifdef DEBUG
pModule->log(modId, Logger::DEBUG, Chain("Requesting session ..."));
-
+#endif
+
CegoDbHandler::ResultType res = pSH->requestSession(tableSet, user, password);
if ( res != CegoDbHandler::DB_OK )
{
@@ -659,7 +661,10 @@
AbortHandler *pAH = new AbortHandler(serverName, portNo, tableSet, user, password, tid, pModule);
+#ifdef DEBUG
pModule->log(modId, Logger::DEBUG, Chain("Got session ..."));
+#endif
+
read_history((char*)histPath);
bool goOn = true;
|
[-]
[+]
|
Changed |
cego-2.12.3.tar.bz2/src/CegoDatabaseManager.cc
^
|
@@ -925,13 +925,16 @@
try
{
+#ifdef DEBUG
log(_modId, Logger::DEBUG, Chain("Connecting to ") + Chain(hostName) + Chain(" on port ") + Chain(portNo));
+#endif
pN = n.connect(hostName, portNo);
pSH = new CegoDistDbHandler(pN, this);
+#ifdef DEBUG
log(_modId, Logger::DEBUG, Chain("Using user ") + userName + Chain("/") + password);
-
+#endif
pSH->requestSession(tableSet, userName, password, false);
}
@@ -957,7 +960,9 @@
void CegoDatabaseManager::closeSession(CegoDistDbHandler* pSH)
{
+#ifdef DEBUG
log(_modId, Logger::DEBUG, Chain("Closing session ..."));
+#endif
pSH->closeSession();
|
[-]
[+]
|
Changed |
cego-2.12.3.tar.bz2/src/CegoDefs.h
^
|
@@ -40,7 +40,7 @@
#endif
#define CEGO_PRODUCT "Cego"
-#define CEGO_VERSION "2.12.2"
+#define CEGO_VERSION "2.12.3"
#define CEGO_COPYRIGHT "Copyright (C) 2000-2012 by Bjoern Lemke. All rights reserved"
/*******************************/
|
[-]
[+]
|
Changed |
cego-2.12.3.tar.bz2/src/CegoDistDbHandler.cc
^
|
@@ -868,9 +868,10 @@
void CegoDistDbHandler::sendObjList(const ListT<Chain>& objList)
{
-
+#ifdef DEBUG
_pModule->log(_modId, Logger::DEBUG, Chain("Sending object info"));
+#endif
_xml.getDocument()->clear();
@@ -892,10 +893,13 @@
Chain response;
_xml.getXMLChain(response);
+#ifdef DEBUG
_pModule->log(_modId, Logger::DEBUG, Chain("--- XML ---"));
_pModule->log(_modId, Logger::DEBUG, response);
_pModule->log(_modId, Logger::DEBUG, Chain("--- --- ---"));
+#endif
+
_pN->setMsg((char*)response, response.length());
_pN->writeMsg();
@@ -940,9 +944,11 @@
_xml.getXMLChain(response);
+#ifdef DEBUG
_pModule->log(_modId, Logger::DEBUG, Chain("--- XML ---"));
_pModule->log(_modId, Logger::DEBUG, response);
_pModule->log(_modId, Logger::DEBUG, Chain("--- --- ---"));
+#endif
_pN->setMsg((char*)response, response.length());
_pN->writeMsg();
@@ -965,10 +971,13 @@
Chain response;
_xml.getXMLChain(response);
+#ifdef DEBUG
_pModule->log(_modId, Logger::DEBUG, Chain("--- XML ---"));
_pModule->log(_modId, Logger::DEBUG, response);
_pModule->log(_modId, Logger::DEBUG, Chain("--- --- ---"));
+#endif
+
_pN->setMsg((char*)response, response.length());
_pN->writeMsg();
@@ -990,10 +999,12 @@
Chain response;
_xml.getXMLChain(response);
+#ifdef DEBUG
_pModule->log(_modId, Logger::DEBUG, Chain("--- XML ---"));
_pModule->log(_modId, Logger::DEBUG, response);
_pModule->log(_modId, Logger::DEBUG, Chain("--- --- ---"));
-
+#endif
+
_pN->setMsg((char*)response, response.length());
_pN->writeMsg();
|
[-]
[+]
|
Changed |
cego-2.12.3.tar.bz2/src/CegoIndexManager.cc
^
|
@@ -1181,7 +1181,34 @@
}
else
{
- Chain msg = "Index value not found";
+
+
+ CegoField* pF = schema.First();
+ char *p = idxPtr;
+
+ Chain v;
+
+ while (pF)
+ {
+
+ int flen;
+ memcpy(&flen, p, sizeof(int));
+ p += sizeof(int);
+
+ CegoFieldValue fv;
+ fv.setLength(flen);
+ fv.setValue(p);
+
+ if ( flen > 0 )
+ fv.setType(pF->getType());
+
+ p += flen;
+
+ v += fv.valAsChain() + Chain(" ");
+ pF = schema.Next();
+ }
+
+ Chain msg = Chain("Value for index ") + indexName + Chain(" ( value = ") + v + Chain(") not found");
throw Exception(EXLOC, msg);
}
}
|
[-]
[+]
|
Changed |
cego-2.12.3.tar.bz2/src/CegoMain.cc
^
|
@@ -714,7 +714,9 @@
if ( pDBMng->isArchiveMode(tableSet) )
{
+#ifdef DEBUG
pDBMng->log(modId, Logger::DEBUG, Chain("Creating log threadpool ..."));
+#endif
pLogPool = new CegoLogThreadPool(pDBMng);
pLogPool->start(0);
}
@@ -723,8 +725,9 @@
pTabMng->setActiveUser(tableSet, user, password);
+#ifdef DEBUG
pDBMng->log(modId, Logger::DEBUG, Chain("Starting tableset ") + tableSet + Chain(" ..."));
-
+#endif
Host h;
pTabMng->startDistTableSet(tableSet, h.getName(), false);
@@ -879,15 +882,19 @@
if ( pDBMng->isArchiveMode(tableSet) )
{
+#ifdef DEBUG
pDBMng->log(modId, Logger::DEBUG, Chain("Creating log threadpool ..."));
+#endif
+
pLogPool = new CegoLogThreadPool(pDBMng);
pLogPool->start(0);
}
pTabMng = new CegoDistManager(pDBMng);
- pDBMng->log(modId, Logger::DEBUG, Chain("Starting tableset ") + tableSet + Chain(" ..."));
-
+#ifdef DEBUG
+ pDBMng->log(modId, Logger::DEBUG, Chain("Starting tableset ") + tableSet + Chain(" ..."));
+#endif
Host h;
pTabMng->startDistTableSet(tableSet, h.getName(), false);
@@ -1041,7 +1048,10 @@
if ( pDBMng->isArchiveMode(tableSet) )
{
+#ifdef DEBUG
pDBMng->log(modId, Logger::DEBUG, Chain("Creating log threadpool ..."));
+#endif
+
pLogPool = new CegoLogThreadPool(pDBMng);
pLogPool->start(0);
}
@@ -1051,13 +1061,17 @@
pTabMng->setActiveUser(tableSet, user, password);
pTabMng->setThreadId(1);
+#ifdef DEBUG
pDBMng->log(modId, Logger::DEBUG, Chain("Starting tableset ") + tableSet + Chain(" ..."));
-
+#endif
+
Host h;
pTabMng->startDistTableSet(tableSet, h.getName(), false);
+#ifdef DEBUG
pDBMng->log(modId, Logger::DEBUG, Chain("Tableset ") + tableSet + Chain(" completed"));
-
+#endif
+
pAction = new CegoAction( pTabMng);
pAction->setTableSet(tableSet);
@@ -1185,7 +1199,7 @@
if ( connectToHost == true )
{
- pDBMng->configureLogger(Logger::DEBUG);
+ pDBMng->configureLogger();
pMedThread->getDbSpec(dbXML, beat.getHostName(), beat.getPortNo(), beat.getUser(), beat.getPasswd());
pDBMng->setXmlDef(dbXML);
}
@@ -1199,8 +1213,10 @@
startTableSet = false;
}
+#ifdef DEBUG
pDBMng->log(modId, Logger::DEBUG, "Initializing page and record locks ...");
-
+#endif
+
CegoLockHandler* pLockHandler = new CegoLockHandler(pDBMng);
if ( pDBMng->isCaseSensitiveMode() )
@@ -1219,16 +1235,32 @@
pLockHandler->initLocks();
+#ifdef DEBUG
pDBMng->log(modId, Logger::DEBUG, "Creating db threadpool ...");
+#endif
+
CegoDbThreadPool* pDbPool = new CegoDbThreadPool(numDbThread.asInteger(), pDBMng);
+
+#ifdef DEBUG
pDBMng->log(modId, Logger::DEBUG, "Sync db pool to ready ...");
+#endif
+
pDbPool->syncToReady();
+
+#ifdef DEBUG
pDBMng->log(modId, Logger::DEBUG, "DB Pool is ready");
-
+#endif
+
+#ifdef DEBUG
pDBMng->log(modId, Logger::DEBUG, "Creating log threadpool ...");
+#endif
+
CegoLogThreadPool* pLogPool = new CegoLogThreadPool(numLogThread.asInteger(), pDBMng);
-
+
+#ifdef DEBUG
pDBMng->log(modId, Logger::DEBUG, "Creating admin threadpool ...");
+#endif
+
CegoAdminThreadPool *pAdminPool = new CegoAdminThreadPool(numAdminThread.asInteger(), pDBMng, pDbPool, pLogPool);
pDBMng->setThreadInfo(numDbThread.asInteger(), numAdminThread.asInteger(), numLogThread.asInteger());
@@ -1280,7 +1312,10 @@
while ( pCor )
{
+#ifdef DEBUG
pDBMng->log(modId, Logger::DEBUG, Chain("Correcting tableset ") + *pCor + Chain(" runstate"));
+#endif
+
pDBMng->setTableSetRunState(*pCor, XML_OFFLINE_VALUE);
pCor = corList.Next();
}
@@ -1304,8 +1339,10 @@
Chain secondary = pDBMng->getSecondary(tableSet);
+#ifdef DEBUG
pDBMng->log(modId, Logger::DEBUG, Chain("Starting tableset ") + tableSet);
-
+#endif
+
Chain runState = pDBMng->getTableSetRunState(tableSet);
if ( runState == Chain(XML_DEFINED_VALUE) )
{
@@ -1317,10 +1354,16 @@
if ( forceload )
{
+#ifdef DEBUG
pDBMng->log(modId, Logger::DEBUG, Chain("Forced loading object for ") + tableSet + Chain("..."));
+#endif
+
int tabSetId = pDBMng->getTabSetId(tableSet);
- pDbPool->loadObjects(tabSetId);
+ pDbPool->loadObjects(tabSetId);
+#ifdef DEBUG
pDBMng->log(modId, Logger::DEBUG, Chain("Objects for ") + tableSet + Chain(" loaded"));
+#endif
+
}
@@ -1383,7 +1426,10 @@
Chain *pAct = actList.First();
while ( pAct )
{
+#ifdef DEBUG
pDBMng->log(modId, Logger::DEBUG, Chain("Cleaning tableset ") + *pAct + Chain(" ..."));
+#endif
+
CegoDistManager tabMng(pDBMng);
try
@@ -1410,7 +1456,10 @@
pDBMng->log(modId, Logger::LOGERR, Chain("Main Thread : ") + exep);
}
+#ifdef DEBUG
pDBMng->log(modId, Logger::DEBUG, Chain("Tableset ") + *pAct + Chain(" cleaned"));
+#endif
+
pAct = actList.Next();
}
@@ -1450,15 +1499,34 @@
pDBMng->doc2Xml();
// because admin threads are using dbthreadpool and logthread pool, we hove to terminate admin thread pool first
+#ifdef DEBUG
pDBMng->log(modId, Logger::DEBUG, Chain("Deleting admin threadpool ..."));
+#endif
+
delete pAdminPool;
+
+#ifdef DEBUG
pDBMng->log(modId, Logger::DEBUG, Chain("Deleting log threadpool ..."));
+#endif
+
delete pLogPool;
+
+#ifdef DEBUG
pDBMng->log(modId, Logger::DEBUG, Chain("Deleting db threadpool ..."));
+#endif
+
delete pDbPool;
+
+#ifdef DEBUG
pDBMng->log(modId, Logger::DEBUG, Chain("Deleting beat thread ..."));
+#endif
+
delete pBeatThread;
+
+#ifdef DEBUG
pDBMng->log(modId, Logger::DEBUG, Chain("Deleting med thread ..."));
+#endif
+
delete pMedThread;
pLockHandler->deleteLocks();
@@ -1531,7 +1599,9 @@
unsigned long modId = pDBMng->getModId("CegoMain");
+#ifdef DEBUG
pDBMng->log(modId, Logger::DEBUG, Chain("Processing batchfile ") + batchFileName);
+#endif
while (batchFile.readLine(line, MAXCMDLEN))
{
@@ -1570,8 +1640,10 @@
&& disableDelimiter==false)
{
+#ifdef DEBUG
pDBMng->log(modId, Logger::DEBUG, Chain("Processing command <<<") + cmd + Chain(">>>"));
-
+#endif
+
pAction->cleanUp();
pAction->setCommandChain(cmd);
|
[-]
[+]
|
Changed |
cego-2.12.3.tar.bz2/src/CegoQueryHelper.cc
^
|
@@ -1088,6 +1088,9 @@
if ( dt != NULL_TYPE )
{
+
+ // cout << "ID = " << id << " Encoding value " << pF->getValue().valAsChain() << endl;
+
memcpy( pBuf, &id, sizeof(int));
pBuf += sizeof(int);
@@ -1169,8 +1172,16 @@
int id;
memcpy(&id, pc, sizeof(int));
+ // cout << "Decoding id " << id << endl;
+
+ // cout << "PF Id = " << pF->getId() << endl;
- // cout << "Checking id " << id << endl;
+ while ( pF && id > pF->getId() )
+ {
+ pF = fvl.Next();
+ }
+ if ( pF == 0 )
+ return;
pc += sizeof(int);
@@ -1194,14 +1205,12 @@
CegoTypeConverter tc;
flen = tc.getTypeLen(dt);
}
-
- bool found = false;
-
+
if (pF->getId() == id )
{
pF->getValue().setType(dt);
pF->getValue().setLength(flen);
- pF->setId(id);
+ // pF->setId(id);
if ( flen > 0)
pF->getValue().setValue(pc);
@@ -1210,7 +1219,6 @@
pF->getValue().setLocalCopy(false);
// cout << "Decoded valued " << pF->getValue() << endl;
- found = true;
pF = fvl.Next();
}
|
[-]
[+]
|
Changed |
cego-2.12.3.tar.bz2/src/CegoTableManager.cc
^
|
@@ -1994,8 +1994,10 @@
if (pPred == 0)
{
+#ifdef DEBUG
_pDBMng->log(_modId, Logger::DEBUG, Chain("Updating ") + oe.getTabName() + Chain(" with fulltablescan"));
-
+#endif
+
CegoTableCursor* pTC = new CegoTableCursor(this, tabSetId, oe.getTabName(), true);
try
@@ -2109,8 +2111,10 @@
if ( m == CegoQueryHelper::INAPP )
{
+#ifdef DEBUG
_pDBMng->log(_modId, Logger::DEBUG, Chain("Updating ") + oe.getTabName() + Chain(" with fulltablescan"));
-
+#endif
+
CegoTableCursor* pTC = new CegoTableCursor(this, tabSetId, oe.getTabName(), true);
try
@@ -2162,8 +2166,10 @@
else
{
- _pDBMng->log(_modId, Logger::DEBUG, Chain("Updating ") + oe.getTabName() + Chain(" using AttrCond ") + ac.toChain());
-
+#ifdef DEBUG
+ _pDBMng->log(_modId, Logger::DEBUG, Chain("Updating ") + oe.getTabName() + Chain(" using AttrCond ") + ac.toChain());
+#endif
+
CegoTableCursor *pTC = new CegoTableCursor(this, tabSetId, oe.getTabName(), true);
try
@@ -2179,7 +2185,9 @@
if ( indexMatch == CegoAttrCond::FULL || indexMatch == CegoAttrCond::PART )
virginIndex = pTC->getIndexName();
+#ifdef DEBUG
_pDBMng->log(_modId, Logger::DEBUG, Chain("Virgin index is ") + virginIndex);
+#endif
bool moreTuple;
CegoDataPointer dp;
@@ -2188,13 +2196,17 @@
while ( moreTuple && _isAborted == false )
{
+#ifdef DEBUG
_pDBMng->log(_modId, Logger::DEBUG, Chain("Checking pred for update ..."));
+#endif
pPred->clearAttrCache();
if (_qh.evalPredicate(0, 0, 0, &fl, 0, 1, pPred, pBlock))
{
updCount++;
+#ifdef DEBUG
_pDBMng->log(_modId, Logger::DEBUG, Chain("Updating tuple..."));
+#endif
updateTuple(oe, sysEntry, dp, fl, updList, exprList, idxList, keyList, checkList, virginIndex, pBlock);
moreTuple = pTC->getNext(fl, dp);
}
@@ -2232,7 +2244,9 @@
_pDBMng->bufferUnfix(bp, true, _pLockHandle);
+#ifdef DEBUG
_pDBMng->log(_modId, Logger::DEBUG, Chain("Update finished, updCount = ") + Chain(updCount));
+#endif
// commit update record
@@ -2257,7 +2271,9 @@
CegoProcBlock* pBlock)
{
+#ifdef DEBUG
_pDBMng->log(_modId, Logger::DEBUG, Chain("Updating tuple for ") + oe.getTabName());
+#endif
CegoField* pFV = nfvl.First();
CegoExpr** pExpr = exprList.First();
@@ -2298,11 +2314,15 @@
pUF = fl.Next();
}
+#ifdef DEBUG
_pDBMng->log(_modId, Logger::DEBUG, Chain("Checking integrity ... "));
+#endif
checkIntegrity( oe.getTabSetId(), oe.getTabName(), dp, fl, updSchema);
+#ifdef DEBUG
_pDBMng->log(_modId, Logger::DEBUG, Chain("Integrity ok"));
+#endif
CegoDataPointer ndp;
@@ -2879,7 +2899,9 @@
throw Exception(EXLOC, "Delete aborted by user");
}
+#ifdef DEBUG
_pDBMng->log(_modId, Logger::DEBUG, Chain("Delete finished, delCount = ") + Chain(delCount));
+#endif
// commit delete record
@@ -3005,10 +3027,13 @@
ListT<CegoKeyObject>& keyList,
ListT<CegoCheckObject>& checkList)
{
+#ifdef DEBUG
_pDBMng->log(_modId, Logger::DEBUG, Chain("Start of call dropTable(") + Chain(tabSetId)
+ Chain(",") + tableName
+ Chain(",") + Chain(type) + Chain(")"));
-
+
+#endif
+
getObjectListByTable(tabSetId, tableName, idxList, keyList, checkList, false);
CegoTableObject *pIO = idxList.First();
@@ -3019,7 +3044,10 @@
|| pIO->getType() == CegoObject::PINDEX )
{
+#ifdef DEBUG
_pDBMng->log(_modId, Logger::DEBUG, Chain("Dropping index ") + pIO->getName() + Chain(" ..."));
+#endif
+
removeObject(tabSetId, pIO->getName(), pIO->getType());
// create log entry
@@ -3038,7 +3066,9 @@
CegoKeyObject *pKO = keyList.First();
while ( pKO )
{
+#ifdef DEBUG
_pDBMng->log(_modId, Logger::DEBUG, Chain("Dropping key ") + pKO->getName() + Chain(" ..."));
+#endif
removeObject(tabSetId, pKO->getName(), pKO->getType());
@@ -3057,7 +3087,9 @@
CegoCheckObject *pCO = checkList.First();
while ( pCO )
{
+#ifdef DEBUG
_pDBMng->log(_modId, Logger::DEBUG, Chain("Dropping check ") + pCO->getName() + Chain(" ..."));
+#endif
removeObject(tabSetId, pCO->getName(), pCO->getType());
@@ -3113,7 +3145,10 @@
memcpy(&fileId, pF->getValue().getValue(), sizeof(int));
memcpy(&pageId, (void*)((long)pF->getValue().getValue() + sizeof(int)), sizeof(int));
+#ifdef DEBUG
_pDBMng->log(_modId, Logger::DEBUG, Chain("Releasing blob [") + Chain(fileId) + Chain(",") + Chain(pageId) + Chain("]"));
+#endif
+
releaseBlob(tabSetId, fileId, pageId);
}
pF = fl.Next();
@@ -3129,7 +3164,10 @@
}
}
+#ifdef DEBUG
_pDBMng->log(_modId, Logger::DEBUG, Chain("Dropping table ") + tableName + Chain(" ..."));
+#endif
+
removeObject(tabSetId, tableName, CegoObject::TABLE);
// create log entry
@@ -3142,7 +3180,10 @@
logIt(tabSetId, lr);
+#ifdef DEBUG
_pDBMng->log(_modId, Logger::DEBUG, Chain("End of call dropTable"));
+#endif
+
}
void CegoTableManager::dropIndex(int tabSetId, const Chain& idxName)
|