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 
234  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_):
235  backupName( backupName_ ),
236  restoreObjectsMap( restoreObjectsMap_ ),
237  datasourceName( datasourceName_ ),
238  options( options_ )
239  {
240  }
241 
246  std::string backupName;
247 
289  std::map<std::string, std::string> restoreObjectsMap;
290 
294  std::string datasourceName;
295 
392  std::map<std::string, std::string> options;
393  };
394 } // end namespace gpudb
395 
396 namespace avro
397 {
398  template<> struct codec_traits<gpudb::RestoreBackupRequest>
399  {
400  static void encode(Encoder& e, const gpudb::RestoreBackupRequest& v)
401  {
402  ::avro::encode(e, v.backupName);
403  ::avro::encode(e, v.restoreObjectsMap);
404  ::avro::encode(e, v.datasourceName);
405  ::avro::encode(e, v.options);
406  }
407 
408  static void decode(Decoder& d, gpudb::RestoreBackupRequest& v)
409  {
410  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
411  {
412  const std::vector<size_t> fo = rd->fieldOrder();
413 
414  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
415  {
416  switch (*it)
417  {
418  case 0:
419  ::avro::decode(d, v.backupName);
420  break;
421 
422  case 1:
423  ::avro::decode(d, v.restoreObjectsMap);
424  break;
425 
426  case 2:
427  ::avro::decode(d, v.datasourceName);
428  break;
429 
430  case 3:
431  ::avro::decode(d, v.options);
432  break;
433 
434  default:
435  break;
436  }
437  }
438  }
439  else
440  {
441  ::avro::decode(d, v.backupName);
442  ::avro::decode(d, v.restoreObjectsMap);
443  ::avro::decode(d, v.datasourceName);
444  ::avro::decode(d, v.options);
445  }
446  }
447  };
448 } // end namespace avro
449 
450 namespace gpudb
451 {
458  {
463  backupName(std::string()),
464  backupId(int64_t()),
465  restoredBytes(int64_t()),
466  restoredFiles(int64_t()),
467  restoredRecords(int64_t()),
468  restoredObjects(std::map<std::string, std::string>()),
469  renamedObjects(std::map<std::string, std::string>()),
470  failedObjects(std::map<std::string, std::string>()),
471  info(std::map<std::string, std::string>())
472  {
473  }
474 
478  std::string backupName;
479 
483  int64_t backupId;
484 
488  int64_t restoredBytes;
489 
493  int64_t restoredFiles;
494 
499 
503  std::map<std::string, std::string> restoredObjects;
504 
509  std::map<std::string, std::string> renamedObjects;
510 
514  std::map<std::string, std::string> failedObjects;
515 
519  std::map<std::string, std::string> info;
520  };
521 } // end namespace gpudb
522 
523 namespace avro
524 {
525  template<> struct codec_traits<gpudb::RestoreBackupResponse>
526  {
527  static void encode(Encoder& e, const gpudb::RestoreBackupResponse& v)
528  {
529  ::avro::encode(e, v.backupName);
530  ::avro::encode(e, v.backupId);
531  ::avro::encode(e, v.restoredBytes);
532  ::avro::encode(e, v.restoredFiles);
533  ::avro::encode(e, v.restoredRecords);
534  ::avro::encode(e, v.restoredObjects);
535  ::avro::encode(e, v.renamedObjects);
536  ::avro::encode(e, v.failedObjects);
537  ::avro::encode(e, v.info);
538  }
539 
540  static void decode(Decoder& d, gpudb::RestoreBackupResponse& v)
541  {
542  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
543  {
544  const std::vector<size_t> fo = rd->fieldOrder();
545 
546  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
547  {
548  switch (*it)
549  {
550  case 0:
551  ::avro::decode(d, v.backupName);
552  break;
553 
554  case 1:
555  ::avro::decode(d, v.backupId);
556  break;
557 
558  case 2:
559  ::avro::decode(d, v.restoredBytes);
560  break;
561 
562  case 3:
563  ::avro::decode(d, v.restoredFiles);
564  break;
565 
566  case 4:
567  ::avro::decode(d, v.restoredRecords);
568  break;
569 
570  case 5:
571  ::avro::decode(d, v.restoredObjects);
572  break;
573 
574  case 6:
575  ::avro::decode(d, v.renamedObjects);
576  break;
577 
578  case 7:
579  ::avro::decode(d, v.failedObjects);
580  break;
581 
582  case 8:
583  ::avro::decode(d, v.info);
584  break;
585 
586  default:
587  break;
588  }
589  }
590  }
591  else
592  {
593  ::avro::decode(d, v.backupName);
594  ::avro::decode(d, v.backupId);
595  ::avro::decode(d, v.restoredBytes);
596  ::avro::decode(d, v.restoredFiles);
597  ::avro::decode(d, v.restoredRecords);
598  ::avro::decode(d, v.restoredObjects);
599  ::avro::decode(d, v.renamedObjects);
600  ::avro::decode(d, v.failedObjects);
601  ::avro::decode(d, v.info);
602  }
603  }
604  };
605 } // end namespace avro
606 
607 #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.