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 {
23  {
28  backupName(std::string()),
29  restoreObjectsMap(std::map<std::string, std::string>()),
30  datasourceName(std::string()),
31  options(std::map<std::string, std::string>())
32  {
33  }
34 
284  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_):
285  backupName( backupName_ ),
286  restoreObjectsMap( restoreObjectsMap_ ),
287  datasourceName( datasourceName_ ),
288  options( options_ )
289  {
290  }
291 
296  std::string backupName;
297 
354  std::map<std::string, std::string> restoreObjectsMap;
355 
359  std::string datasourceName;
360 
470  std::map<std::string, std::string> options;
471  };
472 } // end namespace gpudb
473 
474 namespace avro
475 {
476  template<> struct codec_traits<gpudb::RestoreBackupRequest>
477  {
478  static void encode(Encoder& e, const gpudb::RestoreBackupRequest& v)
479  {
480  ::avro::encode(e, v.backupName);
481  ::avro::encode(e, v.restoreObjectsMap);
482  ::avro::encode(e, v.datasourceName);
483  ::avro::encode(e, v.options);
484  }
485 
486  static void decode(Decoder& d, gpudb::RestoreBackupRequest& v)
487  {
488  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
489  {
490  const std::vector<size_t> fo = rd->fieldOrder();
491 
492  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
493  {
494  switch (*it)
495  {
496  case 0:
497  ::avro::decode(d, v.backupName);
498  break;
499 
500  case 1:
501  ::avro::decode(d, v.restoreObjectsMap);
502  break;
503 
504  case 2:
505  ::avro::decode(d, v.datasourceName);
506  break;
507 
508  case 3:
509  ::avro::decode(d, v.options);
510  break;
511 
512  default:
513  break;
514  }
515  }
516  }
517  else
518  {
519  ::avro::decode(d, v.backupName);
520  ::avro::decode(d, v.restoreObjectsMap);
521  ::avro::decode(d, v.datasourceName);
522  ::avro::decode(d, v.options);
523  }
524  }
525  };
526 } // end namespace avro
527 
528 namespace gpudb
529 {
536  {
541  backupName(std::string()),
542  backupId(int64_t()),
543  restoredBytes(int64_t()),
544  restoredFiles(int64_t()),
545  restoredRecords(int64_t()),
546  restoredObjects(std::map<std::string, std::string>()),
547  renamedObjects(std::map<std::string, std::string>()),
548  failedObjects(std::map<std::string, std::string>()),
549  info(std::map<std::string, std::string>())
550  {
551  }
552 
556  std::string backupName;
557 
561  int64_t backupId;
562 
566  int64_t restoredBytes;
567 
571  int64_t restoredFiles;
572 
577 
582  std::map<std::string, std::string> restoredObjects;
583 
588  std::map<std::string, std::string> renamedObjects;
589 
594  std::map<std::string, std::string> failedObjects;
595 
599  std::map<std::string, std::string> info;
600  };
601 } // end namespace gpudb
602 
603 namespace avro
604 {
605  template<> struct codec_traits<gpudb::RestoreBackupResponse>
606  {
607  static void encode(Encoder& e, const gpudb::RestoreBackupResponse& v)
608  {
609  ::avro::encode(e, v.backupName);
610  ::avro::encode(e, v.backupId);
611  ::avro::encode(e, v.restoredBytes);
612  ::avro::encode(e, v.restoredFiles);
613  ::avro::encode(e, v.restoredRecords);
614  ::avro::encode(e, v.restoredObjects);
615  ::avro::encode(e, v.renamedObjects);
616  ::avro::encode(e, v.failedObjects);
617  ::avro::encode(e, v.info);
618  }
619 
620  static void decode(Decoder& d, gpudb::RestoreBackupResponse& v)
621  {
622  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
623  {
624  const std::vector<size_t> fo = rd->fieldOrder();
625 
626  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
627  {
628  switch (*it)
629  {
630  case 0:
631  ::avro::decode(d, v.backupName);
632  break;
633 
634  case 1:
635  ::avro::decode(d, v.backupId);
636  break;
637 
638  case 2:
639  ::avro::decode(d, v.restoredBytes);
640  break;
641 
642  case 3:
643  ::avro::decode(d, v.restoredFiles);
644  break;
645 
646  case 4:
647  ::avro::decode(d, v.restoredRecords);
648  break;
649 
650  case 5:
651  ::avro::decode(d, v.restoredObjects);
652  break;
653 
654  case 6:
655  ::avro::decode(d, v.renamedObjects);
656  break;
657 
658  case 7:
659  ::avro::decode(d, v.failedObjects);
660  break;
661 
662  case 8:
663  ::avro::decode(d, v.info);
664  break;
665 
666  default:
667  break;
668  }
669  }
670  }
671  else
672  {
673  ::avro::decode(d, v.backupName);
674  ::avro::decode(d, v.backupId);
675  ::avro::decode(d, v.restoredBytes);
676  ::avro::decode(d, v.restoredFiles);
677  ::avro::decode(d, v.restoredRecords);
678  ::avro::decode(d, v.restoredObjects);
679  ::avro::decode(d, v.renamedObjects);
680  ::avro::decode(d, v.failedObjects);
681  ::avro::decode(d, v.info);
682  }
683  }
684  };
685 } // end namespace avro
686 
687 #endif // __RESTORE_BACKUP_H__
std::map< std::string, std::string > restoredObjects
Database 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 to restore from, which must refer to an existing backup.
int64_t restoredRecords
Total number of records restored from backup.
std::string datasourceName
Data source through which the backup will be restored.
std::map< std::string, std::string > renamedObjects
Original and new names of database objects that were successfully restored and their associated types...
int64_t backupId
ID of the snapshot that was restored.
std::map< std::string, std::string > failedObjects
Database 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
Value of backupName.
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 database objects to be restored from the backup.