Uploaded image for project: 'Apache Ozone'
  1. Apache Ozone
  2. HDDS-3703

Consider avoiding file lookup calls in writeChunk hotpath

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0.0
    • Component/s: None
    • Target Version/s:

      Description

      In getChunkFile internally, it invokes "verifyChunkDirExists". This causes file existence checks for the directory and throws IO exception accordingly. If the file is anyways going to be written, it is better to handle it later and throw the same exception. This could avoid file checks for every "writechunk"

      https://github.com/apache/hadoop-ozone/blob/master/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/impl/FilePerBlockStrategy.java#L106

       

      File channels are cached anyways in "OpenFiles". So if we can avoid "file.getAbsolutePath()", this could save memory and resolving paths. 

      https://github.com/apache/hadoop-ozone/blob/master/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/impl/FilePerBlockStrategy.java#L118

       

      Also "validateChunkForOverwrite" can be optimised, as "isOverWritePermitted" would be false most of the times.

       

       

        Attachments

        1. Screenshot 2020-06-02 at 5.28.59 PM.png
          668 kB
          Rajesh Balamohan

          Issue Links

            Activity

              People

              • Assignee:
                adoroszlai Attila Doroszlai
                Reporter:
                rajesh.balamohan Rajesh Balamohan
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: