Skip to content

Commit

Permalink
limit
Browse files Browse the repository at this point in the history
  • Loading branch information
jcferretti committed Feb 18, 2025
1 parent 4d85d98 commit 46a1ca3
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 11 deletions.
6 changes: 3 additions & 3 deletions jetcd-core/src/main/java/io/etcd/jetcd/kv/GetResponse.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ public boolean isMore() {

/**
* Returns the number of keys within the range when requested.
* Note this value is never affected by filtering options for min or max created or modified revisions
* Count is the count for keys on the range part of a request, considering the limit provided, if any.
* Filters for min or max created or midified revisions restrict the
* Note this value is never affected by filtering options (limit, min or max created or modified revisions)
* Count is the count for keys on the range part of a request.
* Filters for limit and created or modified revision ranges restrict the
* returned KVs, but not the count.
*
* @return count.
Expand Down
29 changes: 21 additions & 8 deletions jetcd-core/src/main/java/io/etcd/jetcd/options/GetOption.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ private GetOption(
/**
* Get the maximum number of keys to return for a get request.
*
* <p>
* Note this filter does not affect the count field in GetResponse.
* {@link GetResponse#getCount()} always counts the number of keys matched on a range, independent of filters.
* </p>
*
*
* @return the maximum number of keys to return.
*/
public long getLimit() {
Expand Down Expand Up @@ -156,7 +162,7 @@ public boolean isCountOnly() {
*
* <p>
* Note this filter does not affect the count field in GetResponse.
* {@link GetResponse#getCount()} always counts the number of keys matched on a range, independent of revision filters.
* {@link GetResponse#getCount()} always counts the number of keys matched on a range, independent of filters.
* For the same reason, it would be meaningless to mix setting a min create revision option
* with the count only option.
* </p>
Expand All @@ -173,7 +179,7 @@ public long getMinCreateRevision() {
*
* <p>
* Note this filter does not affect the count field in GetResponse.
* {@link GetResponse#getCount()} always counts the number of keys matched on a range, independent of revision filters.
* {@link GetResponse#getCount()} always counts the number of keys matched on a range, independent of filters.
* For the same reason, it would be meaningless to mix setting a max create revision option
* with the count only option.
* </p>
Expand All @@ -190,7 +196,7 @@ public long getMaxCreateRevision() {
*
* <p>
* Note this filter does not affect the count field in GetResponse.
* {@link GetResponse#getCount()} always counts the number of keys matched on a range, independent of revision filters.
* {@link GetResponse#getCount()} always counts the number of keys matched on a range, independent of filters.
* For the same reason, it would be meaningless to mix setting a min mod revision option
* with the count only option.
* </p>
Expand All @@ -207,7 +213,7 @@ public long getMinModRevision() {
*
* <p>
* Note this filter does not affect the count field in GetResponse.
* {@link GetResponse#getCount()} always counts the number of keys matched on a range, independent of revision filters.
* {@link GetResponse#getCount()} always counts the number of keys matched on a range, independent of filters.
* For the same reason, it would be meaningless to mix setting a max mod revision option
* with the count only option.
* </p>
Expand Down Expand Up @@ -273,6 +279,13 @@ private Builder() {
/**
* Limit the number of keys to return for a get request. By default is 0 - no limitation.
*
* <p>
* Note this filter does not affect the count field in GetResponse.
* {@link GetResponse#getCount()} always counts the number of keys matched on a range, independent of filters.
* For the same reason, it would be meaningless to mix setting this option
* with the count only option.
* </p>
*
* @param limit the maximum number of keys to return for a get request.
* @return builder
*/
Expand Down Expand Up @@ -421,7 +434,7 @@ public Builder withPrefix(ByteSequence prefix) {
*
* <p>
* Note this filter does not affect the count field in GetResponse.
* {@link GetResponse#getCount()} always counts the number of keys matched on a range, independent of revision filters.
* {@link GetResponse#getCount()} always counts the number of keys matched on a range, independent of filters.
* For the same reason, it would be meaningless to mix setting this option
* with the count only option.
* </p>
Expand All @@ -441,7 +454,7 @@ public Builder withMinCreateRevision(long createRevision) {
*
* <p>
* Note this filter does not affect the count field in GetResponse.
* {@link GetResponse#getCount()} always counts the number of keys matched on a range, independent of revision filters.
* {@link GetResponse#getCount()} always counts the number of keys matched on a range, independent of filters.
* For the same reason, it would be meaningless to mix setting this option
* with the count only option.
* </p>
Expand All @@ -461,7 +474,7 @@ public Builder withMaxCreateRevision(long createRevision) {
*
* <p>
* Note this filter does not affect the count field in GetResponse.
* {@link GetResponse#getCount()} always counts the number of keys matched on a range, independent of revision filters.
* {@link GetResponse#getCount()} always counts the number of keys matched on a range, independent of filters.
* For the same reason, it would be meaningless to mix setting this option
* with the count only option.
* </p>
Expand All @@ -481,7 +494,7 @@ public Builder withMinModRevision(long modRevision) {
*
* <p>
* Note this filter does not affect the count field in GetResponse.
* {@link GetResponse#getCount()} always counts the number of keys matched on a range, independent of revision filters.
* {@link GetResponse#getCount()} always counts the number of keys matched on a range, independent of filters.
* For the same reason, it would be meaningless to mix setting this option
* with the count only option.
* </p>
Expand Down

0 comments on commit 46a1ca3

Please sign in to comment.