Class 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 and also eventual consistency in general).
    • Constructor Detail

      • 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 Detail

      • 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>