smengcl commented on code in PR #9393:
URL: https://github.com/apache/ozone/pull/9393#discussion_r2591352212
##########
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:
Should `prefixBuffer` also be closed on success path?
--
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]