Skip to content

Commit

Permalink
HDDS-9778. Disable rocksDB cache for snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
swamirishi committed Nov 27, 2023
1 parent 36a23f9 commit 5c01264
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ private OmMetadataManagerImpl(OzoneConfiguration conf, File dir, String name)
omEpoch = 0;
setStore(loadDB(conf, dir, name, true,
java.util.Optional.of(Boolean.TRUE), Optional.empty()));
initializeOmTables(false);
initializeOmTables(CacheType.FULL_CACHE, false);
}


Expand Down Expand Up @@ -413,7 +413,7 @@ private OmMetadataManagerImpl(OzoneConfiguration conf, File dir, String name)
setStore(loadDB(conf, metaDir, dbName, false,
java.util.Optional.of(Boolean.TRUE),
Optional.of(maxOpenFiles), false, false));
initializeOmTables(false);
initializeOmTables(CacheType.PARTIAL_CACHE, false);
} catch (IOException e) {
stop();
throw e;
Expand Down Expand Up @@ -557,7 +557,7 @@ public void start(OzoneConfiguration configuration) throws IOException {

this.store = loadDB(configuration, metaDir);

initializeOmTables(true);
initializeOmTables(CacheType.FULL_CACHE, true);
}

snapshotChainManager = new SnapshotChainManager(this);
Expand Down Expand Up @@ -652,15 +652,14 @@ public static DBStoreBuilder addOMTablesAndCodecs(DBStoreBuilder builder) {
*
* @throws IOException
*/
protected void initializeOmTables(boolean addCacheMetrics)
protected void initializeOmTables(CacheType cacheType,
boolean addCacheMetrics)
throws IOException {
userTable =
this.store.getTable(USER_TABLE, String.class,
PersistedUserVolumeInfo.class);
checkTableStatus(userTable, USER_TABLE, addCacheMetrics);

CacheType cacheType = CacheType.FULL_CACHE;

volumeTable =
this.store.getTable(VOLUME_TABLE, String.class, OmVolumeArgs.class,
cacheType);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import org.apache.hadoop.hdds.utils.db.RDBStore;
import org.apache.hadoop.hdds.utils.db.Table;
import org.apache.hadoop.hdds.utils.db.TableIterator;
import org.apache.hadoop.hdds.utils.db.cache.TableCache;
import org.apache.hadoop.ozone.om.OmMetadataManagerImpl;
import org.apache.hadoop.hdds.utils.db.DBStore;
import org.apache.hadoop.hdds.utils.db.DBStoreBuilder;
Expand Down Expand Up @@ -109,7 +110,7 @@ private void initializeNewRdbStore(File dbFile) throws IOException {
LOG.error("Unable to initialize Recon OM DB snapshot store.", ioEx);
}
if (getStore() != null) {
initializeOmTables(true);
initializeOmTables(TableCache.CacheType.FULL_CACHE, true);
omTablesInitialized = true;
}
}
Expand Down

0 comments on commit 5c01264

Please sign in to comment.