Guava Overview. Part 2 Andrei Savu / Bucharest JUG #2 asavu @ axemblr.com
About meFounding Partner @ Axemblr.comApache Whirr PMC Memberjclouds committerConnect with me on LinkedIn
@ AxemblrBuilding a tool and a platform for managingApache Hadoop clusters on cloud infrastructureAxemblr Tool for Cloudera CDH3 http://axemblr.com/toolAxemblr Service for Apache Hadoop http://axemblr.com/service
Plan● What is Guava?● Caches● Concurrency Services
What is Guava?Open-source version of Googles core Javalibraries[...] carefully designed, tested, optimized andused in production at GoogleYou dont need to write them, test them, oroptimize them: you can just use them.
What is Guava? (cont)Battle-tested in production at GoogleStaggering numbers of unit tests. >110.000 asof January 2012 (generated)Lives near the bottom of the stack, right on topof the JDK itself
What is this?Object with operational stateStart and stop methodsE.g. web servers, RPC servers, timers etc.Non-trivial if multiple threads are involved.
Lifecycle● Service.State.NEW to● Service.State.STARTING to● Service.State.RUNNING to● Service.State.STOPPING to● Service.State.TERMINATEDOn failure:● Service.State.FAILEDA stopped service may not be restarted.