String storeName = storeDef.getName();
Environment environment = environments.get(storeName);
// change reservation amount of reserved store
if(!unreservedStores.contains(environment) && storeDef.hasMemoryFootprint()) {
EnvironmentMutableConfig mConfig = environment.getMutableConfig();
long currentCacheSize = mConfig.getCacheSize();
long newCacheSize = storeDef.getMemoryFootprintMB() * ByteUtils.BYTES_PER_MB;
if(currentCacheSize != newCacheSize) {
long newReservedCacheSize = this.reservedCacheSize - currentCacheSize
+ newCacheSize;
// check that we leave a 'minimum' shared cache
if((voldemortConfig.getBdbCacheSize() - newReservedCacheSize) < voldemortConfig.getBdbMinimumSharedCache()) {
throw new StorageInitializationException("Reservation of "
+ storeDef.getMemoryFootprintMB()
+ " MB for store "
+ storeName
+ " violates minimum shared cache size of "
+ voldemortConfig.getBdbMinimumSharedCache());
}
this.reservedCacheSize = newReservedCacheSize;
adjustCacheSizes();
mConfig.setCacheSize(newCacheSize);
environment.setMutableConfig(mConfig);
logger.info("Setting private cache for store " + storeDef.getName() + " to "
+ newCacheSize);
}
} else {