sadanand48 commented on code in PR #11896:
URL: https://github.com/apache/ozone/pull/11896#discussion_r4477296648
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataManagerImpl.java:
##########
@@ -317,7 +317,12 @@ protected OmMetadataManagerImpl(OzoneConfiguration conf,
File dir,
.setCreateCheckpointDirs(false)
.setEnableRocksDbMetrics(enableRocksDbMetrics)
.build();
- initializeOmTables(CacheType.PARTIAL_CACHE, false);
+ try {
+ initializeOmTables(CacheType.PARTIAL_CACHE, false);
+ } catch (IOException | RuntimeException e) {
Review Comment:
Could we avoid the runtime validation by preventing callers from passing an
incompatible cache type?
maybe something like getWithDbCache(definition), which always calls
definition.getTable(store, cacheType). Volume, bucket, and revoked-token tables
would use that method, so callers could no longer accidentally hardcode
FULL_CACHE for a partial-cache DB
A unit test can then verify that opening a snapshot/checkpoint DB never
creates a full-table cache which will alert at compile time if something is
wrong
--
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]