muralibasani commented on code in PR #21751:
URL: https://github.com/apache/kafka/pull/21751#discussion_r2933452393
##########
streams/src/main/java/org/apache/kafka/streams/state/internals/RocksDBMigratingSessionStoreWithHeaders.java:
##########
@@ -67,24 +67,34 @@ void openRocksDB(final DBOptions dbOptions,
final ColumnFamilyHandle withHeadersColumnFamily =
columnFamilies.get(1);
final ColumnFamilyHandle offsetsCf = columnFamilies.get(2);
- final RocksIterator noHeadersIter =
db.newIterator(noHeadersColumnFamily);
- noHeadersIter.seekToFirst();
- if (noHeadersIter.isValid()) {
- log.info("Opening store {} in upgrade mode", name);
- cfAccessor = new DualColumnFamilyAccessor(
- offsetsCf,
- noHeadersColumnFamily,
- withHeadersColumnFamily,
- HeadersBytesStore::convertToHeaderFormat,
- this,
- open
- );
- } else {
- log.info("Opening store {} in regular mode", name);
- cfAccessor = new SingleColumnFamilyAccessor(offsetsCf,
withHeadersColumnFamily);
- noHeadersColumnFamily.close();
+ boolean success = false;
+ try {
+ try (final RocksIterator noHeadersIter =
db.newIterator(noHeadersColumnFamily)) {
Review Comment:
updating here with try-with resources
--
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]