Rajesh Balamohan created HDDS-3703:
--------------------------------------

             Summary: Consider avoiding file lookup calls in writeChunk hotpath
                 Key: HDDS-3703
                 URL: https://issues.apache.org/jira/browse/HDDS-3703
             Project: Hadoop Distributed Data Store
          Issue Type: Improvement
            Reporter: Rajesh Balamohan
         Attachments: Screenshot 2020-06-02 at 5.28.59 PM.png

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.

 

!Screenshot 2020-06-02 at 5.28.59 PM.png|width=835,height=510!

 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to