1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

clang format apply

This commit is contained in:
Leonid Fedorov
2022-01-21 16:43:49 +00:00
parent 6b6411229f
commit 04752ec546
1376 changed files with 393460 additions and 412662 deletions

View File

@ -3,7 +3,6 @@
#include "dbrm.h"
#include "IDBPolicy.h"
using namespace std;
using namespace BRM;
@ -20,173 +19,134 @@ DBRM dbrm;
void doStartSeq()
{
try
{
dbrm.startAISequence(12345, 67890, 1, execplan::CalpontSystemCatalog::INT);
}
catch (exception& e)
{
cout << "got exception: " << e.what() << endl;
exit(1);
}
try
{
dbrm.startAISequence(12345, 67890, 1, execplan::CalpontSystemCatalog::INT);
}
catch (exception& e)
{
cout << "got exception: " << e.what() << endl;
exit(1);
}
cout << "OK.\n";
cout << "OK.\n";
}
void doGetRange()
{
uint64_t firstNum;
bool ret;
uint64_t firstNum;
bool ret;
try
{
ret = dbrm.getAIRange(12345, 110000, &firstNum);
}
catch (exception& e)
{
cout << "got exception: " << e.what() << endl;
exit(1);
}
try
{
ret = dbrm.getAIRange(12345, 110000, &firstNum);
}
catch (exception& e)
{
cout << "got exception: " << e.what() << endl;
exit(1);
}
if (!ret)
cout << "getAIRange failed\n";
else
cout << "got firstNum " << firstNum << endl;
if (!ret)
cout << "getAIRange failed\n";
else
cout << "got firstNum " << firstNum << endl;
}
void doGetValue()
{
uint64_t val;
bool ret;
uint64_t val;
bool ret;
try
{
ret = dbrm.getAIValue(12345, &val);
}
catch (exception& e)
{
cout << "got exception: " << e.what() << endl;
exit(1);
}
try
{
ret = dbrm.getAIValue(12345, &val);
}
catch (exception& e)
{
cout << "got exception: " << e.what() << endl;
exit(1);
}
if (!ret)
cout << "getAIValue failed\n";
else
cout << "got val " << val << endl;
if (!ret)
cout << "getAIValue failed\n";
else
cout << "got val " << val << endl;
}
void doReset()
{
try
{
dbrm.resetAISequence(12345, 11111);
}
catch (exception& e)
{
cout << "got exception: " << e.what() << endl;
exit(1);
}
try
{
dbrm.resetAISequence(12345, 11111);
}
catch (exception& e)
{
cout << "got exception: " << e.what() << endl;
exit(1);
}
cout << "OK.\n";
cout << "OK.\n";
}
void doLock()
{
try
{
dbrm.getAILock(12345);
}
catch (exception& e)
{
cout << "got exception: " << e.what() << endl;
exit(1);
}
try
{
dbrm.getAILock(12345);
}
catch (exception& e)
{
cout << "got exception: " << e.what() << endl;
exit(1);
}
cout << "OK.\n";
cout << "OK.\n";
}
void doUnlock()
{
try
{
dbrm.releaseAILock(12345);
}
catch (exception& e)
{
cout << "got exception: " << e.what() << endl;
exit(1);
}
try
{
dbrm.releaseAILock(12345);
}
catch (exception& e)
{
cout << "got exception: " << e.what() << endl;
exit(1);
}
cout << "OK.\n";
cout << "OK.\n";
}
int main(int argc, char** argv)
{
if (argc < 2)
{
cout << "Usage: " << argv[0] << " s | r | v | R | l | u. Check the code to see what they do. :P\n";
exit(1);
}
if (argc < 2)
{
cout << "Usage: " << argv[0] << " s | r | v | R | l | u. Check the code to see what they do. :P\n";
exit(1);
}
char cmd = argv[1][0];
char cmd = argv[1][0];
idbdatafile::IDBPolicy::configIDBPolicy();
idbdatafile::IDBPolicy::configIDBPolicy();
switch (cmd)
{
case 's': doStartSeq(); break;
switch (cmd)
{
case 's':
doStartSeq();
break;
case 'r': doGetRange(); break;
case 'r':
doGetRange();
break;
case 'v': doGetValue(); break;
case 'v':
doGetValue();
break;
case 'R': doReset(); break;
case 'R':
doReset();
break;
case 'l': doLock(); break;
case 'l':
doLock();
break;
case 'u': doUnlock(); break;
case 'u':
doUnlock();
break;
default:
cout << "Usage: " << argv[0] << " s | r | v | R | l | u. Check the code to see what they do. :P\n";
exit(1);
}
default:
cout << "Usage: " << argv[0] << " s | r | v | R | l | u. Check the code to see what they do. :P\n";
exit(1);
}
}