/** * Captures the state of the database in the latest backup along with * application specific metadata. * * @param db The database to backup * @param metadata Application metadata * @param flushBeforeBackup When true, the Backup Engine will first issue a * memtable flush and only then copy the DB files to * the backup directory. Doing so will prevent log * files from being copied to the backup directory * (since flush will delete them). * When false, the Backup Engine will not issue a * flush before starting the backup. In that case, * the backup will also include log files * corresponding to live memtables. The backup will * always be consistent with the current state of the * database regardless of the flushBeforeBackup * parameter. * * Note - This method is not thread safe * * @throws RocksDBException thrown if a new backup could not be created */ public void createNewBackupWithMetadata(final RocksDB db, final String metadata, final boolean flushBeforeBackup) throws RocksDBException { assert (isOwningHandle()); createNewBackupWithMetadata(nativeHandle_, db.nativeHandle_, metadata, flushBeforeBackup); }