You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2019/11/15 16:00:14 UTC

[GitHub] [hadoop-ozone] avijayanhwx commented on a change in pull request #162: HDDS-2473. Fix code reliability issues found by Sonar in Ozone Recon module.

avijayanhwx commented on a change in pull request #162: HDDS-2473. Fix code reliability issues found by Sonar in Ozone Recon module.
URL: https://github.com/apache/hadoop-ozone/pull/162#discussion_r346892730
 
 

 ##########
 File path: hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/spi/impl/OzoneManagerServiceProviderImpl.java
 ##########
 @@ -283,10 +281,12 @@ void getAndApplyDeltaUpdatesFromOM(
       LOG.debug("Number of updates received from OM : " +
           dbUpdates.getData().size());
       for (byte[] data : dbUpdates.getData()) {
-        WriteBatch writeBatch = new WriteBatch(data);
-        writeBatch.iterate(omdbUpdatesHandler);
-        RDBBatchOperation rdbBatchOperation = new RDBBatchOperation(writeBatch);
-        rdbBatchOperation.commit(rocksDB, new WriteOptions());
+        try (WriteBatch writeBatch = new WriteBatch(data)) {
+          writeBatch.iterate(omdbUpdatesHandler);
+          RDBBatchOperation rdbBatchOperation =
+              new RDBBatchOperation(writeBatch);
 
 Review comment:
   @adoroszlai I will be fixing this in the next sonar patch. 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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