From 0e7e6f6e4b05350d71f1fa7aee3dde199e014676 Mon Sep 17 00:00:00 2001 From: Adam Retter Date: Sun, 24 Jan 2016 14:04:28 +0000 Subject: [PATCH] Improve Javadoc --- .../org/rocksdb/AbstractCompactionFilter.java | 7 ++++--- java/src/main/java/org/rocksdb/BackupEngine.java | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/java/src/main/java/org/rocksdb/AbstractCompactionFilter.java b/java/src/main/java/org/rocksdb/AbstractCompactionFilter.java index 6853f1d4b..7d3c5bcd9 100644 --- a/java/src/main/java/org/rocksdb/AbstractCompactionFilter.java +++ b/java/src/main/java/org/rocksdb/AbstractCompactionFilter.java @@ -8,7 +8,8 @@ package org.rocksdb; * A CompactionFilter allows an application to modify/delete a key-value at * the time of compaction. * - * At present we just permit an overriding Java class to wrap a C++ implementation + * At present we just permit an overriding Java class to wrap a C++ + * implementation */ public abstract class AbstractCompactionFilter> extends RocksObject { @@ -18,10 +19,10 @@ public abstract class AbstractCompactionFilter> } /** - * Deletes underlying C++ comparator pointer. + * Deletes underlying C++ compaction pointer. * * Note that this function should be called only after all - * RocksDB instances referencing the comparator are closed. + * RocksDB instances referencing the compaction filter are closed. * Otherwise an undefined behavior will occur. */ @Override diff --git a/java/src/main/java/org/rocksdb/BackupEngine.java b/java/src/main/java/org/rocksdb/BackupEngine.java index 776307a74..606c5d951 100644 --- a/java/src/main/java/org/rocksdb/BackupEngine.java +++ b/java/src/main/java/org/rocksdb/BackupEngine.java @@ -30,6 +30,7 @@ public class BackupEngine extends RocksObject implements AutoCloseable { * @param options Any options for the backup engine * * @return A new BackupEngine instance + * @throws RocksDBException thrown if the backup engine could not be opened */ public static BackupEngine open(final Env env, final BackupableDBOptions options) throws RocksDBException { @@ -45,6 +46,8 @@ public class BackupEngine extends RocksObject implements AutoCloseable { * @param db The database to backup * * Note - This method is not thread safe + * + * @throws RocksDBException thrown if a new backup could not be created */ public void createNewBackup(final RocksDB db) throws RocksDBException { createNewBackup(db, false); @@ -68,6 +71,8 @@ public class BackupEngine extends RocksObject implements AutoCloseable { * parameter. * * Note - This method is not thread safe + * + * @throws RocksDBException thrown if a new backup could not be created */ public void createNewBackup( final RocksDB db, final boolean flushBeforeBackup) @@ -116,6 +121,8 @@ public class BackupEngine extends RocksObject implements AutoCloseable { * Deletes old backups, keeping just the latest numBackupsToKeep * * @param numBackupsToKeep The latest n backups to keep + * + * @throws RocksDBException thrown if the old backups could not be deleted */ public void purgeOldBackups( final int numBackupsToKeep) throws RocksDBException { @@ -127,6 +134,8 @@ public class BackupEngine extends RocksObject implements AutoCloseable { * Deletes a backup * * @param backupId The id of the backup to delete + * + * @throws RocksDBException thrown if the backup could not be deleted */ public void deleteBackup(final int backupId) throws RocksDBException { assert (isOwningHandle()); @@ -152,6 +161,8 @@ public class BackupEngine extends RocksObject implements AutoCloseable { * @param walDir The location of the log files for your database, * often the same as dbDir * @param restoreOptions Options for controlling the restore + * + * @throws RocksDBException thrown if the database could not be restored */ public void restoreDbFromBackup( final int backupId, final String dbDir, final String walDir, @@ -167,6 +178,8 @@ public class BackupEngine extends RocksObject implements AutoCloseable { * @param dbDir The directory to restore the backup to, i.e. where your database is * @param walDir The location of the log files for your database, often the same as dbDir * @param restoreOptions Options for controlling the restore + * + * @throws RocksDBException thrown if the database could not be restored */ public void restoreDbFromLatestBackup( final String dbDir, final String walDir, @@ -178,6 +191,8 @@ public class BackupEngine extends RocksObject implements AutoCloseable { /** * Close the Backup Engine + * + * @throws RocksDBException thrown if the backup engine could not be closed */ @Override public void close() throws RocksDBException {