Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
Reviewed
Description
In FileSystemRMStateStore, we can refine some fs operations to improve performance:
1. There are several places invoke fs.exists, then fs.getFileStatus, we can merge them to save one RPC call
if (fs.exists(versionNodePath)) {
FileStatus status = fs.getFileStatus(versionNodePath);
2.
protected void updateFile(Path outputPath, byte[] data) throws Exception { Path newPath = new Path(outputPath.getParent(), outputPath.getName() + ".new"); // use writeFile to make sure .new file is created atomically writeFile(newPath, data); replaceFile(newPath, outputPath); }
The updateFile is not good too, it write file to output_file.tmp, then rename to output_file.new, then rename it to output_file, we can reduce one rename operation.
Also there is one unnecessary import, we can remove it.
Attachments
Attachments
Issue Links
- is duplicated by
-
YARN-3004 Fix missed synchronization in MemoryRMStateStore
- Closed