/** * * * <pre> * The maximum number of results to return. Applies after all other * constraints. Optional. * Unspecified is interpreted as no limit. * Must be >= 0 if specified. * </pre> * * <code>.google.protobuf.Int32Value limit = 12;</code> */ public com.google.protobuf.Int32ValueOrBuilder getLimitOrBuilder() { return getLimit(); }
output.writeMessage(12, getLimit());
size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, getLimit());
mergeLimit(other.getLimit());
if (hasLimit()) { hash = (37 * hash) + LIMIT_FIELD_NUMBER; hash = (53 * hash) + getLimit().hashCode();
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.datastore.v1.Query)) { return super.equals(obj); } com.google.datastore.v1.Query other = (com.google.datastore.v1.Query) obj; boolean result = true; result = result && getProjectionList().equals(other.getProjectionList()); result = result && getKindList().equals(other.getKindList()); result = result && (hasFilter() == other.hasFilter()); if (hasFilter()) { result = result && getFilter().equals(other.getFilter()); } result = result && getOrderList().equals(other.getOrderList()); result = result && getDistinctOnList().equals(other.getDistinctOnList()); result = result && getStartCursor().equals(other.getStartCursor()); result = result && getEndCursor().equals(other.getEndCursor()); result = result && (getOffset() == other.getOffset()); result = result && (hasLimit() == other.hasLimit()); if (hasLimit()) { result = result && getLimit().equals(other.getLimit()); } result = result && unknownFields.equals(other.unknownFields); return result; }
setLimit(queryPb.getLimit().getValue());
/** * <pre> * The maximum number of results to return. Applies after all other * constraints. Optional. * Unspecified is interpreted as no limit. * Must be >= 0 if specified. * </pre> * * <code>optional .google.protobuf.Int32Value limit = 12;</code> */ public com.google.protobuf.Int32ValueOrBuilder getLimitOrBuilder() { return getLimit(); }
/** * * * <pre> * The maximum number of results to return. Applies after all other * constraints. Optional. * Unspecified is interpreted as no limit. * Must be >= 0 if specified. * </pre> * * <code>.google.protobuf.Int32Value limit = 12;</code> */ public com.google.protobuf.Int32ValueOrBuilder getLimitOrBuilder() { return getLimit(); }
size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, getLimit());
output.writeMessage(12, getLimit());
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { for (int i = 0; i < projection_.size(); i++) { output.writeMessage(2, projection_.get(i)); } for (int i = 0; i < kind_.size(); i++) { output.writeMessage(3, kind_.get(i)); } if (filter_ != null) { output.writeMessage(4, getFilter()); } for (int i = 0; i < order_.size(); i++) { output.writeMessage(5, order_.get(i)); } for (int i = 0; i < distinctOn_.size(); i++) { output.writeMessage(6, distinctOn_.get(i)); } if (!startCursor_.isEmpty()) { output.writeBytes(7, startCursor_); } if (!endCursor_.isEmpty()) { output.writeBytes(8, endCursor_); } if (offset_ != 0) { output.writeInt32(10, offset_); } if (limit_ != null) { output.writeMessage(12, getLimit()); } }
.computeMessageSize(12, getLimit());
/** * Returns a new {@link DatastoreV1.Read} that reads the results of the specified query. * * <p><b>Note:</b> Normally, {@code DatastoreIO} will read from Cloud Datastore in parallel * across many workers. However, when the {@link Query} is configured with a limit using {@link * Query.Builder#setLimit}, then all results will be read by a single worker in order to ensure * correct results. */ public DatastoreV1.Read withQuery(Query query) { checkArgument(query != null, "query can not be null"); checkArgument( !query.hasLimit() || query.getLimit().getValue() > 0, "Invalid query limit %s: must be positive", query.getLimit().getValue()); return toBuilder().setQuery(query).build(); }
if (hasLimit()) { hash = (37 * hash) + LIMIT_FIELD_NUMBER; hash = (53 * hash) + getLimit().hashCode();
if (hasLimit()) { hash = (37 * hash) + LIMIT_FIELD_NUMBER; hash = (53 * hash) + getLimit().hashCode();
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.datastore.v1.Query)) { return super.equals(obj); } com.google.datastore.v1.Query other = (com.google.datastore.v1.Query) obj; boolean result = true; result = result && getProjectionList().equals(other.getProjectionList()); result = result && getKindList().equals(other.getKindList()); result = result && (hasFilter() == other.hasFilter()); if (hasFilter()) { result = result && getFilter().equals(other.getFilter()); } result = result && getOrderList().equals(other.getOrderList()); result = result && getDistinctOnList().equals(other.getDistinctOnList()); result = result && getStartCursor().equals(other.getStartCursor()); result = result && getEndCursor().equals(other.getEndCursor()); result = result && (getOffset() == other.getOffset()); result = result && (hasLimit() == other.hasLimit()); if (hasLimit()) { result = result && getLimit().equals(other.getLimit()); } result = result && unknownFields.equals(other.unknownFields); return result; }
setLimit(queryPb.getLimit().getValue());
int limit = q.getLimit().getValue(); assertThat(limit, greaterThanOrEqualTo(1)); assertThat(limit, lessThanOrEqualTo(QUERY_BATCH_LIMIT));