sample code from Hadoop: The Definitive Guide