peterxcli commented on code in PR #8173:
URL: https://github.com/apache/ozone/pull/8173#discussion_r2048509329
##########
hadoop-hdds/managed-rocksdb/src/main/java/org/apache/hadoop/hdds/utils/db/managed/ManagedColumnFamilyOptions.java:
##########
@@ -49,7 +50,9 @@ public synchronized ManagedColumnFamilyOptions
setTableFormatConfig(
if (!((ManagedBlockBasedTableConfig) previous).isClosed()) {
throw new IllegalStateException("Overriding an unclosed value.");
}
- } else if (previous != null) {
+ } else if (!(previous instanceof BlockBasedTableConfig) && previous !=
null) {
Review Comment:
```suggestion
} else if (previous != null && !(previous instanceof
BlockBasedTableConfig)) {
```
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/metadata/DatanodeSchemaThreeDBDefinition.java:
##########
@@ -110,17 +113,14 @@ public DatanodeSchemaThreeDBDefinition(String dbPath,
DatanodeDBProfile dbProfile = DatanodeDBProfile
.getProfile(config.getEnum(HDDS_DB_PROFILE, HDDS_DEFAULT_DB_PROFILE));
- ManagedColumnFamilyOptions cfOptions =
- dbProfile.getColumnFamilyOptions(config);
- // Use prefix seek to mitigating seek overhead.
- // See: https://github.com/facebook/rocksdb/wiki/Prefix-Seek
- cfOptions.useFixedLengthPrefixExtractor(getContainerKeyPrefixLength());
+ Path pathToDb = Paths.get(
+ config.get(HddsConfigKeys.DATANODE_DB_CONFIG_PATH,
HddsConfigKeys.DATANODE_DB_CONFIG_PATH_DEFAULT));
- BLOCK_DATA.setCfOptions(cfOptions);
- METADATA.setCfOptions(cfOptions);
- DELETE_TRANSACTION.setCfOptions(cfOptions);
- FINALIZE_BLOCKS.setCfOptions(cfOptions);
- LAST_CHUNK_INFO.setCfOptions(cfOptions);
+ BLOCK_DATA.setCfOptions(getCFOptions(config, dbProfile, pathToDb,
"block_data"));
Review Comment:
How about sharing those column families name as constant?
```java
final string BLOCK_DATA_TABLE = "block_data";
...
public static final DBColumnFamilyDefinition<String, BlockData>
BLOCK_DATA =
new DBColumnFamilyDefinition<>(
BLOCK_DATA_TABLE,
FixedLengthStringCodec.get(),
BlockData.getCodec());
...
BLOCK_DATA.setCfOptions(getCFOptions(config, dbProfile, pathToDb,
BLOCK_DATA_TABLE));
```
--
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]