* @param uuid the key.
* @param reader the index reader from where the document number was read.
* @param n the document number.
*/
void put(String uuid, CachingIndexReader reader, int n) {
LRUMap cacheSegment = docNumbers[getSegmentIndex(uuid.charAt(0))];
synchronized (cacheSegment) {
Entry e = (Entry) cacheSegment.get(uuid);
if (e != null) {
// existing entry
// ignore if reader is older than the one in entry
if (reader.getCreationTick() <= e.reader.getCreationTick()) {
if (log.isDebugEnabled()) {
log.debug("Ignoring put(). New entry is not from a newer reader. " +
"existing: " + e.reader.getCreationTick() +
", new: " + reader.getCreationTick());
}
e = null;
}
} else {
// entry did not exist
e = new Entry(reader, n);
}
if (e != null) {
cacheSegment.put(uuid, e);
}
}
}