swamirishi commented on code in PR #9393:
URL: https://github.com/apache/ozone/pull/9393#discussion_r2591376089


##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/RDBTable.java:
##########
@@ -248,12 +248,24 @@ public void deleteBatchWithPrefix(BatchOperation batch, 
byte[] prefix)
   @Override
   public void dumpToFileWithPrefix(File externalFile, byte[] prefix)
       throws RocksDatabaseException, CodecException {
-    try (KeyValueIterator<byte[], byte[]> iter = iterator(prefix);
-         RDBSstFileWriter fileWriter = new RDBSstFileWriter(externalFile)) {
+    CodecBuffer prefixBuffer = prefix == null || prefix.length == 0 ? null :
+        CodecBufferCodec.get(true).fromPersistedFormat(prefix);
+    KeyValueIterator<CodecBuffer, CodecBuffer> iter;
+    try {
+      iter = iterator(prefixBuffer, KeyValueIterator.Type.KEY_AND_VALUE);
+    } catch (RocksDatabaseException e) {
+      if (prefixBuffer != null) {
+        prefixBuffer.close();
+      }

Review Comment:
   
https://github.com/apache/ozone/blob/48c985f8f65c9c0d99c2b3fadc74683f05c1efc7/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/RDBStoreCodecBufferIterator.java#L95
 the iterator would close it. I don't like the pattern either I will change 
this later in a follow up 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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to