I have a big jar package to install to my hdfs cluster, however I don't want to install it twice if I have ever installed it before, so it need a method to judge whether the jar package in the hdfs is the same as my local one. I want to use checksum to solve this problem. My code is like:
val fs = FileSystem.get(conf)
val lfs = FileSystem.getLocal(conf);
val localchecksum = lfs.getFileChecksum(src)
val hdfschecksum = fs.getFileChecksum(dst)
if(!localchecksum.equals(hdfschecksum)){
//upload the jar file
}
Unfortunately, the LocalFileSystem does not implement getFileChecksum, and return null by default, so my code does not work anymore. So, how can I judge whether the jar file is already in the hdfs cluster, any method is welcome.