It depends on where is inputTinyFile: if it is in local then you don't need HDFS, if it is on HDFS then you are right. In general HDSF should not contain small files and inputTinyFile is probably tiny (or this distributed cache join is a wrong job). That's why my advice was to use the Java API to check the file locally: I expect inputTinyFile to be local to the computer where this program is run, not on HDFS.

However there is a case when the inputTinyFile could be on HDFS: when it is the output of another job. For example, in [https://github.com/melrief/NaiveBayesIMDB](this implementation of Naive Bayes) the output of the training phase was small but on HDFS because it was the output of a mapreduce job. In that case your approach is the right one.