GPUdb C++ API  Version 7.2.3.0
restore_backup.h
Go to the documentation of this file.
1 /*
2  * This file was autogenerated by the Kinetica schema processor.
3  *
4  * DO NOT EDIT DIRECTLY.
5  */
6 #ifndef __RESTORE_BACKUP_H__
7 #define __RESTORE_BACKUP_H__
8 
9 namespace gpudb
10 {
20  {
25  backupName(std::string()),
26  restoreObjectsMap(std::map<std::string, std::string>()),
27  datasourceName(std::string()),
28  options(std::map<std::string, std::string>())
29  {
30  }
31 
216  RestoreBackupRequest(const std::string& backupName_, const std::map<std::string, std::string>& restoreObjectsMap_, const std::string& datasourceName_, const std::map<std::string, std::string>& options_):
217  backupName( backupName_ ),
218  restoreObjectsMap( restoreObjectsMap_ ),
219  datasourceName( datasourceName_ ),
220  options( options_ )
221  {
222  }
223 
228  std::string backupName;
229 
271  std::map<std::string, std::string> restoreObjectsMap;
272 
276  std::string datasourceName;
277 
360  std::map<std::string, std::string> options;
361  };
362 } // end namespace gpudb
363 
364 namespace avro
365 {
366  template<> struct codec_traits<gpudb::RestoreBackupRequest>
367  {
368  static void encode(Encoder& e, const gpudb::RestoreBackupRequest& v)
369  {
370  ::avro::encode(e, v.backupName);
371  ::avro::encode(e, v.restoreObjectsMap);
372  ::avro::encode(e, v.datasourceName);
373  ::avro::encode(e, v.options);
374  }
375 
376  static void decode(Decoder& d, gpudb::RestoreBackupRequest& v)
377  {
378  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
379  {
380  const std::vector<size_t> fo = rd->fieldOrder();
381 
382  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
383  {
384  switch (*it)
385  {
386  case 0:
387  ::avro::decode(d, v.backupName);
388  break;
389 
390  case 1:
391  ::avro::decode(d, v.restoreObjectsMap);
392  break;
393 
394  case 2:
395  ::avro::decode(d, v.datasourceName);
396  break;
397 
398  case 3:
399  ::avro::decode(d, v.options);
400  break;
401 
402  default:
403  break;
404  }
405  }
406  }
407  else
408  {
409  ::avro::decode(d, v.backupName);
410  ::avro::decode(d, v.restoreObjectsMap);
411  ::avro::decode(d, v.datasourceName);
412  ::avro::decode(d, v.options);
413  }
414  }
415  };
416 } // end namespace avro
417 
418 namespace gpudb
419 {
426  {
431  backupName(std::string()),
432  backupId(int64_t()),
433  restoredBytes(int64_t()),
434  restoredFiles(int64_t()),
435  restoredRecords(int64_t()),
436  restoredObjects(std::map<std::string, std::string>()),
437  renamedObjects(std::map<std::string, std::string>()),
438  failedObjects(std::map<std::string, std::string>()),
439  info(std::map<std::string, std::string>())
440  {
441  }
442 
446  std::string backupName;
447 
451  int64_t backupId;
452 
456  int64_t restoredBytes;
457 
461  int64_t restoredFiles;
462 
467 
471  std::map<std::string, std::string> restoredObjects;
472 
477  std::map<std::string, std::string> renamedObjects;
478 
482  std::map<std::string, std::string> failedObjects;
483 
487  std::map<std::string, std::string> info;
488  };
489 } // end namespace gpudb
490 
491 namespace avro
492 {
493  template<> struct codec_traits<gpudb::RestoreBackupResponse>
494  {
495  static void encode(Encoder& e, const gpudb::RestoreBackupResponse& v)
496  {
497  ::avro::encode(e, v.backupName);
498  ::avro::encode(e, v.backupId);
499  ::avro::encode(e, v.restoredBytes);
500  ::avro::encode(e, v.restoredFiles);
501  ::avro::encode(e, v.restoredRecords);
502  ::avro::encode(e, v.restoredObjects);
503  ::avro::encode(e, v.renamedObjects);
504  ::avro::encode(e, v.failedObjects);
505  ::avro::encode(e, v.info);
506  }
507 
508  static void decode(Decoder& d, gpudb::RestoreBackupResponse& v)
509  {
510  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
511  {
512  const std::vector<size_t> fo = rd->fieldOrder();
513 
514  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
515  {
516  switch (*it)
517  {
518  case 0:
519  ::avro::decode(d, v.backupName);
520  break;
521 
522  case 1:
523  ::avro::decode(d, v.backupId);
524  break;
525 
526  case 2:
527  ::avro::decode(d, v.restoredBytes);
528  break;
529 
530  case 3:
531  ::avro::decode(d, v.restoredFiles);
532  break;
533 
534  case 4:
535  ::avro::decode(d, v.restoredRecords);
536  break;
537 
538  case 5:
539  ::avro::decode(d, v.restoredObjects);
540  break;
541 
542  case 6:
543  ::avro::decode(d, v.renamedObjects);
544  break;
545 
546  case 7:
547  ::avro::decode(d, v.failedObjects);
548  break;
549 
550  case 8:
551  ::avro::decode(d, v.info);
552  break;
553 
554  default:
555  break;
556  }
557  }
558  }
559  else
560  {
561  ::avro::decode(d, v.backupName);
562  ::avro::decode(d, v.backupId);
563  ::avro::decode(d, v.restoredBytes);
564  ::avro::decode(d, v.restoredFiles);
565  ::avro::decode(d, v.restoredRecords);
566  ::avro::decode(d, v.restoredObjects);
567  ::avro::decode(d, v.renamedObjects);
568  ::avro::decode(d, v.failedObjects);
569  ::avro::decode(d, v.info);
570  }
571  }
572  };
573 } // end namespace avro
574 
575 #endif // __RESTORE_BACKUP_H__
std::map< std::string, std::string > restoredObjects
Objects that were successfully restored and their associated types.
A set of results returned by GPUdb::restoreBackup.
int64_t restoredFiles
Total number of files restored from backup.
A set of parameters for GPUdb::restoreBackup.
std::string backupName
Name of the backup object, which must refer to a currently existing backup.
int64_t restoredRecords
Total number of records restored from backup.
std::string datasourceName
Datasource where backup is located.
std::map< std::string, std::string > renamedObjects
Original and new names of objects that were successfully restored and their associated types.
int64_t backupId
The backup ID that was restored.
std::map< std::string, std::string > failedObjects
Objects that failed to be restored and their associated types.
RestoreBackupRequest(const std::string &backupName_, const std::map< std::string, std::string > &restoreObjectsMap_, const std::string &datasourceName_, const std::map< std::string, std::string > &options_)
Constructs a RestoreBackupRequest object with the specified parameters.
RestoreBackupResponse()
Constructs a RestoreBackupResponse object with default parameters.
int64_t restoredBytes
Total size of data restored from backup.
std::map< std::string, std::string > info
Additional information.
std::string backupName
The backup name.
std::map< std::string, std::string > options
Optional parameters.
RestoreBackupRequest()
Constructs a RestoreBackupRequest object with default parameters.
std::map< std::string, std::string > restoreObjectsMap
Map of objects to be restored from the backup.