com.google.datastore.v1.Query.hasLimit()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(6.3k)|赞(0)|评价(0)|浏览(121)

本文整理了Java中com.google.datastore.v1.Query.hasLimit方法的一些代码示例,展示了Query.hasLimit的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.hasLimit方法的具体详情如下:
包路径:com.google.datastore.v1.Query
类名称:Query
方法名:hasLimit

Query.hasLimit介绍

[英]```
The maximum number of results to return. Applies after all other
constraints. Optional.
Unspecified is interpreted as no limit.
Must be >= 0 if specified.

`.google.protobuf.Int32Value limit = 12;`
[中]```
The maximum number of results to return. Applies after all other 
constraints. Optional. 
Unspecified is interpreted as no limit. 
Must be >= 0 if specified.

.google.protobuf.Int32Value limit = 12;

代码示例

代码示例来源:origin: googleapis/google-cloud-java

@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;
}

代码示例来源:origin: googleapis/google-cloud-java

setOffset(other.getOffset());
if (other.hasLimit()) {
 mergeLimit(other.getLimit());

代码示例来源:origin: googleapis/google-cloud-java

hash = (37 * hash) + OFFSET_FIELD_NUMBER;
hash = (53 * hash) + getOffset();
if (hasLimit()) {
 hash = (37 * hash) + LIMIT_FIELD_NUMBER;
 hash = (53 * hash) + getLimit().hashCode();

代码示例来源:origin: googleapis/google-cloud-java

if (queryPb.hasLimit()) {
 setLimit(queryPb.getLimit().getValue());

代码示例来源:origin: org.apache.beam/beam-sdks-java-io-google-cloud-platform

@ProcessElement
public void processElement(ProcessContext c) throws Exception {
 Query query = c.element();
 // If query has a user set limit, then do not split.
 if (query.hasLimit()) {
  c.output(query);
  return;
 }
 int estimatedNumSplits;
 // Compute the estimated numSplits if numSplits is not specified by the user.
 if (numSplits <= 0) {
  estimatedNumSplits = getEstimatedNumSplits(datastore, query, options.getNamespace());
 } else {
  estimatedNumSplits = numSplits;
 }
 LOG.info("Splitting the query into {} splits", estimatedNumSplits);
 List<Query> querySplits;
 try {
  querySplits =
    splitQuery(
      query, options.getNamespace(), datastore, querySplitter, estimatedNumSplits);
 } catch (Exception e) {
  LOG.warn("Unable to parallelize the given query: {}", query, e);
  querySplits = ImmutableList.of(query);
 }
 // assign unique keys to query splits.
 for (Query subquery : querySplits) {
  c.output(subquery);
 }
}

代码示例来源:origin: org.apache.beam/beam-sdks-java-io-google-cloud-platform

/**
 * 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();
}

代码示例来源:origin: com.google.api.grpc/proto-google-cloud-datastore-v1

@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;
}

代码示例来源:origin: com.google.cloud.datastore/datastore-v1-protos

setOffset(other.getOffset());
if (other.hasLimit()) {
 mergeLimit(other.getLimit());

代码示例来源:origin: com.google.cloud.datastore/datastore-v1-protos

result = result && (getOffset()
  == other.getOffset());
result = result && (hasLimit() == other.hasLimit());
if (hasLimit()) {
 result = result && getLimit()
   .equals(other.getLimit());

代码示例来源:origin: com.google.api.grpc/proto-google-cloud-datastore-v1

setOffset(other.getOffset());
if (other.hasLimit()) {
 mergeLimit(other.getLimit());

代码示例来源:origin: com.google.cloud.datastore/datastore-v1-protos

hash = (37 * hash) + OFFSET_FIELD_NUMBER;
hash = (53 * hash) + getOffset();
if (hasLimit()) {
 hash = (37 * hash) + LIMIT_FIELD_NUMBER;
 hash = (53 * hash) + getLimit().hashCode();

代码示例来源:origin: com.google.api.grpc/proto-google-cloud-datastore-v1

hash = (37 * hash) + OFFSET_FIELD_NUMBER;
hash = (53 * hash) + getOffset();
if (hasLimit()) {
 hash = (37 * hash) + LIMIT_FIELD_NUMBER;
 hash = (53 * hash) + getLimit().hashCode();

代码示例来源:origin: org.apache.beam/beam-sdks-java-io-google-cloud-platform

Query query = context.element();
String namespace = options.getNamespace();
int userLimit = query.hasLimit() ? query.getLimit().getValue() : Integer.MAX_VALUE;
 if (query.hasLimit()) {
  verify(
    userLimit >= numFetch,

代码示例来源:origin: com.google.cloud/google-cloud-datastore

if (queryPb.hasLimit()) {
 setLimit(queryPb.getLimit().getValue());

代码示例来源:origin: org.apache.beam/beam-sdks-java-io-google-cloud-platform

assertTrue(q.hasLimit());

相关文章