2121import jnr .ffi .Pointer ;
2222import jnr .ffi .byref .PointerByReference ;
2323import static org .lmdbjava .Dbi .KeyNotFoundException .MDB_NOTFOUND ;
24- import org .lmdbjava .Env .NotOpenException ;
2524import static org .lmdbjava .Env .SHOULD_CHECK ;
2625import static org .lmdbjava .Library .LIB ;
2726import static org .lmdbjava .Library .RUNTIME ;
3332
3433/**
3534 * LMDB Database.
36- * <p>
37- * All accessor and mutator methods on this class use <code>ByteBuffer</code>.
38- * This is solely for end user convenience and use of these methods is strongly
39- * discouraged. Instead use the more flexible buffer API and lower latency
40- * operating modes available via {@link #openCursor(org.lmdbjava.Txn)}.
4135 *
4236 * @param <T> buffer type
4337 */
@@ -66,15 +60,9 @@ public final class Dbi<T> {
6660 * Starts a new read-write transaction and deletes the key.
6761 *
6862 * @param key key to delete from the database (not null)
69- * @throws CommittedException if already committed
70- * @throws NotOpenException if the environment is not currently open
71- * @throws LmdbNativeException if a native C error occurred
72- * @throws ReadWriteRequiredException if a read-only transaction presented
73- * @see #delete(Txn, ByteBuffer, ByteBuffer)
63+ * @see #delete(org.lmdbjava.Txn, java.lang.Object, java.lang.Object)
7464 */
75- public void delete (final T key ) throws
76- CommittedException , LmdbNativeException ,
77- NotOpenException , ReadWriteRequiredException {
65+ public void delete (final T key ) {
7866 try (final Txn <T > txn = env .txnWrite ()) {
7967 delete (txn , key );
8068 txn .commit ();
@@ -86,14 +74,9 @@ public void delete(final T key) throws
8674 *
8775 * @param txn transaction handle (not null; not committed; must be R-W)
8876 * @param key key to delete from the database (not null)
89- * @throws CommittedException if already committed
90- * @throws LmdbNativeException if a native C error occurred
91- * @throws ReadWriteRequiredException if a read-only transaction presented
92- * @see #delete(Txn, ByteBuffer, ByteBuffer)
77+ * @see #delete(org.lmdbjava.Txn, java.lang.Object, java.lang.Object)
9378 */
94- public void delete (final Txn <T > txn , final T key ) throws
95- CommittedException , LmdbNativeException ,
96- ReadWriteRequiredException {
79+ public void delete (final Txn <T > txn , final T key ) {
9780 delete (txn , key , null );
9881 }
9982
@@ -112,14 +95,8 @@ public void delete(final Txn<T> txn, final T key) throws
11295 * @param txn transaction handle (not null; not committed; must be R-W)
11396 * @param key key to delete from the database (not null)
11497 * @param val value to delete from the database (null permitted)
115- * @throws CommittedException if already committed
116- * @throws LmdbNativeException if a native C error occurred
117- * @throws ReadWriteRequiredException if a read-only transaction presented
11898 */
119- public void delete (final Txn <T > txn , final T key , final T val )
120- throws
121- CommittedException , LmdbNativeException ,
122- ReadWriteRequiredException {
99+ public void delete (final Txn <T > txn , final T key , final T val ) {
123100 if (SHOULD_CHECK ) {
124101 requireNonNull (txn );
125102 requireNonNull (key );
@@ -150,12 +127,8 @@ public void delete(final Txn<T> txn, final T key, final T val)
150127 * @param txn transaction handle (not null; not committed)
151128 * @param key key to search for in the database (not null)
152129 * @return the data or null if not found
153- * @throws CommittedException if already committed
154- * @throws LmdbNativeException if a native C error occurred
155130 */
156- public T get (final Txn <T > txn , final T key )
157- throws
158- CommittedException , LmdbNativeException {
131+ public T get (final Txn <T > txn , final T key ) {
159132 if (SHOULD_CHECK ) {
160133 requireNonNull (txn );
161134 requireNonNull (key );
@@ -194,11 +167,8 @@ public String getName() {
194167 *
195168 * @param txn transaction handle (not null; not committed)
196169 * @return cursor handle
197- * @throws LmdbNativeException if a native C error occurred
198- * @throws CommittedException if already committed
199170 */
200- public Cursor <T > openCursor (final Txn <T > txn )
201- throws LmdbNativeException , CommittedException {
171+ public Cursor <T > openCursor (final Txn <T > txn ) {
202172 if (SHOULD_CHECK ) {
203173 requireNonNull (txn );
204174 txn .checkNotCommitted ();
@@ -213,15 +183,10 @@ public Cursor<T> openCursor(final Txn<T> txn)
213183 *
214184 * @param key key to store in the database (not null)
215185 * @param val value to store in the database (not null)
216- * @throws CommittedException if already committed
217- * @throws NotOpenException if the environment is not currently open
218- * @throws LmdbNativeException if a native C error occurred
219- * @throws ReadWriteRequiredException if a read-only transaction presented
220- * @see Dbi#put(Txn, ByteBuffer, ByteBuffer, PutFlags...)
186+ * @see #put(org.lmdbjava.Txn, java.lang.Object, java.lang.Object,
187+ * org.lmdbjava.PutFlags...)
221188 */
222- public void put (final T key , final T val ) throws
223- CommittedException , LmdbNativeException ,
224- NotOpenException , ReadWriteRequiredException {
189+ public void put (final T key , final T val ) {
225190 try (final Txn <T > txn = env .txnWrite ()) {
226191 put (txn , key , val );
227192 txn .commit ();
@@ -240,14 +205,9 @@ public void put(final T key, final T val) throws
240205 * @param key key to store in the database (not null)
241206 * @param val value to store in the database (not null)
242207 * @param flags Special options for this operation
243- * @throws CommittedException if already committed
244- * @throws LmdbNativeException if a native C error occurred
245- * @throws ReadWriteRequiredException if a read-only transaction presented
246208 */
247209 public void put (final Txn <T > txn , final T key , final T val ,
248- final PutFlags ... flags )
249- throws CommittedException , LmdbNativeException ,
250- ReadWriteRequiredException {
210+ final PutFlags ... flags ) {
251211 if (SHOULD_CHECK ) {
252212 requireNonNull (txn );
253213 requireNonNull (key );
@@ -275,13 +235,8 @@ public void put(final Txn<T> txn, final T key, final T val,
275235 * @param txn transaction handle (not null; not committed; must be R-W)
276236 * @param key key to store in the database (not null)
277237 * @param val size of the value to be stored in the database (not null)
278- * @throws CommittedException if already committed
279- * @throws LmdbNativeException if a native C error occurred
280- * @throws ReadWriteRequiredException if a read-only transaction presented
281238 */
282- public void reserve (Txn <T > txn , final T key , final T val )
283- throws CommittedException , LmdbNativeException ,
284- ReadWriteRequiredException {
239+ public void reserve (Txn <T > txn , final T key , final T val ) {
285240 if (SHOULD_CHECK ) {
286241 requireNonNull (txn );
287242 requireNonNull (key );
0 commit comments