// get tmp file URI
Path tmpURI = getExecContext().getLocalWork().getTmpPath();
LOG.info("Temp URI for side table: " + tmpURI);
for (byte tag = 0; tag < mapJoinTables.length; tag++) {
// get the key and value
MapJoinTableContainer tableContainer = mapJoinTables[tag];
if (tableContainer == null) {
continue;
}
// get current input file name
String bigBucketFileName = getExecContext().getCurrentBigBucketFile();
String fileName = getExecContext().getLocalWork().getBucketFileName(bigBucketFileName);
// get the tmp URI path; it will be a hdfs path if not local mode
String dumpFilePrefix = conf.getDumpFilePrefix();
Path path = Utilities.generatePath(tmpURI, dumpFilePrefix, tag, fileName);
console.printInfo(Utilities.now() + "\tDump the side-table into file: " + path);
// get the hashtable file and path
FileSystem fs = path.getFileSystem(hconf);
ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(fs.create(path), 4096));
try {
mapJoinTableSerdes[tag].persist(out, tableContainer);
} finally {
out.close();
}
tableContainer.clear();
FileStatus status = fs.getFileStatus(path);
console.printInfo(Utilities.now() + "\tUploaded 1 File to: " + path +
" (" + status.getLen() + " bytes)");
}
}