reading a file from HDFS only after it is fully written and closed
问题 I have two processes running. One is writing files to an HDFS and the other is loading those files. The first process (The one that writes the file) is using: private void writeFileToHdfs(byte[] sourceStream, Path outFilePath) { FSDataOutputStream out = null; try { // create the file out = getFileSystem().create(outFilePath); out.write(sourceStream); } catch (Exception e) { LOG.error("Error while trying to write a file to hdfs", e); } finally { try { if (null != out) out.close(); } catch