@Override protected boolean removeLRU(LinkEntry entry) { HTableInterface table = (HTableInterface) entry.getValue(); if (LOG.isDebugEnabled()) { LOG.debug("Closing connection to table: " + Bytes.toString(table.getTableName()) + " because it was evicted from the cache."); } try { table.close(); } catch (IOException e) { LOG.info("Failed to correctly close HTable: " + Bytes.toString(table.getTableName()) + " ignoring since being removed from queue."); } return true; } }
/** * Gets the first key in the map, which is the most recently inserted. * * @return the most recently inserted key */ public Object firstKey() { if (size == 0) { throw new NoSuchElementException("Map is empty"); } return header.after.getKey(); }
/** * Gets the value mapped to the key specified. * <p> * This operation changes the position of the key in the map to the * most recently used position (first). * * @param key the key * @return the mapped value, null if no match */ public Object get(Object key) { LinkEntry entry = (LinkEntry) getEntry(key); if (entry == null) { return null; } moveToMRU(entry); return entry.getValue(); }
/** * Gets the value mapped to the key specified. * <p> * This operation changes the position of the key in the map to the * most recently used position (first). * * @param key the key * @return the mapped value, null if no match */ public Object get(Object key) { LinkEntry entry = (LinkEntry) getEntry(key); if (entry == null) { return null; } moveToMRU(entry); return entry.getValue(); }
/** * Gets the value mapped to the key specified. * <p> * This operation changes the position of the key in the map to the * most recently used position (first). * * @param key the key * @return the mapped value, null if no match */ public Object get(Object key) { LinkEntry entry = (LinkEntry) getEntry(key); if (entry == null) { return null; } moveToMRU(entry); return entry.getValue(); }
public Object next() { return super.nextEntry().getValue(); }
/** * Creates an entry to store the data. * <p> * This implementation creates a new LinkEntry instance. * * @param next the next entry in sequence * @param hashCode the hash code to use * @param key the key to store * @param value the value to store * @return the newly created entry */ protected HashEntry createEntry(HashEntry next, int hashCode, Object key, Object value) { return new LinkEntry(next, hashCode, key, value); }
public Object next() { return super.nextEntry().getValue(); }
/** * Creates an entry to store the data. * <p> * This implementation creates a new LinkEntry instance. * * @param next the next entry in sequence * @param hashCode the hash code to use * @param key the key to store * @param value the value to store * @return the newly created entry */ protected HashEntry createEntry(HashEntry next, int hashCode, Object key, Object value) { return new LinkEntry(next, hashCode, key, value); }
public Object previous() { return super.previousEntry().getValue(); } }
public Object next() { return super.nextEntry().getValue(); }
public Object previous() { return super.previousEntry().getValue(); } }
public Object next() { return super.nextEntry().getValue(); }
/** * Creates an entry to store the data. * <p> * This implementation creates a new LinkEntry instance. * * @param next the next entry in sequence * @param hashCode the hash code to use * @param key the key to store * @param value the value to store * @return the newly created entry */ protected HashEntry createEntry(HashEntry next, int hashCode, Object key, Object value) { return new LinkEntry(next, hashCode, key, value); }
/** * Creates an entry to store the data. * <p> * This implementation creates a new LinkEntry instance. * * @param next the next entry in sequence * @param hashCode the hash code to use * @param key the key to store * @param value the value to store * @return the newly created entry */ protected HashEntry createEntry(HashEntry next, int hashCode, Object key, Object value) { return new LinkEntry(next, hashCode, key, value); }
public Object next() { return super.nextEntry().getValue(); }
/** * Creates an entry to store the data. * <p> * This implementation creates a new LinkEntry instance. * * @param next the next entry in sequence * @param hashCode the hash code to use * @param key the key to store * @param value the value to store * @return the newly created entry */ protected HashEntry createEntry(HashEntry next, int hashCode, Object key, Object value) { return new LinkEntry(next, hashCode, key, value); }
/** * Gets the key at the specified index. * * @param index the index to retrieve * @return the key at the specified index * @throws IndexOutOfBoundsException if the index is invalid */ public Object get(int index) { return getEntry(index).getKey(); }