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

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

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

Query.toBuilder介绍

暂无

代码示例

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

public static Builder newBuilder() {
 return DEFAULT_INSTANCE.toBuilder();
}

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

public static Builder newBuilder(com.google.datastore.v1.Query prototype) {
 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}

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

subBuilder = query_.toBuilder();

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

subBuilder = ((com.google.datastore.v1.Query) queryType_).toBuilder();

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

public static Builder newBuilder() {
 return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(com.google.datastore.v1.Query prototype) {

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

public static Builder newBuilder() {
 return DEFAULT_INSTANCE.toBuilder();
}

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

public static Builder newBuilder(com.google.datastore.v1.Query prototype) {
 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
public Builder toBuilder() {

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

public static Builder newBuilder(com.google.datastore.v1.Query prototype) {
 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}

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

Query translatedQuery = translateGqlQuery(gqlQueryWithZeroLimit, datastore, namespace);
 return translatedQuery.toBuilder().clearLimit().build();
} catch (DatastoreException e) {

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

subBuilder = query_.toBuilder();

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

com.google.datastore.v1.Query.Builder subBuilder = null;
if (query_ != null) {
 subBuilder = query_.toBuilder();

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

subBuilder = ((com.google.datastore.v1.Query) queryType_).toBuilder();

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

com.google.datastore.v1.Query.Builder subBuilder = null;
if (queryTypeCase_ == 3) {
 subBuilder = ((com.google.datastore.v1.Query) queryType_).toBuilder();

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

/** Tests {@link DatastoreV1.Read.SplitQueryFn} when the query has a user specified limit. */
@Test
public void testSplitQueryFnWithQueryLimit() throws Exception {
 Query queryWithLimit = QUERY.toBuilder().setLimit(Int32Value.newBuilder().setValue(1)).build();
 SplitQueryFn splitQueryFn = new SplitQueryFn(V_1_OPTIONS, 10, mockDatastoreFactory);
 DoFnTester<Query, Query> doFnTester = DoFnTester.of(splitQueryFn);
 doFnTester.setCloningBehavior(CloningBehavior.DO_NOT_CLONE);
 List<Query> queries = doFnTester.processBundle(queryWithLimit);
 assertEquals(1, queries.size());
 verifyNoMoreInteractions(mockDatastore);
 verifyNoMoreInteractions(mockQuerySplitter);
}

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

private Iterator<EntityResult> getIteratorAndMoveCursor() throws DatastoreException {
  Query.Builder query = this.query.toBuilder();
  query.setLimit(Int32Value.newBuilder().setValue(QUERY_BATCH_LIMIT));
  if (currentBatch != null && !currentBatch.getEndCursor().isEmpty()) {
   query.setStartCursor(currentBatch.getEndCursor());
  }
  RunQueryRequest request = makeRequest(query.build(), namespace);
  RunQueryResponse response = datastore.runQuery(request);
  currentBatch = response.getBatch();
  int numFetch = currentBatch.getEntityResultsCount();
  // All indications from the API are that there are/may be more results.
  moreResults =
    ((numFetch == QUERY_BATCH_LIMIT) || (currentBatch.getMoreResults() == NOT_FINISHED));
  // May receive a batch of 0 results if the number of records is a multiple
  // of the request limit.
  if (numFetch == 0) {
   return null;
  }
  return currentBatch.getEntityResultsList().iterator();
 }
}

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

Query.Builder queryBuilder = query.toBuilder();
queryBuilder.setLimit(
  Int32Value.newBuilder().setValue(Math.min(userLimit, QUERY_BATCH_LIMIT)));

相关文章