public class BackupableDBOptions extends RocksObject
BackupableDBOptions to control the behavior of a backupable database.
It will be used during the creation of a BackupableDB
.
Note that dispose() must be called before an Options instance become out-of-scope to release the allocated memory in c++.
BackupableDB
nativeHandle_
Constructor and Description |
---|
BackupableDBOptions(java.lang.String path)
BackupableDBOptions constructor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
backupDir()
Returns the path to the BackupableDB directory.
|
boolean |
backupLogFiles()
Return information if log files shall be persisted.
|
long |
backupRateLimit()
Return backup rate limit which described the max bytes that can be transferred in a
second during backup.
|
boolean |
destroyOldData()
Returns if old data will be destroyed will performing new backups.
|
protected void |
disposeInternal()
Release the memory allocated for the current instance
in the c++ side.
|
long |
restoreRateLimit()
Return restore rate limit which described the max bytes that can be transferred in a
second during restore.
|
BackupableDBOptions |
setBackupLogFiles(boolean backupLogFiles)
Set if log files shall be persisted.
|
BackupableDBOptions |
setBackupRateLimit(long backupRateLimit)
Set backup rate limit.
|
BackupableDBOptions |
setDestroyOldData(boolean destroyOldData)
Set if old data will be destroyed.
|
BackupableDBOptions |
setRestoreRateLimit(long restoreRateLimit)
Set restore rate limit.
|
BackupableDBOptions |
setShareFilesWithChecksum(boolean shareFilesWithChecksum)
Only used if share_table_files is set to true.
|
BackupableDBOptions |
setShareTableFiles(boolean shareTableFiles)
Share table files between backups.
|
BackupableDBOptions |
setSync(boolean sync)
Set synchronous backups.
|
boolean |
shareFilesWithChecksum()
Return of share files with checksum is active.
|
boolean |
shareTableFiles()
Share table files between backups.
|
boolean |
sync()
Are synchronous backups activated.
|
disOwnNativeHandle, dispose, finalize, isInitialized, isOwningNativeHandle
public BackupableDBOptions(java.lang.String path)
BackupableDBOptions constructor.
path
- Where to keep the backup files. Has to be different than db name.
Best to set this to db name_ + "/backups"
java.lang.IllegalArgumentException
- if illegal path is used.public java.lang.String backupDir()
Returns the path to the BackupableDB directory.
public BackupableDBOptions setShareTableFiles(boolean shareTableFiles)
Share table files between backups.
shareTableFiles
- If 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 share_table_files == false
,
each backup will be on its own and will not share any data with other backups.
Default: true
public boolean shareTableFiles()
Share table files between backups.
public BackupableDBOptions setSync(boolean sync)
Set synchronous backups.
sync
- If sync == true
, we can guarantee you'll get consistent backup
even on a machine crash/reboot. Backup process is slower with sync enabled.
If sync == false
, we don't guarantee anything on machine reboot.
However,chances are some of the backups are consistent.
Default: true
public boolean sync()
Are synchronous backups activated.
public BackupableDBOptions setDestroyOldData(boolean destroyOldData)
Set if old data will be destroyed.
destroyOldData
- If true, it will delete whatever backups there are already.
Default: false
public boolean destroyOldData()
Returns if old data will be destroyed will performing new backups.
public BackupableDBOptions setBackupLogFiles(boolean backupLogFiles)
Set if log files shall be persisted.
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.
Default: true
public boolean backupLogFiles()
Return information if log files shall be persisted.
public BackupableDBOptions setBackupRateLimit(long backupRateLimit)
Set backup rate limit.
backupRateLimit
- Max bytes that can be transferred in a second during backup.
If 0 or negative, then go as fast as you can.
Default: 0
public long backupRateLimit()
Return backup rate limit which described the max bytes that can be transferred in a second during backup.
public BackupableDBOptions setRestoreRateLimit(long restoreRateLimit)
Set restore rate limit.
restoreRateLimit
- Max bytes that can be transferred in a second during restore.
If 0 or negative, then go as fast as you can.
Default: 0
public long restoreRateLimit()
Return restore rate limit which described the max bytes that can be transferred in a second during restore.
public BackupableDBOptions setShareFilesWithChecksum(boolean shareFilesWithChecksum)
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)
shareFilesWithChecksum
- boolean value indicating if SST files are stored
using the triple (file name, crc32, file length) and not its name.
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*
Default: false
public boolean shareFilesWithChecksum()
Return of share files with checksum is active.
protected void disposeInternal()
disposeInternal
in class RocksObject