Package com.google.appengine.api.memcache

Examples of com.google.appengine.api.memcache.MemcacheService.clearAll()


    return memcacheService.deleteAll(counterNames);
  }

  public static void clearMemCache() {
    MemcacheService memcacheService = MemcacheServiceFactory.getMemcacheService(NAMESPACE);
    memcacheService.clearAll();
  }

  @SuppressWarnings("unchecked")
  private static <T> Future<Set<T>> futureEmptySet() {
    return (Future<Set<T>>) _futureEmptySet;
View Full Code Here


    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        MemcacheService memcacheService = MemcacheServiceFactory.getMemcacheService();
        Stats stats = memcacheService.getStatistics();
        long itemCount = stats.getItemCount();
        logger.info("Clearing memcache, item count in cache: {}", itemCount);
        memcacheService.clearAll();
        resp.getWriter().write("OK, " + itemCount);
    }
}
View Full Code Here

  public void doGet(HttpServletRequest request, HttpServletResponse response)
      throws IOException {
    response.setContentType("text/plain");
    MemcacheService ms = MemcacheServiceFactory.getMemcacheService();
    ms.clearAll();

    String chapterId = request.getParameter("id");
    Chapter chapter = retrieveChapter(chapterId);

    if (chapter == null) {
View Full Code Here

public class ClearMemcacheServlet extends HttpServlet {

  public void doGet(HttpServletRequest request, HttpServletResponse response)
      throws IOException {
    MemcacheService ms = MemcacheServiceFactory.getMemcacheService();
    ms.clearAll();

    response.sendRedirect("/");
  }
}
View Full Code Here

  public void init() {
    // Using the synchronous cache
      MemcacheService syncCache = MemcacheServiceFactory.getMemcacheService();
      syncCache.setErrorHandler(ErrorHandlers.getConsistentLogAndContinue(Level.INFO));
      //empty the entire cache before repopulating
      syncCache.clearAll();
    System.out.println("calling BloomCache");
    BloomFilter b = new BloomCache().getCachedBloomFilter();
    b.populate();
    System.out.println("calling TrieCache");
    new TrieCache().getCachedTrie("name_first");
View Full Code Here

    private void clearMemcache(ServletContext scx){
        String paramValue = scx.getInitParameter(ScxParamClearMemcache);
        if (null != paramValue && "true".equals(paramValue.trim())){
            MemcacheService memcache = MemcacheServiceFactory.getMemcacheService();
            memcache.clearAll();
            Log.info("[cleared]");
        }
        else
            Log.info("[not cleared]");
    }
View Full Code Here

    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        MemcacheService memcacheService = MemcacheServiceFactory.getMemcacheService();
        Stats stats = memcacheService.getStatistics();
        long itemCount = stats.getItemCount();
        logger.info("Clearing memcache, item count in cache: {}", itemCount);
        memcacheService.clearAll();
        resp.getWriter().write("OK, " + itemCount);
    }
}
View Full Code Here

  public void doGet(HttpServletRequest req, HttpServletResponse resp)
      throws IOException {
    resp.setContentType("text/plain");
   
    MemcacheService memcache = Registry.dao().memcache();
    memcache.clearAll();
    resp.getWriter().println("Memcache cleared");
  }
}
View Full Code Here

      cacheName = "default";
    }
   
    //InternalCache internalCache = this.getCache(cacheName);
    MemcacheService syncCache = this.getCache(cacheName);
    syncCache.clearAll();
    /*if(internalCache == null) {
      LOGGER.log(Level.INFO, "NO CACHE TO FLUSH! with name -> " + cacheName);
    } else {
      LOGGER.log(Level.INFO, "Flushing cache with name -> " + cacheName);
      this.addCache(cacheName, null);
View Full Code Here

  public void testSuccessfulLookup() throws Exception {
    MemcacheService memcache = MemcacheServiceFactory.getMemcacheService();
    WaveletDirectory directory = newDirectory(newDatastore(), memcache);

    directory.register(MAPPING);
    memcache.clearAll();
    assertNull(directory.cache.get(OBJECT_ID));
    assertEquals(OBJECT_ID, directory.lookup(OBJECT_ID).getObjectId());
    assertEquals(OBJECT_ID, directory.cache.get(OBJECT_ID).getCached().getObjectId());
  }
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.