Package com.google.appengine.api.memcache

Examples of com.google.appengine.api.memcache.AsyncMemcacheService


  public static Future<Map<String, Long>> storeMultipleCounters(Map<String, Long> allCounters, String namespace, long initalValue) {
    if (null == allCounters || allCounters.isEmpty()) {
      return futureEmptyMap();
    }

    AsyncMemcacheService memcacheService = MemcacheServiceFactory.getAsyncMemcacheService(namespace);

    return memcacheService.incrementAll(allCounters, initalValue);
  }
View Full Code Here


  public static Future<Map<String, Object>> getMultipleCounters(Collection<String> allCounterNames, String namespace) {
    if (null == allCounterNames || allCounterNames.isEmpty()) {
      return futureEmptyMap();
    }

    AsyncMemcacheService memcacheService = MemcacheServiceFactory.getAsyncMemcacheService(namespace);

    return memcacheService.getAll(allCounterNames);
  }
View Full Code Here

    if (null == counterNames || counterNames.isEmpty()) {
      return futureEmptySet();
    }

    _logger.info("Deleting counter keys (count: " + counterNames.size() + ")");
    AsyncMemcacheService memcacheService = MemcacheServiceFactory.getAsyncMemcacheService(namespace);

    return memcacheService.deleteAll(counterNames);
  }
View Full Code Here

    @Test
    public void testAsyncWithNamespace() {
        String namespace = "namespace-123";

        AsyncMemcacheService ams = MemcacheServiceFactory.getAsyncMemcacheService(namespace);

        String key = "some-random-key";
        String value = "some-random-value";

        waitOnFuture(ams.put(key, value));

        // non-namespaced lookup
        Assert.assertFalse(memcache.contains(key));

        MemcacheService ms = MemcacheServiceFactory.getMemcacheService(namespace);
View Full Code Here

    entities.add(unemployment_percent);
   
   
    //Add all entities to datastore & Memcache.
    AsyncDatastoreService datastore = DatastoreServiceFactory.getAsyncDatastoreService();
    AsyncMemcacheService memcache = MemcacheServiceFactory.getAsyncMemcacheService();
    for (int i = 0; i < entities.size(); i++) {
      /**
       * We have to make sure that each entity is not null.
       * The Vector could contain null entries, which
       * occurs when there are problems generating
View Full Code Here

TOP

Related Classes of com.google.appengine.api.memcache.AsyncMemcacheService

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.