Class HybridQueryResults<T>

java.lang.Object
com.googlecode.objectify.impl.HybridQueryResults<T>
All Implemented Interfaces:
com.google.cloud.datastore.QueryResults<T>, Iterator<T>

public class HybridQueryResults<T> extends Object implements com.google.cloud.datastore.QueryResults<T>
Converts keys-only query results into hybrid query results. This involves chunking the keys into batches and loading each from the datastore. Care is taken to preserve cursor behavior and filter null results (possible due to both the time delay between the query and the load).
  • Constructor Details

    • HybridQueryResults

      public HybridQueryResults(LoadEngine loadEngine, com.google.cloud.datastore.QueryResults<Key<T>> source, int chunkSize)
      Parameters:
      chunkSize - can be MAX_VALUE to indicate "just one chunk"
  • Method Details

    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface Iterator<T>
    • next

      public T next()
      Specified by:
      next in interface Iterator<T>
    • getResultClass

      public Class<?> getResultClass()
      Specified by:
      getResultClass in interface com.google.cloud.datastore.QueryResults<T>
    • getSkippedResults

      public int getSkippedResults()
      Specified by:
      getSkippedResults in interface com.google.cloud.datastore.QueryResults<T>
    • getMoreResults

      public com.google.datastore.v1.QueryResultBatch.MoreResultsType getMoreResults()
      Specified by:
      getMoreResults in interface com.google.cloud.datastore.QueryResults<T>