in source/benchmark-sample/tpcds-gen/src/main/java/org/notmysock/tpcds/GenTable.java [113:130]
public Path copyJar(File jar) throws Exception {
MessageDigest md = MessageDigest.getInstance("MD5");
InputStream is = new FileInputStream(jar);
try {
is = new DigestInputStream(is, md);
// read stream to EOF as normal...
}
finally {
is.close();
}
BigInteger md5 = new BigInteger(md.digest());
String md5hex = md5.toString(16);
Path dst = new Path(String.format("/tmp/%s.jar",md5hex));
Path src = new Path(jar.toURI());
FileSystem fs = FileSystem.get(getConf());
fs.copyFromLocalFile(false, /*overwrite*/true, src, dst);
return dst;
}