You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "jojochuang (via GitHub)" <gi...@apache.org> on 2025/04/01 06:20:28 UTC
Re: [PR] HDDS-12484. Allow ini files to configure ColumnFamilyOptions for rocksDB [ozone]
jojochuang commented on code in PR #8173:
URL: https://github.com/apache/ozone/pull/8173#discussion_r2021892755
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/utils/db/DatanodeDBProfile.java:
##########
@@ -115,34 +114,28 @@ private StorageBasedProfile(DBProfile profile) {
baseProfile = profile;
}
- private ManagedDBOptions getDBOptions() {
- return baseProfile.getDBOptions();
+ private ManagedDBOptions getDBOptions(Path dbPath) {
+ return baseProfile.getDBOptions(dbPath);
}
private ManagedColumnFamilyOptions getColumnFamilyOptions(
- ConfigurationSource config) {
+ ConfigurationSource config, Path pathToDb, String cfName) {
final MemoizedSupplier<ManagedColumnFamilyOptions> supplier =
- MemoizedSupplier.valueOf(() -> createColumnFamilyOptions(config));
+ MemoizedSupplier.valueOf(() -> {
+ ManagedColumnFamilyOptions options =
+ baseProfile.getColumnFamilyOptions(pathToDb, cfName);
+ options.setReused(true);
+ return options.closeAndSetTableFormatConfig(
+ getBlockBasedTableConfig(pathToDb, cfName, config));
+ });
Review Comment:
Probably just me but it seems retaining createColumnFamilyOptions() is a better idea.
##########
hadoop-hdds/managed-rocksdb/src/main/java/org/apache/hadoop/hdds/utils/db/managed/ManagedBlockBasedTableConfig.java:
##########
@@ -69,4 +69,37 @@ public void close() {
}
}
}
+
+ public synchronized ManagedBlockBasedTableConfig setAllProperties(
Review Comment:
is there a better way to manage this? If a new rocksdb BlockBasedTableConfig field is introduced in the later versions, this is going to break.
##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/RocksDatabase.java:
##########
@@ -139,8 +139,8 @@ public static List<byte[]> listColumnFamiliesEmptyOptions(final String path)
}
static RocksDatabase open(File dbFile, ManagedDBOptions dbOptions,
- ManagedWriteOptions writeOptions, Set<TableConfig> families,
- boolean readOnly) throws IOException {
+ ManagedWriteOptions writeOptions, Set<TableConfig> families,
+ boolean readOnly) throws IOException {
Review Comment:
```suggestion
ManagedWriteOptions writeOptions, Set<TableConfig> families,
boolean readOnly) throws IOException {
```
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org