bharatviswa504 opened a new pull request #654: HDDS-3150. 
URL: https://github.com/apache/hadoop-ozone/pull/654
 
 
   ## What changes were proposed in this pull request?
   
   Implement getIfExist in Table and use it in CreateKey/File
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-3150
   
   ## How was this patch tested?
   
   Added UT.
   And also deployed this fix on a laptop and ran to benchmark.
   
   **Using db.getIfExist**
   ```
   $ support-tools-0.1.0-SNAPSHOT/bin/ozone-tools benchmark om write -d=35m 
-w=50
   Final Stats!
   Time elapsed: 2100 sec.
   Number of Threads: 50
   Number of Keys written: 6335987
   Average Key write time (CPU Time): 16.5624 milliseconds. 
   Average Key write time (Real): .3312 milliseconds. 
   Max Key write time (CPU Time): 558 milliseconds.
   ****************************************************************
   ```
   
   
   Metrics
   So, out of 6.33 million calls of getIfExist, only 15599 calls performed 
db.get and all those are misses. So, it proves that using db.getIfExist in a 
negative case is better.
   "NumDBKeyGetIfExistChecks": 6335987, (Total calls to API)
   
   "NumDBKeyGetIfExistMisses": 15599, (keyMay Exist returned true, we call 
db.get, this metric value says how many times we called db.get())
   
   "NumDBKeyGetIfExistGets": 15599 (keyMay Exist returned true, we called 
db.get(), but turns out that db.get() returns null, so this is a miss where 
keyMayExist was not able to find out correctly)
   
   
   **Without getIfExist**
   ```
   $ support-tools-0.1.0-SNAPSHOT/bin/ozone-tools benchmark om write -d=60m 
-w=50
   ================================================================
   2020-03-09T14:06:33.169
   ================================================================
   Time elapsed: 2100 sec.
   Number of Threads: 50
   Number of Keys written: 5815634
   Average Key write time (CPU Time): 18.0492 milliseconds. 
   Average Key write time (Real): .3610 milliseconds. 
   Max Key write time (CPU Time): 1080 milliseconds.
   ****************************************************************
   ```
   
   **Conclusion:**
   With getIfExists: 
   6335987 Keys created in 35 mts 
   Throughput: 3017 keys/sec
   With get:
   5815634 Keys created in 35 mts 
   Throughput: 2769 keys/sec
   
   
   
   
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: ozone-issues-h...@hadoop.apache.org

Reply via email to