Creates a Checkpoint object to be used for creating open-able snapshots. @param db RocksDB instance. @return a Checkpoint instance. @throws java.lang.IllegalArgumentException if RocksDB instance is null. @throws java.lang.IllegalStateException if RocksDB instance is
(final RocksDB db)
| 24 | * instance is not initialized. |
| 25 | */ |
| 26 | public static Checkpoint create(final RocksDB db) { |
| 27 | if (db == null) { |
| 28 | throw new IllegalArgumentException( |
| 29 | "RocksDB instance shall not be null."); |
| 30 | } else if (!db.isOwningHandle()) { |
| 31 | throw new IllegalStateException( |
| 32 | "RocksDB instance must be initialized."); |
| 33 | } |
| 34 | Checkpoint checkpoint = new Checkpoint(db); |
| 35 | return checkpoint; |
| 36 | } |
| 37 | |
| 38 | /** |
| 39 | * <p>Builds an open-able snapshot of RocksDB on the same disk, which |