lowered default global budget for memory components; propagate error if one occurs in MDBootstrap; change DSLifecycleManager to flush indexes when they close
diff --git a/asterix-common/src/main/java/edu/uci/ics/asterix/common/config/AsterixStorageProperties.java b/asterix-common/src/main/java/edu/uci/ics/asterix/common/config/AsterixStorageProperties.java
index 7fa552e..8ea64b8 100644
--- a/asterix-common/src/main/java/edu/uci/ics/asterix/common/config/AsterixStorageProperties.java
+++ b/asterix-common/src/main/java/edu/uci/ics/asterix/common/config/AsterixStorageProperties.java
@@ -18,7 +18,7 @@
private static final int STORAGE_MEMORYCOMPONENT_NUMPAGES_DEFAULT = 1024; // ... so 32MB components
private static final String STORAGE_MEMORYCOMPONENT_GLOBALBUDGET_KEY = "storage.memorycomponent.globalbudget";
- private static final long STORAGE_MEMORYCOMPONENT_GLOBALBUDGET_DEFAULT = 536870192; // 512MB
+ private static final long STORAGE_MEMORYCOMPONENT_GLOBALBUDGET_DEFAULT = 536870912; // 512MB
private static final String STORAGE_LSM_MERGETHRESHOLD_KEY = "storage.lsm.mergethreshold";
private static int STORAGE_LSM_MERGETHRESHOLD_DEFAULT = 3;
diff --git a/asterix-common/src/main/java/edu/uci/ics/asterix/common/context/DatasetLifecycleManager.java b/asterix-common/src/main/java/edu/uci/ics/asterix/common/context/DatasetLifecycleManager.java
index 975f320..5808d3a 100644
--- a/asterix-common/src/main/java/edu/uci/ics/asterix/common/context/DatasetLifecycleManager.java
+++ b/asterix-common/src/main/java/edu/uci/ics/asterix/common/context/DatasetLifecycleManager.java
@@ -11,6 +11,7 @@
import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
import edu.uci.ics.hyracks.storage.am.common.api.IIndex;
import edu.uci.ics.hyracks.storage.am.common.api.IIndexLifecycleManager;
+import edu.uci.ics.hyracks.storage.am.lsm.common.api.ILSMIndex;
import edu.uci.ics.hyracks.storage.am.lsm.common.api.IVirtualBufferCache;
import edu.uci.ics.hyracks.storage.am.lsm.common.impls.MultitenantVirtualBufferCache;
import edu.uci.ics.hyracks.storage.am.lsm.common.impls.VirtualBufferCache;
@@ -59,7 +60,7 @@
throw new HyracksDataException("Index with resource ID " + resourceID + " already exists.");
}
datasetInfos.put(did, dsInfo);
- dsInfo.indexes.put(resourceID, new IndexInfo(index));
+ dsInfo.indexes.put(resourceID, new IndexInfo((ILSMIndex) index));
}
private int getDIDfromRID(long resourceID) throws HyracksDataException {
@@ -85,20 +86,18 @@
}
if (iInfo.isOpen) {
- iInfo.index.deactivate();
+ iInfo.index.deactivate(true);
}
- if (dsInfo.referenceCount == 0) {
- if (dsInfo.isOpen) {
- for (IndexInfo i : dsInfo.indexes.values()) {
- i.index.deactivate();
- }
+ if (dsInfo.referenceCount == 0 && dsInfo.isOpen) {
+ for (IndexInfo i : dsInfo.indexes.values()) {
+ i.index.deactivate(true);
}
- datasetInfos.remove(did);
IVirtualBufferCache vbc = getVirtualBufferCache(did);
assert vbc != null;
used -= (vbc.getNumPages() * vbc.getPageSize());
}
+ datasetInfos.remove(did);
}
@Override
@@ -145,7 +144,7 @@
if (dsInfo.referenceCount == 0 && dsInfo.isOpen) {
for (IndexInfo iInfo : dsInfo.indexes.values()) {
if (iInfo.isOpen) {
- iInfo.index.deactivate();
+ iInfo.index.deactivate(true);
iInfo.isOpen = false;
}
assert iInfo.referenceCount == 0;
@@ -218,9 +217,9 @@
}
private static class IndexInfo extends Info {
- private IIndex index;
+ private ILSMIndex index;
- public IndexInfo(IIndex index) {
+ public IndexInfo(ILSMIndex index) {
this.index = index;
}
}
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/bootstrap/MetadataBootstrap.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/bootstrap/MetadataBootstrap.java
index d833a13..d68ce33 100644
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/bootstrap/MetadataBootstrap.java
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/bootstrap/MetadataBootstrap.java
@@ -204,6 +204,7 @@
//change the exception type to AbortFailureException
throw new MetadataException(e);
}
+ throw e;
}
}