FoundationDB/sql-layer — pull request #1079 by nathanlws (2013-11-26 18:35:37+00:00)
Title: Fix TreeService Exchange caching

Two problems with the Tree/Exchange cache:
- Eviction only occurred if the underlying Tree was not valid, which only happens when trees are removed
- We never remove trees at runtime, only at startup
- There was no bound on the number of cache keys (Trees) or values per key (Exchanges)

Fix the former by alerting TreeService to a Store level removal, which busts the cache, and the latter by using an LRU for both the keys and values of the cache.

A new (trivial) class, LRUCache, that overrides the suggested LinkedHashMap methods comes with this. There were a couple other places using the same pattern so update them along with this.