Package org.directmemory

Examples of org.directmemory.ICacheEntry


  @Test
    @PerfTest(duration = 10000, threads = 5)
    @Required(max = 1500, average = 1)
  public void onlyWrites() throws IOException {
      DummyObject object2add = nextObject();
      ICacheEntry entry = cache.put(object2add.getName(), object2add);
      assertNotNull(entry);
  }
View Full Code Here


   
    long mySize = 0;
   
      Iterator<ICacheEntry> iter = entries.values().iterator();
    while (iter.hasNext()) {
      ICacheEntry entry = iter.next();
      if (!entry.expired()) {
        DummyObject dummy = (DummyObject) cache.get(entry.getKey());
        assertNotNull(dummy);
        assertEquals(entry.getKey(), dummy.getName());
      }
      mySize+=entry.size();
    }

    logger.debug("**** computed size is: " + mySize)
    logger.debug(cache.toString())
    }
View Full Code Here

 
  public ICacheEntry delete(String key) {

    logger.info("trying to remove entry with key '" + key + "'")

    ICacheEntry entry = null;
   
    entry = entries.remove(key);
    signalWeDeleted(key);
   
    if (entry != null) {
      usedMemory.addAndGet(-entry.size());
      entry.dispose();
      logger.info("object with key '" + key + "' disposed");
    }

    return entry;
  }
View Full Code Here

TOP

Related Classes of org.directmemory.ICacheEntry

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.