few hadoop helper functions