nicktelford commented on code in PR #14852: URL: https://github.com/apache/kafka/pull/14852#discussion_r1413187089
########## streams/src/main/java/org/apache/kafka/streams/state/internals/RocksDBTimestampedStore.java: ########## @@ -64,31 +62,14 @@ public RocksDBTimestampedStore(final String name, @Override void openRocksDB(final DBOptions dbOptions, final ColumnFamilyOptions columnFamilyOptions) { - final List<ColumnFamilyDescriptor> columnFamilyDescriptors = asList( - new ColumnFamilyDescriptor(RocksDB.DEFAULT_COLUMN_FAMILY, columnFamilyOptions), - new ColumnFamilyDescriptor("keyValueWithTimestamp".getBytes(StandardCharsets.UTF_8), columnFamilyOptions)); - final List<ColumnFamilyHandle> columnFamilies = new ArrayList<>(columnFamilyDescriptors.size()); - - try { - db = RocksDB.open(dbOptions, dbDir.getAbsolutePath(), columnFamilyDescriptors, columnFamilies); - setDbAccessor(columnFamilies.get(0), columnFamilies.get(1)); - } catch (final RocksDBException e) { - if ("Column family not found: keyValueWithTimestamp".equals(e.getMessage())) { - try { - db = RocksDB.open(dbOptions, dbDir.getAbsolutePath(), columnFamilyDescriptors.subList(0, 1), columnFamilies); - columnFamilies.add(db.createColumnFamily(columnFamilyDescriptors.get(1))); - } catch (final RocksDBException fatal) { - throw new ProcessorStateException("Error opening store " + name + " at location " + dbDir.toString(), fatal); - } - setDbAccessor(columnFamilies.get(0), columnFamilies.get(1)); - } else { - throw new ProcessorStateException("Error opening store " + name + " at location " + dbDir.toString(), e); - } - } - } + final List<ColumnFamilyHandle> columnFamilies = openRocksDB( + dbOptions, + new ColumnFamilyDescriptor(RocksDB.DEFAULT_COLUMN_FAMILY, columnFamilyOptions), + new ColumnFamilyDescriptor("keyValueWithTimestamp".getBytes(StandardCharsets.UTF_8), columnFamilyOptions) Review Comment: Any suggestions on the "one central place" to define them? This one only makes sense in RocksDBTimestampedStore, so defining them all in RocksDBStore may not make sense -- 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org