문제

Program to delete 100000 records in bulk from datastore using java.Currently i am doing.

 public void deleteExistingResults() throws InterruptedException {
      log.info("inside deleteExistingResults");
    ArrayList<Key> keys = new ArrayList<Key>();
    List<Entity> results = getResults();
    for (Entity entity : results) {
      keys.add(entity.getKey());
      }
    log.info("deleteExistingResults:outside loop");
    service.delete(keys);
  }

where getResults return all the keys from datastore.I am getting this error. com.insightsapp.cron.controller.CronTask runTask: Encountered an exception too much contention on these datastore entities. please try again.

도움이 되었습니까?

해결책

I'd recommend using something like the MapReduce library or at least using the Task Queue for deleting in batches of hundreds or so.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top