// split.stop();
// }
protected void moveInHeap(CacheEntry entry) {
Stopwatch stopWatch = SimonManager.getStopwatch("detail.moveinheap");
Split split = stopWatch.start();
byte[] source = null;
source = new byte[entry.size];
try {
synchronized (entry) {
ByteBuffer buf = entry.buffer;
buf.position(entry.position);
buf.get(source);
Object obj = serializer.deserialize(source, entry.clazz);
entry.object = obj;
entry.buffer = null;
CacheEntry freeSlot = new CacheEntry();
freeSlot.buffer = buf;
freeSlot.position = entry.position;
freeSlot.buffer.position(freeSlot.position);
freeSlot.size = entry.size;
slots.add(freeSlot);
logger.debug("added slot of " + freeSlot.size + " bytes");
}
lruOffheapQueue.remove(entry);
usedMemory.addAndGet(-source.length);
lruQueue.remove(entry);
lruQueue.add(entry);
} catch (UTFDataFormatException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (StreamCorruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (EOFException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InstantiationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
split.stop();
}