1 // Copyright (c) 2011-present, Facebook, Inc.  All rights reserved.
2 //  This source code is licensed under both the GPLv2 (found in the
3 //  COPYING file in the root directory) and Apache 2.0 License
4 //  (found in the LICENSE.Apache file in the root directory).
5 package org.rocksdb;
6 
7 /**
8  * Instances of this class describe a Backup made by
9  * {@link org.rocksdb.BackupEngine}.
10  */
11 public class BackupInfo {
12 
13   /**
14    * Package private constructor used to create instances
15    * of BackupInfo by {@link org.rocksdb.BackupEngine}
16    *
17    * @param backupId id of backup
18    * @param timestamp timestamp of backup
19    * @param size size of backup
20    * @param numberFiles number of files related to this backup.
21    */
BackupInfo(final int backupId, final long timestamp, final long size, final int numberFiles, final String app_metadata)22   BackupInfo(final int backupId, final long timestamp, final long size, final int numberFiles,
23       final String app_metadata) {
24     backupId_ = backupId;
25     timestamp_ = timestamp;
26     size_ = size;
27     numberFiles_ = numberFiles;
28     app_metadata_ = app_metadata;
29   }
30 
31   /**
32    *
33    * @return the backup id.
34    */
backupId()35   public int backupId() {
36     return backupId_;
37   }
38 
39   /**
40    *
41    * @return the timestamp of the backup.
42    */
timestamp()43   public long timestamp() {
44     return timestamp_;
45   }
46 
47   /**
48    *
49    * @return the size of the backup
50    */
size()51   public long size() {
52     return size_;
53   }
54 
55   /**
56    *
57    * @return the number of files of this backup.
58    */
numberFiles()59   public int numberFiles() {
60     return numberFiles_;
61   }
62 
63   /**
64    *
65    * @return the associated application metadata, or null
66    */
appMetadata()67   public String appMetadata() {
68     return app_metadata_;
69   }
70 
71   private int backupId_;
72   private long timestamp_;
73   private long size_;
74   private int numberFiles_;
75   private String app_metadata_;
76 }
77