Skip to content

Commit 49f34c1

Browse files
author
Ajay Kannan
committed
---
yaml --- r: 2695 b: refs/heads/update-datastore c: 2219c82 h: refs/heads/master i: 2693: 3079cc4 2691: 92a8e72 2687: 6a172f8
1 parent 4ef1c9b commit 49f34c1

4 files changed

Lines changed: 8 additions & 6 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/gh-pages: 4e0561bb4504bf647db669a14417b2b2c87ba45d
55
refs/heads/bigquery: 762fa5830e6c398c0396177e3e7fd243bd62cfc3
66
refs/heads/pubsub-alpha: 1a0e970f265af871e02274085b9662b3fe29058b
77
refs/heads/resource-manager: ebf4adc5ee835cd2086c4ac5b4e78d01a5a005a7
8-
refs/heads/update-datastore: a2e60abf83d6603ecf9f0e80b0c95082e8ce0fbb
8+
refs/heads/update-datastore: 2219c82af21997fe66b952b062ff7fe7006503b9
99
refs/tags/0.0.9: 22f1839238f66c39e67ed4dfdcd273b1ae2e8444
1010
refs/tags/v0.0.10: 207ebd2a3472fddee69fe1298eb90429e3306efd
1111
refs/tags/v0.0.11: ffbfba48a6426ff63c08ff2117e58681f251fbf2

branches/update-datastore/gcloud-java-datastore/src/main/java/com/google/gcloud/datastore/QueryResults.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,8 @@ public interface QueryResults<V> extends Iterator<V> {
3535
Class<?> resultClass();
3636

3737
/**
38-
* Returns the Cursor for the point after the value returned in the last {@link #next} call. Until
39-
* v1beta3 is supported, this field should only be used if you have set a limit and the number of
40-
* results is equal to that limit.
38+
* Returns the Cursor for the point after the value returned in the last {@link #next} call.
39+
* Currently, {@code cursorAfter} returns null in all cases but the last result.
4140
*/
4241
Cursor cursorAfter();
4342
}

branches/update-datastore/gcloud-java-datastore/src/main/java/com/google/gcloud/datastore/QueryResultsImpl.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ public Class<?> resultClass() {
100100
@Override
101101
public Cursor cursorAfter() {
102102
//return new Cursor(cursor); // only available in v1beta3
103-
return new Cursor(queryResultBatchPb.getEndCursor());
103+
if (!hasNext()) {
104+
return new Cursor(queryResultBatchPb.getEndCursor());
105+
}
106+
return null;
104107
}
105108
}

branches/update-datastore/gcloud-java-datastore/src/test/java/com/google/gcloud/datastore/DatastoreTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ public void testQueryPaginationWithLimit() throws DatastoreRpcException {
478478
}
479479
EasyMock.replay(rpcFactoryMock, rpcMock);
480480
Datastore mockDatastore =
481-
this.options.toBuilder()
481+
options.toBuilder()
482482
.retryParams(RetryParams.defaultInstance())
483483
.serviceRpcFactory(rpcFactoryMock)
484484
.build()

0 commit comments

Comments
 (0)