/** * Adds entry address to LRU queue. * * @param part Entry Entry partition. * @param addr Entry address. * @param hash Entry hash code. * @return Queue node address. * @throws GridOffHeapOutOfMemoryException If failed. */ long offer(int part, long addr, int hash) throws GridOffHeapOutOfMemoryException { return lrus[incrementAndGet(addIdx, maxIdxCnt)].offer(part, addr, hash); }
/** * Marks oldest node from the queue as {@code polling}. * * @return Queue node address. */ long prePoll() { int idx = incrementAndGet(rmvIdx, maxIdxCnt); // Must try to poll from each LRU. for (int i = 0; i < lrus.length; i++) { long qAddr = lrus[(idx + i) % cnt].prePoll(); if (qAddr != 0) return qAddr; } return 0; }
/** * Adds entry address to LRU queue. * * @param part Entry Entry partition. * @param addr Entry address. * @param hash Entry hash code. * @return Queue node address. * @throws GridOffHeapOutOfMemoryException If failed. */ long offer(int part, long addr, int hash) throws GridOffHeapOutOfMemoryException { return lrus[incrementAndGet(addIdx, maxIdxCnt)].offer(part, addr, hash); }
/** * Marks oldest node from the queue as {@code polling}. * * @return Queue node address. */ long prePoll() { int idx = incrementAndGet(rmvIdx, maxIdxCnt); // Must try to poll from each LRU. for (int i = 0; i < lrus.length; i++) { long qAddr = lrus[(idx + i) % cnt].prePoll(); if (qAddr != 0) return qAddr; } return 0; }