For Google App Engine (java), how do I set and use chunk size in FetchOptions?

前端 未结 3 1774
梦毁少年i
梦毁少年i 2021-02-08 12:59

Im running a query and it is currently returning 1400 results and because of this I am getting the following warning in the log file:

com.google.appengine

3条回答
  •  一整个雨季
    2021-02-08 13:36

    This is how I apply FetchOptions, compared to your example code, you might need to tweak a bit:

    // ..... build the Query object
    FetchOptions fetch_options =
        FetchOptions.Builder.withPrefetchSize(100).chunkSize(100);
    QueryResultList returned_entities =
        datastore_service_instance.prepare(query).asQueryResultList(fetch_options);
    

    Of course that the figures may be changed (100).

    If my answer isn't what you're looking for then you're welcome to rephrase your question (edit).

    By the way I'm the one who wrote the first linked question.

提交回复
热议问题