Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit eca4f57

Browse files
committed
doc
1 parent 8bcc43c commit eca4f57

File tree

2 files changed

+26
-6
lines changed

2 files changed

+26
-6
lines changed

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

Lines changed: 18 additions & 0 deletions
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‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -493,13 +493,15 @@ public Boolean getAllowRetry() {
493493

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

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /