Examples of allocateIds()


Examples of com.google.appengine.api.datastore.DatastoreService.allocateIds()

  }

  public static Key prepareDropControlKey(String kindName) {

    DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();
    Key controlId = datastore.allocateIds("drop", 1).getStart();
    Key childKey = KeyFactory.createKey(controlId, GbControl.NAME, kindName);
    Entity control = new Entity(childKey);
    control.setProperty(GbControl.KIND_NAME, kindName);
    control.setProperty(GbControl.REPORT_TO, new Email("test@example.com"));
    control.setProperty(GbControl.COUNT, 0);
View Full Code Here

Examples of com.google.appengine.api.datastore.DatastoreService.allocateIds()

  }
 
  public static Key prepareDumpControlKey(String kindName, String ssKey, String token) {
   
    DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();
    Key controlId = datastore.allocateIds("dump", 1).getStart();
    Key childKey = KeyFactory.createKey(controlId, GbControl.NAME, kindName);
    Entity control = new Entity(childKey);
    control.setProperty(GbControl.KIND_NAME, kindName);
    control.setProperty(GbControl.COUNT, 0);
    control.setProperty(GbControl.UPDATE_DATE, new Date());
View Full Code Here

Examples of com.google.appengine.api.datastore.DatastoreService.allocateIds()

  }

  public static Key prepareRestoreControlKey(String kindName, String ssKey, String token) {
   
    DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();
    Key controlId = datastore.allocateIds("restore", 1).getStart();
    Key childKey = KeyFactory.createKey(controlId, GbControl.NAME, kindName);
    Entity control = new Entity(childKey);
    control.setProperty(GbControl.KIND_NAME, kindName);
    control.setProperty(GbControl.COUNT, 2); // NOT FROM 0
    control.setProperty(GbControl.UPDATE_DATE, new Date());
View Full Code Here

Examples of com.google.appengine.api.datastore.DatastoreService.allocateIds()

        DatastoreService ds = DatastoreServiceFactory.getDatastoreService();
        DatastoreTimeoutException dte = null;
        long wait = INITIAL_WAIT_MS;
        for (int i = 0; i < MAX_RETRY; i++) {
            try {
                return ds.allocateIds(kind, num);
            } catch (DatastoreTimeoutException e) {
                dte = e;
                logger.log(Level.INFO, "RETRY["
                    + i
                    + "] This message is just INFORMATION["
View Full Code Here

Examples of com.google.appengine.api.datastore.DatastoreService.allocateIds()

        DatastoreService ds = DatastoreServiceFactory.getDatastoreService();
        DatastoreTimeoutException dte = null;
        long wait = INITIAL_WAIT_MS;
        for (int i = 0; i < MAX_RETRY; i++) {
            try {
                return ds.allocateIds(parentKey, kind, num);
            } catch (DatastoreTimeoutException e) {
                dte = e;
                logger.log(Level.INFO, "RETRY["
                    + i
                    + "] This message is just INFORMATION["
View Full Code Here

Examples of com.google.appengine.api.datastore.DatastoreService.allocateIds()

      // shouldn't happen
      throw new IllegalStateException("sequence name is null");
    }
    DatastoreServiceConfig config = ((DatastoreManager) storeMgr).getDefaultDatastoreServiceConfigForWrites();
    DatastoreService ds = DatastoreServiceFactoryInternal.getDatastoreService(config);
    KeyRange range = ds.allocateIds(sequenceName, size);
    // Too bad we can't pass an iterable and construct the ids
    // on demand.
    List<Long> ids = Utils.newArrayList();
    long current = range.getStart().getId();
    for (int i = 0; i < size; i++) {
View Full Code Here

Examples of com.google.appengine.api.datastore.DatastoreService.allocateIds()

    if (sequenceName == null) {
      // shouldn't happen
      throw new IllegalStateException("sequence name is null");
    }
    DatastoreService ds = DatastoreServiceFactoryInternal.getDatastoreService();
    KeyRange range = ds.allocateIds(sequenceName, size);
    // Too bad we can't pass an iterable and construct the ids
    // on demand.
    List<Long> ids = Utils.newArrayList();
    long current = range.getStart().getId();
    for (int i = 0; i < size; i++) {
View Full Code Here

Examples of com.google.appengine.api.datastore.DatastoreService.allocateIds()

      // shouldn't happen
      throw new IllegalStateException("sequence name is null");
    }
    DatastoreServiceConfig config = ((DatastoreManager) storeMgr).getDefaultDatastoreServiceConfigForWrites();
    DatastoreService ds = DatastoreServiceFactoryInternal.getDatastoreService(config);
    KeyRange range = ds.allocateIds(sequenceName, size);
    // Too bad we can't pass an iterable and construct the ids
    // on demand.
    List<Long> ids = Utils.newArrayList();
    long current = range.getStart().getId();
    for (int i = 0; i < size; i++) {
View Full Code Here

Examples of com.google.appengine.api.datastore.DatastoreService.allocateIds()

      // shouldn't happen
      throw new IllegalStateException("sequence name is null");
    }
    DatastoreServiceConfig config = ((DatastoreManager) storeMgr).getDefaultDatastoreServiceConfigForWrites();
    DatastoreService ds = DatastoreServiceFactoryInternal.getDatastoreService(config);
    KeyRange range = ds.allocateIds(sequenceName, size);
    // Too bad we can't pass an iterable and construct the ids
    // on demand.
    List<Long> ids = Utils.newArrayList();
    long current = range.getStart().getId();
    for (int i = 0; i < size; i++) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.