Package com.google.appengine.api.datastore

Examples of com.google.appengine.api.datastore.Cursor


  }

  private Object fulfillEntityQuery(
      PreparedQuery preparedQuery, FetchOptions opts, Function<Entity, Object> resultTransformer,
      DatastoreService ds, ManagedConnection mconn) {
    Cursor endCursor = null;
    Iterable<Entity> entityIterable;
    if (opts != null) {
      if (opts.getLimit() != null) {
        QueryResultList<Entity> entities = preparedQuery.asQueryResultList(opts);
        endCursor = entities.getCursor();
View Full Code Here


        // We know that offset won't be null because opts is not null.
        opts.limit(intExclNo - offset);
      }
    }
    Cursor cursor = getCursor();
    // If we have a cursor, add it to the fetch options
    if (cursor != null) {
      if (opts == null) {
        opts = withCursor(cursor);
      } else {
View Full Code Here

            if (keysToFetch.size() > 999) {
                Map<Key<Object>, Object> map = objectify.get(keysToFetch);
                objectify.put(map.values());

                Cursor cursor = iterator.getCursor();
                Queue queue = QueueFactory.getDefaultQueue();
                String newBookmark = cursor.toWebSafeString();
                queue.add(withUrl("/admin/reindex").method(TaskOptions.Method.POST)
                        .param("entityClass", entityClass)
                        .param("dumpVersion", dumpVersion)
                        .param("bookmark", newBookmark));
                logger.info("1000 objects processed, created new task with url: entityClass={}, dumpVersion={}, bookmark: {}", new Object[]{entityClass, dumpVersion, newBookmark});
View Full Code Here

                for (InvBlueprintType invBlueprintType : map.values()) {
                    blueprintDetailsList.add(blueprintDetailsCalculationService.getBlueprintDetailsForTypeID(invBlueprintType.getBlueprintTypeID()));
                }
                objectify.put(blueprintDetailsList);

                Cursor cursor = iterator.getCursor();
                Queue queue = QueueFactory.getDefaultQueue();
                String newBookmark = cursor.toWebSafeString();
                queue.add(withUrl("/admin/calculateBlueprintDetails").method(TaskOptions.Method.POST)
                        .param("bookmark", newBookmark));
                logger.info("20 objects processed, created new task with url: bookmark: {}", newBookmark);
                resp.getWriter().write("IN PROGRESS");
                return;
View Full Code Here

                for (InvType invType : map.values()) {
                    populateTokens(invType);
                }
                objectify.put(map.values());

                Cursor cursor = iterator.getCursor();
                Queue queue = QueueFactory.getDefaultQueue();
                String newBookmark = cursor.toWebSafeString();
                queue.add(withUrl("/admin/tokenizeInvType").method(TaskOptions.Method.POST)
                        .param("dumpVersion", dumpVersion)
                        .param("bookmark", newBookmark));
                logger.info("1000 objects processed, created new task with url: dumpVersion={}, bookmark: {}", new Object[]{dumpVersion, newBookmark});
                resp.getWriter().write("IN PROGRESS");
View Full Code Here

    return chunks.hasNext();
  }

  @Override
  public Chunk<T> next() {
    Cursor cursor = allKeys.getCursor();
    Iterator<Key<T>> keys = chunks.next();
    List<Result<T>> results = Lists.newArrayList();

    while (keys.hasNext()) {
      results.add(engine.load(keys.next()));
View Full Code Here

    QueryResultIterator<Trivial> i1 = q1.iterator();

    int which = 0;
    while (i1.hasNext()) {
      which++;
      Cursor cursor = i1.getCursor();
      assertCursorAt(cursor, which);
      i1.next();
    }

    assert which == MAX_ID;
View Full Code Here

    QueryResultIterator<Trivial> i1 = q1.iterator();

    int which = 0;
    while (i1.hasNext()) {
      which++;
      Cursor cursor = i1.getCursor();
      assertCursorAt(cursor, which);
      i1.next();
    }

    assert which == MAX_ID;
View Full Code Here

    QueryResultIterator<Trivial> i1 = q1.iterator();

    int which = 0;
    while (i1.hasNext()) {
      which++;
      Cursor cursor = i1.getCursor();
      assertCursorAt(cursor, which);
      i1.next();
    }

    assert which == 20;
View Full Code Here

    // then search for limit 20 (finding cursor at 15)
    // then search using that cursor
    // then use get() and see if we get the object at cursor

    List<Trivial> l1 = new ArrayList<>();
    Cursor cursor = null;

    Query<Trivial> q1 = query().limit(20);
    QueryResultIterator<Trivial> i1 = q1.iterator();

    int which = 0;
View Full Code Here

TOP

Related Classes of com.google.appengine.api.datastore.Cursor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.