Fix overflow for dynamic parameter setting
If your memory was large enough (~16gb did it for me), the
calculation for the memory component size could overflow.
Change-Id: I69d5e3f80916fc8525a0267abb4ca8ddabb73649
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1438
Reviewed-by: Yingyi Bu <buyingyi@gmail.com>
Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
BAD: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/StorageProperties.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/StorageProperties.java
index fbaf0a7..faacc64 100644
--- a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/StorageProperties.java
+++ b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/StorageProperties.java
@@ -66,8 +66,8 @@
storageMemorycomponentGlobalbudgetDefault = maxHeapSize / 4;
// By default, uses 1/16 of the storageMemorycomponentGlobalbudgetDefault for the write buffer budget
// for a dataset, including data and indexes.
- storageMemoryComponentNumPages = (int) storageMemorycomponentGlobalbudgetDefault
- / (16 * getMemoryComponentPageSize());
+ storageMemoryComponentNumPages = (int) (storageMemorycomponentGlobalbudgetDefault
+ / (16 * getMemoryComponentPageSize()));
}
@PropertyKey(STORAGE_BUFFERCACHE_PAGESIZE_KEY)