HAMA-612 - adapted Ikhtiyor Ahmedov patch to latest trunk, thanks Ikhtiyor

git-svn-id: https://svn.apache.org/repos/asf/hama/trunk@1558747 13f79535-47bb-0310-9956-ffa450edef68