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 
323  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_):
324  backupName( backupName_ ),
325  restoreObjectsMap( restoreObjectsMap_ ),
326  datasourceName( datasourceName_ ),
327  options( options_ )
328  {
329  }
330 
335  std::string backupName;
336 
401  std::map<std::string, std::string> restoreObjectsMap;
402 
406  std::string datasourceName;
407 
534  std::map<std::string, std::string> options;
535  };
536 } // end namespace gpudb
537 
538 namespace avro
539 {
540  template<> struct codec_traits<gpudb::RestoreBackupRequest>
541  {
542  static void encode(Encoder& e, const gpudb::RestoreBackupRequest& v)
543  {
544  ::avro::encode(e, v.backupName);
545  ::avro::encode(e, v.restoreObjectsMap);
546  ::avro::encode(e, v.datasourceName);
547  ::avro::encode(e, v.options);
548  }
549 
550  static void decode(Decoder& d, gpudb::RestoreBackupRequest& v)
551  {
552  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
553  {
554  const std::vector<size_t> fo = rd->fieldOrder();
555 
556  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
557  {
558  switch (*it)
559  {
560  case 0:
561  ::avro::decode(d, v.backupName);
562  break;
563 
564  case 1:
565  ::avro::decode(d, v.restoreObjectsMap);
566  break;
567 
568  case 2:
569  ::avro::decode(d, v.datasourceName);
570  break;
571 
572  case 3:
573  ::avro::decode(d, v.options);
574  break;
575 
576  default:
577  break;
578  }
579  }
580  }
581  else
582  {
583  ::avro::decode(d, v.backupName);
584  ::avro::decode(d, v.restoreObjectsMap);
585  ::avro::decode(d, v.datasourceName);
586  ::avro::decode(d, v.options);
587  }
588  }
589  };
590 } // end namespace avro
591 
592 namespace gpudb
593 {
600  {
605  backupName(std::string()),
606  backupId(int64_t()),
607  restoredBytes(int64_t()),
608  restoredFiles(int64_t()),
609  restoredRecords(int64_t()),
610  restoredObjects(std::map<std::string, std::string>()),
611  renamedObjects(std::map<std::string, std::string>()),
612  failedObjects(std::map<std::string, std::string>()),
613  info(std::map<std::string, std::string>())
614  {
615  }
616 
620  std::string backupName;
621 
625  int64_t backupId;
626 
630  int64_t restoredBytes;
631 
635  int64_t restoredFiles;
636 
641 
646  std::map<std::string, std::string> restoredObjects;
647 
652  std::map<std::string, std::string> renamedObjects;
653 
658  std::map<std::string, std::string> failedObjects;
659 
663  std::map<std::string, std::string> info;
664  };
665 } // end namespace gpudb
666 
667 namespace avro
668 {
669  template<> struct codec_traits<gpudb::RestoreBackupResponse>
670  {
671  static void encode(Encoder& e, const gpudb::RestoreBackupResponse& v)
672  {
673  ::avro::encode(e, v.backupName);
674  ::avro::encode(e, v.backupId);
675  ::avro::encode(e, v.restoredBytes);
676  ::avro::encode(e, v.restoredFiles);
677  ::avro::encode(e, v.restoredRecords);
678  ::avro::encode(e, v.restoredObjects);
679  ::avro::encode(e, v.renamedObjects);
680  ::avro::encode(e, v.failedObjects);
681  ::avro::encode(e, v.info);
682  }
683 
684  static void decode(Decoder& d, gpudb::RestoreBackupResponse& v)
685  {
686  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
687  {
688  const std::vector<size_t> fo = rd->fieldOrder();
689 
690  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
691  {
692  switch (*it)
693  {
694  case 0:
695  ::avro::decode(d, v.backupName);
696  break;
697 
698  case 1:
699  ::avro::decode(d, v.backupId);
700  break;
701 
702  case 2:
703  ::avro::decode(d, v.restoredBytes);
704  break;
705 
706  case 3:
707  ::avro::decode(d, v.restoredFiles);
708  break;
709 
710  case 4:
711  ::avro::decode(d, v.restoredRecords);
712  break;
713 
714  case 5:
715  ::avro::decode(d, v.restoredObjects);
716  break;
717 
718  case 6:
719  ::avro::decode(d, v.renamedObjects);
720  break;
721 
722  case 7:
723  ::avro::decode(d, v.failedObjects);
724  break;
725 
726  case 8:
727  ::avro::decode(d, v.info);
728  break;
729 
730  default:
731  break;
732  }
733  }
734  }
735  else
736  {
737  ::avro::decode(d, v.backupName);
738  ::avro::decode(d, v.backupId);
739  ::avro::decode(d, v.restoredBytes);
740  ::avro::decode(d, v.restoredFiles);
741  ::avro::decode(d, v.restoredRecords);
742  ::avro::decode(d, v.restoredObjects);
743  ::avro::decode(d, v.renamedObjects);
744  ::avro::decode(d, v.failedObjects);
745  ::avro::decode(d, v.info);
746  }
747  }
748  };
749 } // end namespace avro
750 
751 #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.