1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

Reformat all code to coding standard

This commit is contained in:
Andrew Hutchings
2017-10-26 17:18:17 +01:00
parent 4985f3456e
commit 01446d1e22
1296 changed files with 403852 additions and 353747 deletions

View File

@ -66,36 +66,39 @@ namespace fs = boost::filesystem;
namespace
{
DistributedEngineComm *Dec;
DistributedEngineComm* Dec;
void setupCwd()
{
string workdir = config::Config::makeConfig()->getConfig("SystemConfig", "WorkingDir");
if (workdir.length() == 0)
workdir = ".";
(void)chdir(workdir.c_str());
if (access(".", W_OK) != 0)
(void)chdir("/tmp");
}
void setupCwd()
{
string workdir = config::Config::makeConfig()->getConfig("SystemConfig", "WorkingDir");
void added_a_pm(int)
{
LoggingID logid(23, 0, 0);
logging::Message::Args args1;
logging::Message msg(1);
args1.add("DDLProc caught SIGHUP. Resetting connections");
msg.format( args1 );
logging::Logger logger(logid.fSubsysID);
logger.logMessage(LOG_TYPE_DEBUG, msg, logid);
Dec->Setup();
}
if (workdir.length() == 0)
workdir = ".";
(void)chdir(workdir.c_str());
if (access(".", W_OK) != 0)
(void)chdir("/tmp");
}
void added_a_pm(int)
{
LoggingID logid(23, 0, 0);
logging::Message::Args args1;
logging::Message msg(1);
args1.add("DDLProc caught SIGHUP. Resetting connections");
msg.format( args1 );
logging::Logger logger(logid.fSubsysID);
logger.logMessage(LOG_TYPE_DEBUG, msg, logid);
Dec->Setup();
}
}
int main(int argc, char* argv[])
{
// get and set locale language
string systemLang = "C";
systemLang = funcexp::utf8::idb_setlocale();
string systemLang = "C";
systemLang = funcexp::utf8::idb_setlocale();
setupCwd();
@ -106,22 +109,23 @@ int main(int argc, char* argv[])
idbdatafile::IDBPolicy::configIDBPolicy();
#endif
ResourceManager *rm = ResourceManager::instance();
Dec = DistributedEngineComm::instance(rm);
ResourceManager* rm = ResourceManager::instance();
Dec = DistributedEngineComm::instance(rm);
#ifndef _MSC_VER
/* set up some signal handlers */
/* set up some signal handlers */
struct sigaction ign;
memset(&ign, 0, sizeof(ign));
ign.sa_handler = added_a_pm;
sigaction(SIGHUP, &ign, 0);
ign.sa_handler = SIG_IGN;
sigaction(SIGPIPE, &ign, 0);
sigaction(SIGHUP, &ign, 0);
ign.sa_handler = SIG_IGN;
sigaction(SIGPIPE, &ign, 0);
#endif
ddlprocessor::DDLProcessor ddlprocessor(1, 20);
{
Oam oam;
try
{
oam.processInitComplete("DDLProc", ACTIVE);
@ -154,6 +158,7 @@ int main(int argc, char* argv[])
args.add("receiving DDLPackage");
message.format( args );
}
return 0;
}
// vim:ts=4 sw=4:

File diff suppressed because it is too large Load Diff

View File

@ -39,30 +39,42 @@ public:
/** @brief ctor
*
* @param packageMaxThreads the maximum number of threads to process ddl packages
* @param packageWorkQueueSize the maximum number of ddl packages in the work queue
* @param packageWorkQueueSize the maximum number of ddl packages in the work queue
*/
DDLProcessor( int packageMaxThreads, int packageWorkQueueSize );
~DDLProcessor();
~DDLProcessor();
/** @brief entry point for the DDLProcessor
*/
void process();
int commitTransaction(uint32_t txnID, std::string & errorMsg);
int commitTransaction(uint32_t txnID, std::string& errorMsg);
/** @brief get the ddl package thread pool size
*/
inline int getPackageThreadPoolSize() const { return fPackageMaxThreads; }
inline int getPackageThreadPoolSize() const
{
return fPackageMaxThreads;
}
/** @brief set the ddl package thread pool size
*/
inline void setPackageThreadPoolSize( int threadPoolSize ) { fPackageMaxThreads = threadPoolSize; }
inline void setPackageThreadPoolSize( int threadPoolSize )
{
fPackageMaxThreads = threadPoolSize;
}
/** @brief get the maximum number of ddl packages allowed in the work queue
*/
inline int getPackageWorkQueueSize() const { return fPackageWorkQueueSize; }
inline int getPackageWorkQueueSize() const
{
return fPackageWorkQueueSize;
}
/** @brief set the maximum number of ddl packages allowed in the work queue
*/
inline void setPackageWorkQueueSize( int workQueueSize ) { fPackageWorkQueueSize = workQueueSize; }
inline void setPackageWorkQueueSize( int workQueueSize )
{
fPackageWorkQueueSize = workQueueSize;
}
protected:

View File

@ -1,14 +1,14 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by DDLProc.rc
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 101
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1001
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by DDLProc.rc
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 101
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1001
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

View File

@ -43,32 +43,33 @@ using namespace messageqcpp;
void sendOne(string sqlfile)
{
MessageQueueClient ddlproc("DDLProc");
ByteStream obs,ibs;
ByteStream::byte status;
MessageQueueClient ddlproc("DDLProc");
ByteStream obs, ibs;
ByteStream::byte status;
SqlFileParser p;
p.Parse(sqlfile);
assert(p.Good());
const ParseTree& stmts = p.GetParseTree();
SqlStatement* stmt = stmts[0];
assert(stmt);
SqlFileParser p;
p.Parse(sqlfile);
assert(p.Good());
stmt->serialize(obs);
ddlproc.write(obs);
const ParseTree& stmts = p.GetParseTree();
SqlStatement* stmt = stmts[0];
assert(stmt);
ibs = ddlproc.read();
stmt->serialize(obs);
ddlproc.write(obs);
cout << "bs: " << ibs.length() << endl;
ibs = ddlproc.read();
if (ibs.length() > 0) {
ibs >> status;
cout << "status: " << (int)status << endl;
}
cout << "Bye" << endl;
cout << "bs: " << ibs.length() << endl;
if (ibs.length() > 0)
{
ibs >> status;
cout << "status: " << (int)status << endl;
}
cout << "Bye" << endl;
}
// ../dbcon/ddlpackage/sql/atac01.sql
@ -108,21 +109,22 @@ void sendOne(string sqlfile)
int main(int argc, char* argv[])
{
string sqlfile;
string sqlfile;
po::options_description desc ("Allowed options");
desc.add_options ()
("help", "produce help message")
("sql", po::value < string > (), "sql file");
po::variables_map vm;
po::store (po::parse_command_line (argc, argv, desc), vm);
po::notify (vm);
po::options_description desc ("Allowed options");
desc.add_options ()
("help", "produce help message")
("sql", po::value < string > (), "sql file");
po::variables_map vm;
po::store (po::parse_command_line (argc, argv, desc), vm);
po::notify (vm);
if (vm.count ("sql"))
{
sqlfile = vm["sql"].as <string> ();
sendOne(sqlfile);
return 0;
}
if (vm.count ("sql")) {
sqlfile = vm["sql"].as <string> ();
sendOne(sqlfile);
return 0;
}
}