/** * Creates a Checkpoint object to be used for creating open-able * snapshots. * * @param db {@link RocksDB} instance. * @return a Checkpoint instance. * * @throws java.lang.IllegalArgumentException if {@link RocksDB} * instance is null. * @throws java.lang.IllegalStateException if {@link RocksDB} * instance is not initialized. */ public static Checkpoint create(final RocksDB db) { if (db == null) { throw new IllegalArgumentException( "RocksDB instance shall not be null."); } else if (!db.isOwningHandle()) { throw new IllegalStateException( "RocksDB instance must be initialized."); } Checkpoint checkpoint = new Checkpoint(db); return checkpoint; }