Skip to content

Commit

Permalink
MB-41599: Add config for plasma in memory compression
Browse files Browse the repository at this point in the history
Change-Id: I81cc2f3c3c453fcb72a3ad8f03a40482d066db3f
  • Loading branch information
akhilmd committed Dec 23, 2020
1 parent 7deb408 commit 054d52d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
14 changes: 14 additions & 0 deletions secondary/common/config.go
Expand Up @@ -1277,6 +1277,13 @@ var SystemConfig = Config{
false, // mutable
false, // case-insensitive
},
"indexer.plasma.mainIndex.enableInMemoryCompression": ConfigValue{
false,
"Enable compression of memory resident items",
false,
false, // mutable
false, // case-insensitive
},
"indexer.plasma.mainIndex.enablePageBloomFilter": ConfigValue{
false,
"Enable maintenance and use of bloom filter for lookup of swapped out items",
Expand Down Expand Up @@ -1389,6 +1396,13 @@ var SystemConfig = Config{
false, // mutable
false, // case-insensitive
},
"indexer.plasma.backIndex.enableInMemoryCompression": ConfigValue{
false,
"Enable compression of memory resident items",
false,
false, // mutable
false, // case-insensitive
},
"indexer.plasma.backIndex.enablePageBloomFilter": ConfigValue{
false,
"Enable maintenance and use of bloom filter for lookup of swapped out items",
Expand Down
6 changes: 6 additions & 0 deletions secondary/indexer/plasma_slice.go
Expand Up @@ -363,6 +363,7 @@ func (slice *plasmaSlice) initStores() error {
mCfg.EnablePageBloomFilter = slice.sysconf["plasma.mainIndex.enablePageBloomFilter"].Bool()
mCfg.BloomFilterFalsePositiveRate = slice.sysconf["plasma.mainIndex.bloomFilterFalsePositiveRate"].Float64()
mCfg.BloomFilterExpectedMaxItems = slice.sysconf["plasma.mainIndex.bloomFilterExpectedMaxItems"].Uint64()
mCfg.EnableInMemoryCompression = slice.sysconf["plasma.mainIndex.enableInMemoryCompression"].Bool()

bCfg.MaxDeltaChainLen = slice.sysconf["plasma.backIndex.maxNumPageDeltas"].Int()
bCfg.MaxPageItems = slice.sysconf["plasma.backIndex.pageSplitThreshold"].Int()
Expand All @@ -381,6 +382,7 @@ func (slice *plasmaSlice) initStores() error {
bCfg.EnablePageBloomFilter = slice.sysconf["plasma.backIndex.enablePageBloomFilter"].Bool()
bCfg.BloomFilterFalsePositiveRate = slice.sysconf["plasma.backIndex.bloomFilterFalsePositiveRate"].Float64()
bCfg.BloomFilterExpectedMaxItems = slice.sysconf["plasma.backIndex.bloomFilterExpectedMaxItems"].Uint64()
bCfg.EnableInMemoryCompression = slice.sysconf["plasma.backIndex.enableInMemoryCompression"].Bool()

if slice.hasPersistence {
mCfg.File = filepath.Join(slice.path, "mainIndex")
Expand Down Expand Up @@ -2272,6 +2274,8 @@ func (mdb *plasmaSlice) UpdateConfig(cfg common.Config) {
mdb.mainstore.StatsLoggerFileSize = cfg["plasma.stats.logger.fileSize"].Uint64()
mdb.mainstore.StatsLoggerFileCount = cfg["plasma.stats.logger.fileCount"].Uint64()

mdb.mainstore.EnableInMemoryCompression = mdb.sysconf["plasma.mainIndex.enableInMemoryCompression"].Bool()

mdb.mainstore.UpdateConfig()

if !mdb.isPrimary {
Expand Down Expand Up @@ -2315,6 +2319,8 @@ func (mdb *plasmaSlice) UpdateConfig(cfg common.Config) {
mdb.backstore.StatsLoggerFileSize = cfg["plasma.stats.logger.fileSize"].Uint64()
mdb.backstore.StatsLoggerFileCount = cfg["plasma.stats.logger.fileCount"].Uint64()

mdb.backstore.EnableInMemoryCompression = mdb.sysconf["plasma.backIndex.enableInMemoryCompression"].Bool()

mdb.backstore.UpdateConfig()
}
mdb.maxRollbacks = cfg["settings.plasma.recovery.max_rollbacks"].Int()
Expand Down

0 comments on commit 054d52d

Please sign in to comment.