/** * Backup rate limiter. Used to control transfer speed for backup. If this is * not null, {@link #backupRateLimit()} is ignored. * * Default: null * * @return The rate limiter in use for the backup */ public RateLimiter backupRateLimiter() { assert(isOwningHandle()); return this.backupRateLimiter; }
/** * Restore rate limiter. Used to control transfer speed during restore. If * this is not null, {@link #restoreRateLimit()} is ignored. * * Default: null * * @return The rate limiter in use during restore */ public RateLimiter restoreRateLimiter() { assert(isOwningHandle()); return this.restoreRateLimiter; }
/** * <p>Return information if log files shall be persisted.</p> * * @return boolean value indicating if log files will be persisted. */ public boolean backupLogFiles() { assert(isOwningHandle()); return backupLogFiles(nativeHandle_); }
/** * Set the logger to use for Backup info and error messages * * @param logger The logger to use for the backup * @return instance of current BackupableDBOptions. */ public BackupableDBOptions setInfoLog(final Logger logger) { assert(isOwningHandle()); setInfoLog(nativeHandle_, logger.nativeHandle_); this.infoLog = logger; return this; }
/** * <p>Return of share files with checksum is active.</p> * * @return boolean value indicating if share files with checksum * is active. */ public boolean shareFilesWithChecksum() { assert(isOwningHandle()); return shareFilesWithChecksum(nativeHandle_); }
/** * <p>Are synchronous backups activated.</p> * * @return boolean value if synchronous backups are configured. */ public boolean sync() { assert(isOwningHandle()); return sync(nativeHandle_); }
/** * <p>Returns the path to the BackupableDB directory.</p> * * @return the path to the BackupableDB directory. */ public String backupDir() { assert(isOwningHandle()); return backupDir(nativeHandle_); }
/** * <p>Share table files between backups.</p> * * @return boolean value indicating if SST files will be shared between * backups. */ public boolean shareTableFiles() { assert(isOwningHandle()); return shareTableFiles(nativeHandle_); }
/** * <p>Returns if old data will be destroyed will performing new backups.</p> * * @return boolean value indicating if old data will be destroyed. */ public boolean destroyOldData() { assert(isOwningHandle()); return destroyOldData(nativeHandle_); }
/** * <p>Return backup rate limit which described the max bytes that can be * transferred in a second during backup.</p> * * @return numerical value describing the backup transfer limit in bytes per * second. */ public long backupRateLimit() { assert(isOwningHandle()); return backupRateLimit(nativeHandle_); }
/** * <p>Return restore rate limit which described the max bytes that can be * transferred in a second during restore.</p> * * @return numerical value describing the restore transfer limit in bytes per * second. */ public long restoreRateLimit() { assert(isOwningHandle()); return restoreRateLimit(nativeHandle_); }
/** * During backup user can get callback every time next * {@link #callbackTriggerIntervalSize()} bytes being copied. * * Default: 4194304 * * @return The interval size for the callback trigger */ public long callbackTriggerIntervalSize() { assert(isOwningHandle()); return callbackTriggerIntervalSize(nativeHandle_); }
/** * Up to this many background threads will copy files for * {@link BackupEngine#createNewBackup(RocksDB, boolean)} and * {@link BackupEngine#restoreDbFromBackup(int, String, String, RestoreOptions)} * * Default: 1 * * @return The maximum number of background threads */ public int maxBackgroundOperations() { assert(isOwningHandle()); return maxBackgroundOperations(nativeHandle_); }
/** * Restore rate limiter. Used to control transfer speed during restore. If * this is not null, {@link #restoreRateLimit()} is ignored. * * Default: null * * @param restoreRateLimiter The rate limiter to use during restore * @return instance of current BackupableDBOptions. */ public BackupableDBOptions setRestoreRateLimiter(final RateLimiter restoreRateLimiter) { assert(isOwningHandle()); setRestoreRateLimiter(nativeHandle_, restoreRateLimiter.nativeHandle_); this.restoreRateLimiter = restoreRateLimiter; return this; }
/** * <p>Set if log files shall be persisted.</p> * * @param backupLogFiles If false, we won't backup log files. This option can * be useful for backing up in-memory databases where log file are * persisted, but table files are in memory. * * <p>Default: true</p> * * @return instance of current BackupableDBOptions. */ public BackupableDBOptions setBackupLogFiles(final boolean backupLogFiles) { assert(isOwningHandle()); setBackupLogFiles(nativeHandle_, backupLogFiles); return this; }
/** * <p>Set if old data will be destroyed.</p> * * @param destroyOldData If true, it will delete whatever backups there are * already. * * <p>Default: false</p> * * @return instance of current BackupableDBOptions. */ public BackupableDBOptions setDestroyOldData(final boolean destroyOldData) { assert(isOwningHandle()); setDestroyOldData(nativeHandle_, destroyOldData); return this; }
/** * Backup rate limiter. Used to control transfer speed for backup. If this is * not null, {@link #backupRateLimit()} is ignored. * * Default: null * * @param backupRateLimiter The rate limiter to use for the backup * @return instance of current BackupableDBOptions. */ public BackupableDBOptions setBackupRateLimiter(final RateLimiter backupRateLimiter) { assert(isOwningHandle()); setBackupRateLimiter(nativeHandle_, backupRateLimiter.nativeHandle_); this.backupRateLimiter = backupRateLimiter; return this; }
/** * <p>Share table files between backups.</p> * * @param shareTableFiles If {@code share_table_files == true}, backup will * assume that table files with same name have the same contents. This * enables incremental backups and avoids unnecessary data copies. If * {@code share_table_files == false}, each backup will be on its own and * will not share any data with other backups. * * <p>Default: true</p> * * @return instance of current BackupableDBOptions. */ public BackupableDBOptions setShareTableFiles(final boolean shareTableFiles) { assert(isOwningHandle()); setShareTableFiles(nativeHandle_, shareTableFiles); return this; }
/** * <p>Only used if share_table_files is set to true. If true, will consider * that backups can come from different databases, hence a sst is not uniquely * identified by its name, but by the triple (file name, crc32, file length) * </p> * * @param shareFilesWithChecksum boolean value indicating if SST files are * stored using the triple (file name, crc32, file length) and not its name. * * <p>Note: this is an experimental option, and you'll need to set it manually * turn it on only if you know what you're doing*</p> * * <p>Default: false</p> * * @return instance of current BackupableDBOptions. */ public BackupableDBOptions setShareFilesWithChecksum( final boolean shareFilesWithChecksum) { assert(isOwningHandle()); setShareFilesWithChecksum(nativeHandle_, shareFilesWithChecksum); return this; }
/** * <p>Set backup rate limit.</p> * * @param backupRateLimit Max bytes that can be transferred in a second during * backup. If 0 or negative, then go as fast as you can. * * <p>Default: 0</p> * * @return instance of current BackupableDBOptions. */ public BackupableDBOptions setBackupRateLimit(long backupRateLimit) { assert(isOwningHandle()); backupRateLimit = (backupRateLimit <= 0) ? 0 : backupRateLimit; setBackupRateLimit(nativeHandle_, backupRateLimit); return this; }