Support generic Hadoop Compatible Filesystem (short version)

This is a short version of #388.
are these two number related? if yes, using one variable should be better avoid potential consistency issue.