#include <ndb_global.h>#include <ndb_opts.h>#include <Vector.hpp>#include <ndb_limits.h>#include <NdbTCP.h>#include <NdbMem.h>#include <NdbOut.hpp>#include <NDBT_ReturnCodes.h>#include "consumer_restore.hpp"#include "consumer_printer.hpp"Include dependency graph for restore_main.cpp:

Go to the source code of this file.
Defines | |
| #define | OPT_NDB_NODEGROUP_MAP 'z' |
Functions | |
| static char * | analyse_one_map (char *map_str, uint16 *source, uint16 *dest) |
| static bool | insert_ng_map (NODE_GROUP_MAP *ng_map, uint16 source_ng, uint16 dest_ng) |
| static void | init_nodegroup_map () |
| static bool | analyse_nodegroup_map (const char *ng_map_str, NODE_GROUP_MAP *ng_map) |
| static void | short_usage_sub (void) |
| static void | usage () |
| static my_bool | get_one_option (int optid, const struct my_option *opt __attribute__((unused)), char *argument) |
| bool | readArguments (int *pargc, char ***pargv) |
| void | clearConsumers () |
| static bool | checkSysTable (const TableS *table) |
| static bool | checkSysTable (const RestoreMetaData &metaData, uint i) |
| static void | free_data_callback () |
| static void | exitHandler (int code) |
| int | main (int argc, char **argv) |
Variables | |
| FilteredNdbOut | err |
| FilteredNdbOut | info |
| FilteredNdbOut | debug |
| static int | ga_nodeId = 0 |
| static int | ga_nParallelism = 128 |
| static int | ga_backupId = 0 |
| static bool | ga_dont_ignore_systab_0 = false |
| static Vector< class BackupConsumer * > | g_consumers |
| static const char * | ga_backupPath = "." DIR_SEPARATOR |
| static const char * | opt_nodegroup_map_str = 0 |
| static unsigned | opt_nodegroup_map_len = 0 |
| static NODE_GROUP_MAP | opt_nodegroup_map [MAX_NODE_GROUP_MAPS] |
| NDB_STD_OPTS_VARS | |
| static bool | ga_restore_epoch = false |
| static bool | ga_restore = false |
| static bool | ga_print = false |
| static int | _print = 0 |
| static int | _print_meta = 0 |
| static int | _print_data = 0 |
| static int | _print_log = 0 |
| static int | _restore_data = 0 |
| static int | _restore_meta = 0 |
| static int | _no_restore_disk = 0 |
| BaseString | g_options ("ndb_restore") |
| static struct my_option | my_long_options [] |
| const char * | g_connect_string = 0 |
| #define OPT_NDB_NODEGROUP_MAP 'z' |
| static bool analyse_nodegroup_map | ( | const char * | ng_map_str, | |
| NODE_GROUP_MAP * | ng_map | |||
| ) | [static] |
Definition at line 207 of file restore_main.cpp.
References analyse_one_map(), DBUG_ENTER, DBUG_RETURN, FALSE, insert_ng_map(), and TRUE.
Referenced by get_one_option().
00209 { 00210 uint16 source_ng, dest_ng; 00211 char *local_str= (char*)ng_map_str; 00212 DBUG_ENTER("analyse_nodegroup_map"); 00213 00214 do 00215 { 00216 if (!local_str) 00217 { 00218 DBUG_RETURN(TRUE); 00219 } 00220 local_str= analyse_one_map(local_str, &source_ng, &dest_ng); 00221 if (!local_str) 00222 { 00223 DBUG_RETURN(TRUE); 00224 } 00225 if (insert_ng_map(ng_map, source_ng, dest_ng)) 00226 { 00227 DBUG_RETURN(TRUE); 00228 } 00229 if (!(*local_str)) 00230 break; 00231 } while (TRUE); 00232 DBUG_RETURN(FALSE); 00233 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 127 of file restore_main.cpp.
References DBUG_ENTER, DBUG_RETURN, MAX_NODE_GROUP_MAPS, NULL, strtol(), and UNDEF_NODEGROUP.
Referenced by analyse_nodegroup_map().
00128 { 00129 char *end_ptr; 00130 int number; 00131 DBUG_ENTER("analyse_one_map"); 00132 /* 00133 Search for pattern ( source_ng , dest_ng ) 00134 */ 00135 00136 while (isspace(*map_str)) map_str++; 00137 00138 if (*map_str != '(') 00139 { 00140 DBUG_RETURN(NULL); 00141 } 00142 map_str++; 00143 00144 while (isspace(*map_str)) map_str++; 00145 00146 number= strtol(map_str, &end_ptr, 10); 00147 if (!end_ptr || number < 0 || number >= MAX_NODE_GROUP_MAPS) 00148 { 00149 DBUG_RETURN(NULL); 00150 } 00151 *source= (uint16)number; 00152 map_str= end_ptr; 00153 00154 while (isspace(*map_str)) map_str++; 00155 00156 if (*map_str != ',') 00157 { 00158 DBUG_RETURN(NULL); 00159 } 00160 map_str++; 00161 00162 number= strtol(map_str, &end_ptr, 10); 00163 if (!end_ptr || number < 0 || number >= UNDEF_NODEGROUP) 00164 { 00165 DBUG_RETURN(NULL); 00166 } 00167 *dest= (uint16)number; 00168 map_str= end_ptr; 00169 00170 if (*map_str != ')') 00171 { 00172 DBUG_RETURN(NULL); 00173 } 00174 map_str++; 00175 00176 while (isspace(*map_str)) map_str++; 00177 DBUG_RETURN(map_str); 00178 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static bool checkSysTable | ( | const RestoreMetaData & | metaData, | |
| uint | i | |||
| ) | [inline, static] |
Definition at line 421 of file restore_main.cpp.
References assert, checkSysTable(), and RestoreMetaData::getNoOfTables().
00422 { 00423 assert(i < metaData.getNoOfTables()); 00424 return checkSysTable(metaData[i]); 00425 }
Here is the call graph for this function:

Definition at line 415 of file restore_main.cpp.
References ga_dont_ignore_systab_0, and TableS::getSysTable().
Referenced by checkSysTable(), and main().
00416 { 00417 return ga_dont_ignore_systab_0 || ! table->getSysTable(); 00418 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void clearConsumers | ( | ) |
Definition at line 407 of file restore_main.cpp.
References g_consumers.
Referenced by main().
00408 { 00409 for(Uint32 i= 0; i<g_consumers.size(); i++) 00410 delete g_consumers[i]; 00411 g_consumers.clear(); 00412 }
Here is the caller graph for this function:

| static void exitHandler | ( | int | code | ) | [static] |
Definition at line 435 of file restore_main.cpp.
References abort(), exit, and opt_core.
Referenced by main().
00436 { 00437 NDBT_ProgramExit(code); 00438 if (opt_core) 00439 abort(); 00440 else 00441 exit(code); 00442 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static void free_data_callback | ( | ) | [static] |
Definition at line 428 of file restore_main.cpp.
References g_consumers.
Referenced by main().
00429 { 00430 for(Uint32 i= 0; i < g_consumers.size(); i++) 00431 g_consumers[i]->tuple_free(); 00432 }
Here is the caller graph for this function:

| static my_bool get_one_option | ( | int | optid, | |
| const struct my_option *opt | __attribute__((unused)), | |||
| char * | argument | |||
| ) | [static] |
Definition at line 247 of file restore_main.cpp.
References analyse_nodegroup_map(), exit, ga_backupId, ga_nodeId, info, ndb_std_get_one_option(), opt(), opt_debug, OPT_NDB_NODEGROUP_MAP, opt_nodegroup_map, opt_nodegroup_map_len, and opt_nodegroup_map_str.
00249 { 00250 #ifndef DBUG_OFF 00251 opt_debug= "d:t:O,/tmp/ndb_restore.trace"; 00252 #endif 00253 ndb_std_get_one_option(optid, opt, argument); 00254 switch (optid) { 00255 case 'n': 00256 if (ga_nodeId == 0) 00257 { 00258 printf("Error in --nodeid,-n setting, see --help\n"); 00259 exit(NDBT_ProgramExit(NDBT_WRONGARGS)); 00260 } 00261 info << "Nodeid = " << ga_nodeId << endl; 00262 break; 00263 case 'b': 00264 if (ga_backupId == 0) 00265 { 00266 printf("Error in --backupid,-b setting, see --help\n"); 00267 exit(NDBT_ProgramExit(NDBT_WRONGARGS)); 00268 } 00269 info << "Backup Id = " << ga_backupId << endl; 00270 break; 00271 case OPT_NDB_NODEGROUP_MAP: 00272 /* 00273 This option is used to set a map from nodegroup in original cluster 00274 to nodegroup in new cluster. 00275 */ 00276 opt_nodegroup_map_len= 0; 00277 info << "Analyse node group map" << endl; 00278 if (analyse_nodegroup_map(opt_nodegroup_map_str, 00279 &opt_nodegroup_map[0])) 00280 { 00281 exit(NDBT_ProgramExit(NDBT_WRONGARGS)); 00282 } 00283 break; 00284 } 00285 return 0; 00286 }
Here is the call graph for this function:

| static void init_nodegroup_map | ( | ) | [static] |
Definition at line 194 of file restore_main.cpp.
References MAX_MAPS_PER_NODE_GROUP, MAX_NODE_GROUP_MAPS, opt_nodegroup_map, and UNDEF_NODEGROUP.
Referenced by readArguments().
00195 { 00196 uint i,j; 00197 NODE_GROUP_MAP *ng_map = &opt_nodegroup_map[0]; 00198 00199 for (i = 0; i < MAX_NODE_GROUP_MAPS; i++) 00200 { 00201 ng_map[i].no_maps= 0; 00202 for (j= 0; j < MAX_MAPS_PER_NODE_GROUP; j++) 00203 ng_map[i].map_array[j]= UNDEF_NODEGROUP; 00204 } 00205 }
Here is the caller graph for this function:

| static bool insert_ng_map | ( | NODE_GROUP_MAP * | ng_map, | |
| uint16 | source_ng, | |||
| uint16 | dest_ng | |||
| ) | [static] |
Definition at line 180 of file restore_main.cpp.
References index(), node_group_map::map_array, MAX_MAPS_PER_NODE_GROUP, node_group_map::no_maps, and opt_nodegroup_map_len.
Referenced by analyse_nodegroup_map().
00182 { 00183 uint index= source_ng; 00184 uint ng_index= ng_map[index].no_maps; 00185 00186 opt_nodegroup_map_len++; 00187 if (ng_index >= MAX_MAPS_PER_NODE_GROUP) 00188 return true; 00189 ng_map[index].no_maps++; 00190 ng_map[index].map_array[ng_index]= dest_ng; 00191 return false; 00192 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int main | ( | int | argc, | |
| char ** | argv | |||
| ) |
Definition at line 445 of file restore_main.cpp.
References _no_restore_disk, _print_data, _print_log, _restore_data, _restore_meta, BaseString::appfmt(), buf, checkSysTable(), clearConsumers(), debug, err, exitHandler(), free_data_callback(), g_consumers, g_options, ga_backupId, ga_backupPath, ga_nodeId, ga_nParallelism, ga_print, ga_restore, ga_restore_epoch, BackupFile::getFileHeader(), BackupFile::getFilename(), RestoreLogIterator::getNextLogEntry(), RestoreDataIterator::getNextTuple(), RestoreMetaData::getNoOfObjects(), RestoreMetaData::getNoOfTables(), RestoreMetaData::getObjPtr(), RestoreMetaData::getObjType(), getVersionString(), info, init, RestoreMetaData::loadContent(), LogEntry::m_table, MAKE_VERSION, NDB_INIT, NDB_VERSION, NDB_VERSION_STRING_BUF_SZ, BackupFormat::FileHeader::NdbVersion, opt_connect_str, readArguments(), RestoreDataIterator::readFragmentHeader(), BackupFile::readHeader(), BackupFile::validateFooter(), RestoreDataIterator::validateFragmentFooter(), and version().
00446 { 00447 NDB_INIT(argv[0]); 00448 00449 debug << "Start readArguments" << endl; 00450 if (!readArguments(&argc, &argv)) 00451 { 00452 exitHandler(NDBT_FAILED); 00453 } 00454 00455 g_options.appfmt(" -b %d", ga_backupId); 00456 g_options.appfmt(" -n %d", ga_nodeId); 00457 if (_restore_meta) 00458 g_options.appfmt(" -m"); 00459 if (_restore_data) 00460 g_options.appfmt(" -r"); 00461 if (ga_restore_epoch) 00462 g_options.appfmt(" -e"); 00463 if (_no_restore_disk) 00464 g_options.appfmt(" -d"); 00465 g_options.appfmt(" -p %d", ga_nParallelism); 00466 00467 g_connect_string = opt_connect_str; 00468 00472 debug << "Start restoring meta data" << endl; 00473 RestoreMetaData metaData(ga_backupPath, ga_nodeId, ga_backupId); 00474 if (!metaData.readHeader()) 00475 { 00476 err << "Failed to read " << metaData.getFilename() << endl << endl; 00477 exitHandler(NDBT_FAILED); 00478 } 00479 00480 const BackupFormat::FileHeader & tmp = metaData.getFileHeader(); 00481 const Uint32 version = tmp.NdbVersion; 00482 00483 char buf[NDB_VERSION_STRING_BUF_SZ]; 00484 info << "Ndb version in backup files: " 00485 << getVersionString(version, 0, buf, sizeof(buf)) << endl; 00486 00490 // in these versions there was an error in how replica info was 00491 // stored on disk 00492 if (version >= MAKE_VERSION(5,1,3) && version <= MAKE_VERSION(5,1,9)) 00493 { 00494 err << "Restore program incompatible with backup versions between " 00495 << getVersionString(MAKE_VERSION(5,1,3), 0, buf, sizeof(buf)) 00496 << " and " 00497 << getVersionString(MAKE_VERSION(5,1,9), 0, buf, sizeof(buf)) 00498 << endl; 00499 exitHandler(NDBT_FAILED); 00500 } 00501 00502 if (version > NDB_VERSION) 00503 { 00504 err << "Restore program older than backup version. Not supported. " 00505 << "Use new restore program" << endl; 00506 exitHandler(NDBT_FAILED); 00507 } 00508 00509 debug << "Load content" << endl; 00510 int res = metaData.loadContent(); 00511 00512 if (res == 0) 00513 { 00514 err << "Restore: Failed to load content" << endl; 00515 exitHandler(NDBT_FAILED); 00516 } 00517 debug << "Get no of Tables" << endl; 00518 if (metaData.getNoOfTables() == 0) 00519 { 00520 err << "The backup contains no tables" << endl; 00521 exitHandler(NDBT_FAILED); 00522 } 00523 debug << "Validate Footer" << endl; 00524 00525 if (!metaData.validateFooter()) 00526 { 00527 err << "Restore: Failed to validate footer." << endl; 00528 exitHandler(NDBT_FAILED); 00529 } 00530 debug << "Init Backup objects" << endl; 00531 Uint32 i; 00532 for(i= 0; i < g_consumers.size(); i++) 00533 { 00534 if (!g_consumers[i]->init()) 00535 { 00536 clearConsumers(); 00537 err << "Failed to initialize consumers" << endl; 00538 exitHandler(NDBT_FAILED); 00539 } 00540 00541 } 00542 debug << "Restore objects (tablespaces, ..)" << endl; 00543 for(i = 0; i<metaData.getNoOfObjects(); i++) 00544 { 00545 for(Uint32 j= 0; j < g_consumers.size(); j++) 00546 if (!g_consumers[j]->object(metaData.getObjType(i), 00547 metaData.getObjPtr(i))) 00548 { 00549 err << "Restore: Failed to restore table: "; 00550 err << metaData[i]->getTableName() << " ... Exiting " << endl; 00551 exitHandler(NDBT_FAILED); 00552 } 00553 } 00554 debug << "Restoring tables" << endl; 00555 for(i = 0; i<metaData.getNoOfTables(); i++) 00556 { 00557 if (checkSysTable(metaData, i)) 00558 { 00559 for(Uint32 j= 0; j < g_consumers.size(); j++) 00560 if (!g_consumers[j]->table(* metaData[i])) 00561 { 00562 err << "Restore: Failed to restore table: "; 00563 err << metaData[i]->getTableName() << " ... Exiting " << endl; 00564 exitHandler(NDBT_FAILED); 00565 } 00566 } 00567 } 00568 debug << "Close tables" << endl; 00569 for(i= 0; i < g_consumers.size(); i++) 00570 if (!g_consumers[i]->endOfTables()) 00571 { 00572 err << "Restore: Failed while closing tables" << endl; 00573 exitHandler(NDBT_FAILED); 00574 } 00575 debug << "Iterate over data" << endl; 00576 if (ga_restore || ga_print) 00577 { 00578 if(_restore_data || _print_data) 00579 { 00580 RestoreDataIterator dataIter(metaData, &free_data_callback); 00581 00582 // Read data file header 00583 if (!dataIter.readHeader()) 00584 { 00585 err << "Failed to read header of data file. Exiting..." << endl; 00586 exitHandler(NDBT_FAILED); 00587 } 00588 00589 Uint32 fragmentId; 00590 while (dataIter.readFragmentHeader(res= 0, &fragmentId)) 00591 { 00592 const TupleS* tuple; 00593 while ((tuple = dataIter.getNextTuple(res= 1)) != 0) 00594 { 00595 if (checkSysTable(tuple->getTable())) 00596 for(Uint32 i= 0; i < g_consumers.size(); i++) 00597 g_consumers[i]->tuple(* tuple, fragmentId); 00598 } // while (tuple != NULL); 00599 00600 if (res < 0) 00601 { 00602 err <<" Restore: An error occured while restoring data. Exiting..."; 00603 err << endl; 00604 exitHandler(NDBT_FAILED); 00605 } 00606 if (!dataIter.validateFragmentFooter()) { 00607 err << "Restore: Error validating fragment footer. "; 00608 err << "Exiting..." << endl; 00609 exitHandler(NDBT_FAILED); 00610 } 00611 } // while (dataIter.readFragmentHeader(res)) 00612 00613 if (res < 0) 00614 { 00615 err << "Restore: An error occured while restoring data. Exiting... " 00616 << "res= " << res << endl; 00617 exitHandler(NDBT_FAILED); 00618 } 00619 00620 00621 dataIter.validateFooter(); //not implemented 00622 00623 for (i= 0; i < g_consumers.size(); i++) 00624 g_consumers[i]->endOfTuples(); 00625 } 00626 00627 if(_restore_data || _print_log) 00628 { 00629 RestoreLogIterator logIter(metaData); 00630 if (!logIter.readHeader()) 00631 { 00632 err << "Failed to read header of data file. Exiting..." << endl; 00633 exitHandler(NDBT_FAILED); 00634 } 00635 00636 const LogEntry * logEntry = 0; 00637 while ((logEntry = logIter.getNextLogEntry(res= 0)) != 0) 00638 { 00639 if (checkSysTable(logEntry->m_table)) 00640 for(Uint32 i= 0; i < g_consumers.size(); i++) 00641 g_consumers[i]->logEntry(* logEntry); 00642 } 00643 if (res < 0) 00644 { 00645 err << "Restore: An restoring the data log. Exiting... res=" 00646 << res << endl; 00647 exitHandler(NDBT_FAILED); 00648 } 00649 logIter.validateFooter(); //not implemented 00650 for (i= 0; i < g_consumers.size(); i++) 00651 g_consumers[i]->endOfLogEntrys(); 00652 } 00653 00654 if(_restore_data) 00655 { 00656 for(i = 0; i<metaData.getNoOfTables(); i++) 00657 { 00658 if (checkSysTable(metaData, i)) 00659 { 00660 for(Uint32 j= 0; j < g_consumers.size(); j++) 00661 if (!g_consumers[j]->finalize_table(* metaData[i])) 00662 { 00663 err << "Restore: Failed to finalize restore table: %s. "; 00664 err << "Exiting... " << metaData[i]->getTableName() << endl; 00665 exitHandler(NDBT_FAILED); 00666 } 00667 } 00668 } 00669 } 00670 } 00671 if (ga_restore_epoch) 00672 { 00673 for (i= 0; i < g_consumers.size(); i++) 00674 if (!g_consumers[i]->update_apply_status(metaData)) 00675 { 00676 err << "Restore: Failed to restore epoch" << endl; 00677 return -1; 00678 } 00679 } 00680 00681 clearConsumers(); 00682 return NDBT_ProgramExit(NDBT_OK); 00683 } // main
Here is the call graph for this function:

| bool readArguments | ( | int * | pargc, | |
| char *** | pargv | |||
| ) |
Definition at line 288 of file restore_main.cpp.
References _no_restore_disk, _print, _print_data, _print_log, _print_meta, _restore_data, _restore_meta, debug, exit, g_consumers, ga_backupPath, ga_nParallelism, ga_print, ga_restore, ga_restore_epoch, get_one_option(), handle_options(), info, init_nodegroup_map(), load_default_groups, load_defaults(), BackupRestore::m_no_restore_disk, BackupPrinter::m_print, BackupPrinter::m_print_data, BackupPrinter::m_print_log, BackupPrinter::m_print_meta, BackupRestore::m_restore, BackupRestore::m_restore_epoch, BackupRestore::m_restore_meta, map_nodegroups(), MAX_NODE_GROUP_MAPS, my_long_options, NULL, opt_nodegroup_map, and opt_nodegroup_map_len.
00289 { 00290 Uint32 i; 00291 debug << "Load defaults" << endl; 00292 const char *load_default_groups[]= { "mysql_cluster","ndb_restore",0 }; 00293 00294 init_nodegroup_map(); 00295 load_defaults("my",load_default_groups,pargc,pargv); 00296 debug << "handle_options" << endl; 00297 if (handle_options(pargc, pargv, my_long_options, get_one_option)) 00298 { 00299 exit(NDBT_ProgramExit(NDBT_WRONGARGS)); 00300 } 00301 for (i = 0; i < MAX_NODE_GROUP_MAPS; i++) 00302 opt_nodegroup_map[i].curr_index = 0; 00303 00304 #if 0 00305 /* 00306 Test code written t{ 00307 o verify nodegroup mapping 00308 */ 00309 printf("Handled options successfully\n"); 00310 Uint16 map_ng[16]; 00311 Uint32 j; 00312 for (j = 0; j < 4; j++) 00313 { 00314 for (i = 0; i < 4 ; i++) 00315 map_ng[i] = i; 00316 map_nodegroups(&map_ng[0], (Uint32)4); 00317 for (i = 0; i < 4 ; i++) 00318 printf("NG %u mapped to %u \n", i, map_ng[i]); 00319 } 00320 for (j = 0; j < 4; j++) 00321 { 00322 for (i = 0; i < 8 ; i++) 00323 map_ng[i] = i >> 1; 00324 map_nodegroups(&map_ng[0], (Uint32)8); 00325 for (i = 0; i < 8 ; i++) 00326 printf("NG %u mapped to %u \n", i >> 1, map_ng[i]); 00327 } 00328 exit(NDBT_ProgramExit(NDBT_WRONGARGS)); 00329 #endif 00330 00331 BackupPrinter* printer = new BackupPrinter(opt_nodegroup_map, 00332 opt_nodegroup_map_len); 00333 if (printer == NULL) 00334 return false; 00335 00336 BackupRestore* restore = new BackupRestore(opt_nodegroup_map, 00337 opt_nodegroup_map_len, 00338 ga_nParallelism); 00339 if (restore == NULL) 00340 { 00341 delete printer; 00342 return false; 00343 } 00344 00345 if (_print) 00346 { 00347 ga_print = true; 00348 ga_restore = true; 00349 printer->m_print = true; 00350 } 00351 if (_print_meta) 00352 { 00353 ga_print = true; 00354 printer->m_print_meta = true; 00355 } 00356 if (_print_data) 00357 { 00358 ga_print = true; 00359 printer->m_print_data = true; 00360 } 00361 if (_print_log) 00362 { 00363 ga_print = true; 00364 printer->m_print_log = true; 00365 } 00366 00367 if (_restore_data) 00368 { 00369 ga_restore = true; 00370 restore->m_restore = true; 00371 } 00372 00373 if (_restore_meta) 00374 { 00375 // ga_restore = true; 00376 restore->m_restore_meta = true; 00377 } 00378 00379 if (_no_restore_disk) 00380 { 00381 restore->m_no_restore_disk = true; 00382 } 00383 00384 if (ga_restore_epoch) 00385 { 00386 restore->m_restore_epoch = true; 00387 } 00388 00389 { 00390 BackupConsumer * c = printer; 00391 g_consumers.push_back(c); 00392 } 00393 { 00394 BackupConsumer * c = restore; 00395 g_consumers.push_back(c); 00396 } 00397 // Set backup file path 00398 if (*pargv[0] != NULL) 00399 { 00400 ga_backupPath = *pargv[0]; 00401 } 00402 info << "backup path = " << ga_backupPath << endl; 00403 return true; 00404 }
Here is the call graph for this function:

| static void short_usage_sub | ( | void | ) | [static] |
Definition at line 235 of file restore_main.cpp.
References my_progname.
00236 { 00237 printf("Usage: %s [OPTIONS] [<path to backup files>]\n", my_progname); 00238 }
| static void usage | ( | void | ) | [static] |
Definition at line 239 of file restore_main.cpp.
References my_long_options, my_print_help(), my_print_variables(), ndb_std_print_version(), and short_usage_sub().
00240 { 00241 short_usage_sub(); 00242 ndb_std_print_version(); 00243 my_print_help(my_long_options); 00244 my_print_variables(my_long_options); 00245 }
Here is the call graph for this function:

int _no_restore_disk = 0 [static] |
int _print = 0 [static] |
int _print_data = 0 [static] |
int _print_log = 0 [static] |
int _print_meta = 0 [static] |
int _restore_data = 0 [static] |
int _restore_meta = 0 [static] |
| FilteredNdbOut err |
| const char* g_connect_string = 0 |
Vector<class BackupConsumer *> g_consumers [static] |
Definition at line 37 of file restore_main.cpp.
Referenced by clearConsumers(), free_data_callback(), main(), and readArguments().
| BaseString g_options("ndb_restore") |
Referenced by main().
int ga_backupId = 0 [static] |
const char* ga_backupPath = "." DIR_SEPARATOR [static] |
bool ga_dont_ignore_systab_0 = false [static] |
int ga_nodeId = 0 [static] |
int ga_nParallelism = 128 [static] |
bool ga_restore = false [static] |
bool ga_restore_epoch = false [static] |
print and restore flags
Definition at line 51 of file restore_main.cpp.
Referenced by main(), and readArguments().
| FilteredNdbOut info |
struct my_option my_long_options[] [static] |
Definition at line 63 of file restore_main.cpp.
Definition at line 46 of file restore_main.cpp.
NODE_GROUP_MAP opt_nodegroup_map[MAX_NODE_GROUP_MAPS] [static] |
Definition at line 43 of file restore_main.cpp.
Referenced by get_one_option(), init_nodegroup_map(), and readArguments().
unsigned opt_nodegroup_map_len = 0 [static] |
Definition at line 42 of file restore_main.cpp.
Referenced by get_one_option(), insert_ng_map(), and readArguments().
const char* opt_nodegroup_map_str = 0 [static] |
1.4.7

