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 
283  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_):
284  backupName( backupName_ ),
285  restoreObjectsMap( restoreObjectsMap_ ),
286  datasourceName( datasourceName_ ),
287  options( options_ )
288  {
289  }
290 
295  std::string backupName;
296 
356  std::map<std::string, std::string> restoreObjectsMap;
357 
361  std::string datasourceName;
362 
471  std::map<std::string, std::string> options;
472  };
473 } // end namespace gpudb
474 
475 namespace avro
476 {
477  template<> struct codec_traits<gpudb::RestoreBackupRequest>
478  {
479  static void encode(Encoder& e, const gpudb::RestoreBackupRequest& v)
480  {
481  ::avro::encode(e, v.backupName);
482  ::avro::encode(e, v.restoreObjectsMap);
483  ::avro::encode(e, v.datasourceName);
484  ::avro::encode(e, v.options);
485  }
486 
487  static void decode(Decoder& d, gpudb::RestoreBackupRequest& v)
488  {
489  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
490  {
491  const std::vector<size_t> fo = rd->fieldOrder();
492 
493  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
494  {
495  switch (*it)
496  {
497  case 0:
498  ::avro::decode(d, v.backupName);
499  break;
500 
501  case 1:
502  ::avro::decode(d, v.restoreObjectsMap);
503  break;
504 
505  case 2:
506  ::avro::decode(d, v.datasourceName);
507  break;
508 
509  case 3:
510  ::avro::decode(d, v.options);
511  break;
512 
513  default:
514  break;
515  }
516  }
517  }
518  else
519  {
520  ::avro::decode(d, v.backupName);
521  ::avro::decode(d, v.restoreObjectsMap);
522  ::avro::decode(d, v.datasourceName);
523  ::avro::decode(d, v.options);
524  }
525  }
526  };
527 } // end namespace avro
528 
529 namespace gpudb
530 {
537  {
542  backupName(std::string()),
543  backupId(int64_t()),
544  restoredBytes(int64_t()),
545  restoredFiles(int64_t()),
546  restoredRecords(int64_t()),
547  restoredObjects(std::map<std::string, std::string>()),
548  renamedObjects(std::map<std::string, std::string>()),
549  failedObjects(std::map<std::string, std::string>()),
550  info(std::map<std::string, std::string>())
551  {
552  }
553 
557  std::string backupName;
558 
562  int64_t backupId;
563 
567  int64_t restoredBytes;
568 
572  int64_t restoredFiles;
573 
578 
583  std::map<std::string, std::string> restoredObjects;
584 
589  std::map<std::string, std::string> renamedObjects;
590 
595  std::map<std::string, std::string> failedObjects;
596 
600  std::map<std::string, std::string> info;
601  };
602 } // end namespace gpudb
603 
604 namespace avro
605 {
606  template<> struct codec_traits<gpudb::RestoreBackupResponse>
607  {
608  static void encode(Encoder& e, const gpudb::RestoreBackupResponse& v)
609  {
610  ::avro::encode(e, v.backupName);
611  ::avro::encode(e, v.backupId);
612  ::avro::encode(e, v.restoredBytes);
613  ::avro::encode(e, v.restoredFiles);
614  ::avro::encode(e, v.restoredRecords);
615  ::avro::encode(e, v.restoredObjects);
616  ::avro::encode(e, v.renamedObjects);
617  ::avro::encode(e, v.failedObjects);
618  ::avro::encode(e, v.info);
619  }
620 
621  static void decode(Decoder& d, gpudb::RestoreBackupResponse& v)
622  {
623  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
624  {
625  const std::vector<size_t> fo = rd->fieldOrder();
626 
627  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
628  {
629  switch (*it)
630  {
631  case 0:
632  ::avro::decode(d, v.backupName);
633  break;
634 
635  case 1:
636  ::avro::decode(d, v.backupId);
637  break;
638 
639  case 2:
640  ::avro::decode(d, v.restoredBytes);
641  break;
642 
643  case 3:
644  ::avro::decode(d, v.restoredFiles);
645  break;
646 
647  case 4:
648  ::avro::decode(d, v.restoredRecords);
649  break;
650 
651  case 5:
652  ::avro::decode(d, v.restoredObjects);
653  break;
654 
655  case 6:
656  ::avro::decode(d, v.renamedObjects);
657  break;
658 
659  case 7:
660  ::avro::decode(d, v.failedObjects);
661  break;
662 
663  case 8:
664  ::avro::decode(d, v.info);
665  break;
666 
667  default:
668  break;
669  }
670  }
671  }
672  else
673  {
674  ::avro::decode(d, v.backupName);
675  ::avro::decode(d, v.backupId);
676  ::avro::decode(d, v.restoredBytes);
677  ::avro::decode(d, v.restoredFiles);
678  ::avro::decode(d, v.restoredRecords);
679  ::avro::decode(d, v.restoredObjects);
680  ::avro::decode(d, v.renamedObjects);
681  ::avro::decode(d, v.failedObjects);
682  ::avro::decode(d, v.info);
683  }
684  }
685  };
686 } // end namespace avro
687 
688 #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.