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 
289  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_):
290  backupName( backupName_ ),
291  restoreObjectsMap( restoreObjectsMap_ ),
292  datasourceName( datasourceName_ ),
293  options( options_ )
294  {
295  }
296 
301  std::string backupName;
302 
362  std::map<std::string, std::string> restoreObjectsMap;
363 
367  std::string datasourceName;
368 
478  std::map<std::string, std::string> options;
479  };
480 } // end namespace gpudb
481 
482 namespace avro
483 {
484  template<> struct codec_traits<gpudb::RestoreBackupRequest>
485  {
486  static void encode(Encoder& e, const gpudb::RestoreBackupRequest& v)
487  {
488  ::avro::encode(e, v.backupName);
489  ::avro::encode(e, v.restoreObjectsMap);
490  ::avro::encode(e, v.datasourceName);
491  ::avro::encode(e, v.options);
492  }
493 
494  static void decode(Decoder& d, gpudb::RestoreBackupRequest& v)
495  {
496  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
497  {
498  const std::vector<size_t> fo = rd->fieldOrder();
499 
500  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
501  {
502  switch (*it)
503  {
504  case 0:
505  ::avro::decode(d, v.backupName);
506  break;
507 
508  case 1:
509  ::avro::decode(d, v.restoreObjectsMap);
510  break;
511 
512  case 2:
513  ::avro::decode(d, v.datasourceName);
514  break;
515 
516  case 3:
517  ::avro::decode(d, v.options);
518  break;
519 
520  default:
521  break;
522  }
523  }
524  }
525  else
526  {
527  ::avro::decode(d, v.backupName);
528  ::avro::decode(d, v.restoreObjectsMap);
529  ::avro::decode(d, v.datasourceName);
530  ::avro::decode(d, v.options);
531  }
532  }
533  };
534 } // end namespace avro
535 
536 namespace gpudb
537 {
544  {
549  backupName(std::string()),
550  backupId(int64_t()),
551  restoredBytes(int64_t()),
552  restoredFiles(int64_t()),
553  restoredRecords(int64_t()),
554  restoredObjects(std::map<std::string, std::string>()),
555  renamedObjects(std::map<std::string, std::string>()),
556  failedObjects(std::map<std::string, std::string>()),
557  info(std::map<std::string, std::string>())
558  {
559  }
560 
564  std::string backupName;
565 
569  int64_t backupId;
570 
574  int64_t restoredBytes;
575 
579  int64_t restoredFiles;
580 
585 
590  std::map<std::string, std::string> restoredObjects;
591 
596  std::map<std::string, std::string> renamedObjects;
597 
602  std::map<std::string, std::string> failedObjects;
603 
607  std::map<std::string, std::string> info;
608  };
609 } // end namespace gpudb
610 
611 namespace avro
612 {
613  template<> struct codec_traits<gpudb::RestoreBackupResponse>
614  {
615  static void encode(Encoder& e, const gpudb::RestoreBackupResponse& v)
616  {
617  ::avro::encode(e, v.backupName);
618  ::avro::encode(e, v.backupId);
619  ::avro::encode(e, v.restoredBytes);
620  ::avro::encode(e, v.restoredFiles);
621  ::avro::encode(e, v.restoredRecords);
622  ::avro::encode(e, v.restoredObjects);
623  ::avro::encode(e, v.renamedObjects);
624  ::avro::encode(e, v.failedObjects);
625  ::avro::encode(e, v.info);
626  }
627 
628  static void decode(Decoder& d, gpudb::RestoreBackupResponse& v)
629  {
630  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
631  {
632  const std::vector<size_t> fo = rd->fieldOrder();
633 
634  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
635  {
636  switch (*it)
637  {
638  case 0:
639  ::avro::decode(d, v.backupName);
640  break;
641 
642  case 1:
643  ::avro::decode(d, v.backupId);
644  break;
645 
646  case 2:
647  ::avro::decode(d, v.restoredBytes);
648  break;
649 
650  case 3:
651  ::avro::decode(d, v.restoredFiles);
652  break;
653 
654  case 4:
655  ::avro::decode(d, v.restoredRecords);
656  break;
657 
658  case 5:
659  ::avro::decode(d, v.restoredObjects);
660  break;
661 
662  case 6:
663  ::avro::decode(d, v.renamedObjects);
664  break;
665 
666  case 7:
667  ::avro::decode(d, v.failedObjects);
668  break;
669 
670  case 8:
671  ::avro::decode(d, v.info);
672  break;
673 
674  default:
675  break;
676  }
677  }
678  }
679  else
680  {
681  ::avro::decode(d, v.backupName);
682  ::avro::decode(d, v.backupId);
683  ::avro::decode(d, v.restoredBytes);
684  ::avro::decode(d, v.restoredFiles);
685  ::avro::decode(d, v.restoredRecords);
686  ::avro::decode(d, v.restoredObjects);
687  ::avro::decode(d, v.renamedObjects);
688  ::avro::decode(d, v.failedObjects);
689  ::avro::decode(d, v.info);
690  }
691  }
692  };
693 } // end namespace avro
694 
695 #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.