Ian Maxon has uploaded a new change for review.
https://asterix-gerrit.ics.uci.edu/1438
Change subject: Fix overflow for dynamic parameter setting
......................................................................
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
---
M
asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/StorageProperties.java
1 file changed, 6 insertions(+), 8 deletions(-)
git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb
refs/changes/38/1438/1
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..59aba80 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
@@ -38,8 +38,7 @@
private static final String STORAGE_MEMORYCOMPONENT_NUMPAGES_KEY =
"storage.memorycomponent.numpages";
- private static final String STORAGE_METADATA_MEMORYCOMPONENT_NUMPAGES_KEY =
- "storage.metadata.memorycomponent.numpages";
+ private static final String STORAGE_METADATA_MEMORYCOMPONENT_NUMPAGES_KEY
= "storage.metadata.memorycomponent.numpages";
private static final int STORAGE_METADATA_MEMORYCOMPONENT_NUMPAGES_DEFAULT
= 256; // ... so 32MB components
private static final String STORAGE_MEMORYCOMPONENT_NUMCOMPONENTS_KEY =
"storage.memorycomponent.numcomponents";
@@ -47,8 +46,7 @@
private static final String STORAGE_MEMORYCOMPONENT_GLOBALBUDGET_KEY =
"storage.memorycomponent.globalbudget";
- private static final String STORAGE_LSM_BLOOMFILTER_FALSEPOSITIVERATE_KEY =
- "storage.lsm.bloomfilter.falsepositiverate";
+ private static final String STORAGE_LSM_BLOOMFILTER_FALSEPOSITIVERATE_KEY
= "storage.lsm.bloomfilter.falsepositiverate";
private static final double
STORAGE_LSM_BLOOMFILTER_FALSEPOSITIVERATE_DEFAULT = 0.01;
private final long storageBufferCacheSizeDefault;
@@ -66,8 +64,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
+ / (long) (16 * getMemoryComponentPageSize()));
}
@PropertyKey(STORAGE_BUFFERCACHE_PAGESIZE_KEY)
@@ -107,8 +105,8 @@
@PropertyKey(STORAGE_METADATA_MEMORYCOMPONENT_NUMPAGES_KEY)
public int getMetadataMemoryComponentNumPages() {
return
accessor.getProperty(STORAGE_METADATA_MEMORYCOMPONENT_NUMPAGES_KEY,
- STORAGE_METADATA_MEMORYCOMPONENT_NUMPAGES_DEFAULT,
- PropertyInterpreters.getIntegerPropertyInterpreter());
+ STORAGE_METADATA_MEMORYCOMPONENT_NUMPAGES_DEFAULT,
+ PropertyInterpreters.getIntegerPropertyInterpreter());
}
@PropertyKey(STORAGE_MEMORYCOMPONENT_NUMCOMPONENTS_KEY)
--
To view, visit https://asterix-gerrit.ics.uci.edu/1438
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I69d5e3f80916fc8525a0267abb4ca8ddabb73649
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Ian Maxon <[email protected]>