public void putTransient(TileObject tile) { String key = TransientCache.computeTransientKey(tile); synchronized (transientCache) { transientCache.put(key, tile.getBlob()); } }
public boolean getTransient(TileObject tile) { String key = TransientCache.computeTransientKey(tile); Resource resource; synchronized (transientCache) { resource = transientCache.get(key); } tile.setBlob(resource); return resource != null; }
@Override public void setValue(TileObject value) { puts.add( TransientCache.computeTransientKey( value)); storagePutCounter.incrementAndGet(); } })))
@Override public void setValue(TileObject tile) { String key = TransientCache.computeTransientKey(tile); synchronized (transientCache) { transientCache.put(key, tile.getBlob()); } } }));
public Boolean answer() throws Throwable { TileObject tile = (TileObject) EasyMock.getCurrentArguments()[0]; if (puts.contains(TransientCache.computeTransientKey(tile))) { tile.setBlob(new ByteArrayResource(fakeWMSResponse)); storageGetCounter.incrementAndGet(); return true; } else { return false; } } })
public Boolean answer() throws Throwable { TileObject tile = (TileObject) EasyMock.getCurrentArguments()[0]; String key = TransientCache.computeTransientKey(tile); Resource resource; synchronized (transientCache) { resource = transientCache.get(key); } if (resource != null) { cacheHits.incrementAndGet(); } else { cacheMisses.incrementAndGet(); } tile.setBlob(resource); return resource != null; } })