Adding New Currency in Java 8

If you are using the java.lang.Currency as part of your entity, most likely you are already regretting it now. Most of the time, a currency is a three letter word, and we don’t need the logic to be bundled in there. Keeping things simple and mapping these currencies as a String or own custom class is the way to go. For people who did use java.lang.Currency, the pain will arrive when a country changed its currency or added a new one.
Read more →

Why Datanode is Denied Communication With Namenode

So for those trying to setup HDFS out there, and are struggling with this kind of error where it said datanode denied communication with namenode: 2015-05-07 08:04:19,694 INFO org.apache.hadoop.hdfs.server.datanode.DataNode: Block pool BP-1184863888-172.17.0.3-1430984962919 (Datanode Uuid null) service to dockernamenode.zanox.com/172.17.0.3:8020 beginning handshake with NN 2015-05-07 08:04:19,697 ERROR org.apache.hadoop.hdfs.server.datanode.DataNode: Initialization failed for Block pool BP-1184863888-172.17.0.3-1430984962919 (Datanode Uuid null) service to dockernamenode.zanox.com/172.17.0.3:8020 Datanode denied communication with namenode because hostname cannot be resolved (ip=172.17.0.5, hostname=172.17.0.5): DatanodeRegistration(0.
Read more →