Netflix/EVCache — pull request #11 by pauloricardomg (2013-09-18 23:22:20+00:00)
Title: Interface additions for increased testability and semi-compatibility with spymemcached client.

This PR adds some features to EVCache's interfaces, mostly to keep EVCache's interface semi-compatible with spymemcached, allowing users to make a smoother transition between spymemcached and evcache clients.

The additions on this PR include:
* *EVCacheException:* Turned into a RuntimeException.
* *Reasoning*: Since EVCacheException is thrown by nearly all methods of *com.netflix.evcache.EVCache*, it forces clients to surround EVCache's method calls in a "try catch", even if the "throw.exception" property is set to false (fast failure mode).

* *EVCacheClientPool:* Added method getLocalZone().
* *Reasoning*: Allows clients of Zone-based EVCacheClientPool to easily retrieve the local zone.

* *EVCacheClientPoolManager:* Added destroy(appName) method.
* *Reasoning*: the main reason for this change is to improve testability, since shutting down a pool managed by EVCacheClientPoolManager prevents a new EVCacheClientPool to be instantiated (in a subsequent test, for example). So, the destroy(appName) basically shutdowns an app's pool and remove it from the list of pools managed by the EVCacheClientPoolManager.

* *EVCacheClient:* Added proxy methods to support (spy)MemcachedClient methods: getUnavailableServers(), getAvailableServers(), flush(), getStats(), shutdown().
* *Reasoning*: semi-compatibility between EVCacheClient and MemCachedClient.

* *EVCache:* added support to auxiliar methods that will aid in testing and administration (flushAll(), shutdown(), getTranscoder(), getLocalAvailableServers(), getLocalUnavailableServers(), getLocalStats())
* *Reasoning*: testability and semi-compatibility between EVCache and MemCachedClient.