Over-complicated hdfs routing logic