You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-27 21:01:50 +03:00
Reformat all code to coding standard
This commit is contained in:
@ -21,114 +21,152 @@ DBRM dbrm;
|
||||
void doStartSeq()
|
||||
{
|
||||
|
||||
try {
|
||||
dbrm.startAISequence(12345, 67890, 1, execplan::CalpontSystemCatalog::INT);
|
||||
}
|
||||
catch (exception &e) {
|
||||
cout << "got exception: " << e.what() << endl;
|
||||
exit(1);
|
||||
}
|
||||
cout << "OK.\n";
|
||||
try
|
||||
{
|
||||
dbrm.startAISequence(12345, 67890, 1, execplan::CalpontSystemCatalog::INT);
|
||||
}
|
||||
catch (exception& e)
|
||||
{
|
||||
cout << "got exception: " << e.what() << endl;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
if (!ret)
|
||||
cout << "getAIRange failed\n";
|
||||
else
|
||||
cout << "got firstNum " << firstNum << endl;
|
||||
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;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
if (!ret)
|
||||
cout << "getAIValue failed\n";
|
||||
else
|
||||
cout << "got val " << val << endl;
|
||||
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;
|
||||
}
|
||||
|
||||
void doReset()
|
||||
{
|
||||
|
||||
try {
|
||||
dbrm.resetAISequence(12345, 11111);
|
||||
}
|
||||
catch (exception &e) {
|
||||
cout << "got exception: " << e.what() << endl;
|
||||
exit(1);
|
||||
}
|
||||
cout << "OK.\n";
|
||||
try
|
||||
{
|
||||
dbrm.resetAISequence(12345, 11111);
|
||||
}
|
||||
catch (exception& e)
|
||||
{
|
||||
cout << "got exception: " << e.what() << endl;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
cout << "OK.\n";
|
||||
}
|
||||
|
||||
void doLock()
|
||||
{
|
||||
|
||||
try {
|
||||
dbrm.getAILock(12345);
|
||||
}
|
||||
catch (exception &e) {
|
||||
cout << "got exception: " << e.what() << endl;
|
||||
exit(1);
|
||||
}
|
||||
cout << "OK.\n";
|
||||
try
|
||||
{
|
||||
dbrm.getAILock(12345);
|
||||
}
|
||||
catch (exception& e)
|
||||
{
|
||||
cout << "got exception: " << e.what() << endl;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
cout << "OK.\n";
|
||||
}
|
||||
|
||||
void doUnlock()
|
||||
{
|
||||
|
||||
try {
|
||||
dbrm.releaseAILock(12345);
|
||||
}
|
||||
catch (exception &e) {
|
||||
cout << "got exception: " << e.what() << endl;
|
||||
exit(1);
|
||||
}
|
||||
cout << "OK.\n";
|
||||
try
|
||||
{
|
||||
dbrm.releaseAILock(12345);
|
||||
}
|
||||
catch (exception& e)
|
||||
{
|
||||
cout << "got exception: " << e.what() << endl;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
cout << "OK.\n";
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
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;
|
||||
case 'r': doGetRange(); break;
|
||||
case 'v': doGetValue(); break;
|
||||
case 'R': doReset(); break;
|
||||
case 'l': doLock(); 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);
|
||||
}
|
||||
switch (cmd)
|
||||
{
|
||||
case 's':
|
||||
doStartSeq();
|
||||
break;
|
||||
|
||||
case 'r':
|
||||
doGetRange();
|
||||
break;
|
||||
|
||||
case 'v':
|
||||
doGetValue();
|
||||
break;
|
||||
|
||||
case 'R':
|
||||
doReset();
|
||||
break;
|
||||
|
||||
case 'l':
|
||||
doLock();
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user