本文整理汇总了C++中ndbdictionary::Dictionary::getUndofile方法的典型用法代码示例。如果您正苦于以下问题:C++ Dictionary::getUndofile方法的具体用法?C++ Dictionary::getUndofile怎么用?C++ Dictionary::getUndofile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ndbdictionary::Dictionary
的用法示例。
在下文中一共展示了Dictionary::getUndofile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
int
NDBT_Tables::create_default_tablespace(Ndb* pNdb)
{
NdbDictionary::Dictionary* pDict = pNdb->getDictionary();
int res;
NdbDictionary::LogfileGroup lg = pDict->getLogfileGroup("DEFAULT-LG");
if (strcmp(lg.getName(), "DEFAULT-LG") != 0)
{
lg.setName("DEFAULT-LG");
lg.setUndoBufferSize(8*1024*1024);
res = pDict->createLogfileGroup(lg);
if(res != 0){
g_err << "Failed to create logfilegroup:"
<< endl << pDict->getNdbError() << endl;
return NDBT_FAILED;
}
}
{
NdbDictionary::Undofile uf = pDict->getUndofile(0, "undofile01.dat");
if (strcmp(uf.getPath(), "undofile01.dat") != 0)
{
uf.setPath("undofile01.dat");
uf.setSize(32*1024*1024);
uf.setLogfileGroup("DEFAULT-LG");
res = pDict->createUndofile(uf, true);
if(res != 0){
g_err << "Failed to create undofile:"
<< endl << pDict->getNdbError() << endl;
return NDBT_FAILED;
}
}
}
{
NdbDictionary::Undofile uf = pDict->getUndofile(0, "undofile02.dat");
if (strcmp(uf.getPath(), "undofile02.dat") != 0)
{
uf.setPath("undofile02.dat");
uf.setSize(32*1024*1024);
uf.setLogfileGroup("DEFAULT-LG");
res = pDict->createUndofile(uf, true);
if(res != 0){
g_err << "Failed to create undofile:"
<< endl << pDict->getNdbError() << endl;
return NDBT_FAILED;
}
}
}
NdbDictionary::Tablespace ts = pDict->getTablespace("DEFAULT-TS");
if (strcmp(ts.getName(), "DEFAULT-TS") != 0)
{
ts.setName("DEFAULT-TS");
ts.setExtentSize(1024*1024);
ts.setDefaultLogfileGroup("DEFAULT-LG");
res = pDict->createTablespace(ts);
if(res != 0){
g_err << "Failed to create tablespace:"
<< endl << pDict->getNdbError() << endl;
return NDBT_FAILED;
}
}
{
NdbDictionary::Datafile df = pDict->getDatafile(0, "datafile01.dat");
if (strcmp(df.getPath(), "datafile01.dat") != 0)
{
df.setPath("datafile01.dat");
df.setSize(64*1024*1024);
df.setTablespace("DEFAULT-TS");
res = pDict->createDatafile(df, true);
if(res != 0){
g_err << "Failed to create datafile:"
<< endl << pDict->getNdbError() << endl;
return NDBT_FAILED;
}
}
}
{
NdbDictionary::Datafile df = pDict->getDatafile(0, "datafile02.dat");
if (strcmp(df.getPath(), "datafile02.dat") != 0)
{
df.setPath("datafile02.dat");
df.setSize(64*1024*1024);
df.setTablespace("DEFAULT-TS");
res = pDict->createDatafile(df, true);
if(res != 0){
g_err << "Failed to create datafile:"
<< endl << pDict->getNdbError() << endl;
return NDBT_FAILED;
}
}
}
return NDBT_OK;
//.........这里部分代码省略.........