Skip to content

Commit 8f9e501

Browse files
committed
doc
1 parent 41b62d6 commit 8f9e501

File tree

2 files changed

+26
-6
lines changed

2 files changed

+26
-6
lines changed

core/src/main/java/com/arangodb/ArangoCursor.java

+18
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@
2222

2323
import com.arangodb.entity.CursorStats;
2424
import com.arangodb.entity.CursorWarning;
25+
import com.arangodb.model.AqlQueryOptions;
2526

2627
import java.io.Closeable;
2728
import java.util.Collection;
2829
import java.util.List;
30+
import java.util.NoSuchElementException;
2931

3032
/**
3133
* @author Mark Vollmary
@@ -83,4 +85,20 @@ public interface ArangoCursor<T> extends ArangoIterable<T>, ArangoIterator<T>, C
8385
*/
8486
String getNextBatchId();
8587

88+
/**
89+
* Returns the next element in the iteration.
90+
* <p/>
91+
* If the cursor allows retries (see {@link AqlQueryOptions#allowRetry(Boolean)}), then it is safe to retry invoking
92+
* this method in case of I/O exceptions (which are actually thrown as {@link com.arangodb.ArangoDBException} with
93+
* cause {@link java.io.IOException}).
94+
* <p/>
95+
* If the cursor does not allow retries (default), then it is not safe to retry invoking this method in case of I/O
96+
* exceptions, since the request to fetch the next batch is not idempotent (i.e. the cursor may advance multiple
97+
* times on the server).
98+
*
99+
* @return the next element in the iteration
100+
* @throws NoSuchElementException if the iteration has no more elements
101+
*/
102+
@Override
103+
T next();
86104
}

core/src/main/java/com/arangodb/model/AqlQueryOptions.java

+8-6
Original file line numberDiff line numberDiff line change
@@ -491,13 +491,15 @@ public Boolean getAllowRetry() {
491491

492492
/**
493493
* @param allowRetry Set this option to true to make it possible to retry fetching the latest batch from a cursor.
494+
* <p/>
494495
* This makes possible to safely retry invoking {@link com.arangodb.ArangoCursor#next()} in
495-
* case of {@link java.io.IOException}.
496-
* <p>
497-
* If set to false (default), retry invoking {@link com.arangodb.ArangoCursor#next()} in case of
498-
* {@link java.io.IOException} is not safe, since the request to fetch the next batch is not
499-
* idempotent (i.e. the cursor may be advanced multiple times on the server).
500-
*
496+
* case of I/O exceptions (which are actually thrown as {@link com.arangodb.ArangoDBException}
497+
* with cause {@link java.io.IOException})
498+
* <p/>
499+
* If set to false (default), then it is not safe to retry invoking
500+
* {@link com.arangodb.ArangoCursor#next()} in case of I/O exceptions, since the request to
501+
* fetch the next batch is not idempotent (i.e. the cursor may advance multiple times on the
502+
* server).
501503
* @return options
502504
* @since ArangoDB 3.11
503505
*/

0 commit comments

Comments
 (0)