Github user selvaganesang commented on a diff in the pull request:
https://github.com/apache/trafodion/pull/1612#discussion_r197914060
--- Diff: core/sql/src/main/java/org/trafodion/sql/HDFSClient.java ---
@@ -359,36 +392,54 @@ int hdfsWrite(byte[] buff) throws IOException
logger_.debug("HDFSClient.hdfsWrite() - output stream created"
);
}
outStream_.write(buff);
+ if (outStream_ instanceof FSDataOutputStream)
+ ((FSDataOutputStream)outStream_).hsync();
if (logger_.isDebugEnabled())
logger_.debug("HDFSClient.hdfsWrite() - bytes written " +
buff.length);
return buff.length;
}
--- End diff --
Yes. . HdfsWriteImmediate used by LOB access. It needs the offset where the
write occurred. We could prevent the lob locking by doing write to hdfs file
first and then use this offset to write the chunk offset data to Trafodion desc
chunk table. This can avoid locking with some kind of smartness built into this
java method or at least limit the locking duration to this method alone.
---