commit | 3d990f05c546b2bf7ebfaa4a4372d4c64c936e7d | [log] [tgz] |
---|---|---|
author | hubailmor@gmail.com <mhubail@uci.edu> | Sat Jan 24 21:41:09 2015 -0800 |
committer | Ian Maxon <imaxon@uci.edu> | Tue Jan 27 13:22:18 2015 -0800 |
tree | 953314d51a03df779f3cd31f5e20b42510526d3e | |
parent | e1413cc9aa3d824f07637d5b3604e6fb524f04b6 [diff] |
Added a new method to switch LSM component state Change-Id: If4647e31c1a81e29093f84a26059b020508db7f6 Reviewed-on: http://fulliautomatix.ics.uci.edu:8443/208 Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu> Reviewed-by: abdullah alamoudi <bamousaa@gmail.com> Reviewed-by: Ian Maxon <imaxon@uci.edu>
diff --git a/hyracks/hyracks-storage-am-lsm-common/src/main/java/edu/uci/ics/hyracks/storage/am/lsm/common/impls/AbstractLSMIndex.java b/hyracks/hyracks-storage-am-lsm-common/src/main/java/edu/uci/ics/hyracks/storage/am/lsm/common/impls/AbstractLSMIndex.java index ccc1d38..ee03570 100644 --- a/hyracks/hyracks-storage-am-lsm-common/src/main/java/edu/uci/ics/hyracks/storage/am/lsm/common/impls/AbstractLSMIndex.java +++ b/hyracks/hyracks-storage-am-lsm-common/src/main/java/edu/uci/ics/hyracks/storage/am/lsm/common/impls/AbstractLSMIndex.java
@@ -25,6 +25,7 @@ import edu.uci.ics.hyracks.storage.am.common.api.ITreeIndex; import edu.uci.ics.hyracks.storage.am.common.api.ITreeIndexMetaDataFrame; import edu.uci.ics.hyracks.storage.am.lsm.common.api.ILSMComponent; +import edu.uci.ics.hyracks.storage.am.lsm.common.api.ILSMComponent.ComponentState; import edu.uci.ics.hyracks.storage.am.lsm.common.api.ILSMComponentFilterFrameFactory; import edu.uci.ics.hyracks.storage.am.lsm.common.api.ILSMHarness; import edu.uci.ics.hyracks.storage.am.lsm.common.api.ILSMIOOperationCallback; @@ -258,4 +259,8 @@ //check if the current memory component has been modified return !((AbstractMemoryLSMComponent) memoryComponents.get(currentMutableComponentId.get())).isModified(); } + + public void makeCurrentMutableComponentUnWritable() throws HyracksDataException { + ((AbstractMemoryLSMComponent) memoryComponents.get(currentMutableComponentId.get())).setState(ComponentState.READABLE_UNWRITABLE); + } }
diff --git a/hyracks/hyracks-storage-am-lsm-common/src/main/java/edu/uci/ics/hyracks/storage/am/lsm/common/impls/AbstractMemoryLSMComponent.java b/hyracks/hyracks-storage-am-lsm-common/src/main/java/edu/uci/ics/hyracks/storage/am/lsm/common/impls/AbstractMemoryLSMComponent.java index 2c59677..b86e98f 100644 --- a/hyracks/hyracks-storage-am-lsm-common/src/main/java/edu/uci/ics/hyracks/storage/am/lsm/common/impls/AbstractMemoryLSMComponent.java +++ b/hyracks/hyracks-storage-am-lsm-common/src/main/java/edu/uci/ics/hyracks/storage/am/lsm/common/impls/AbstractMemoryLSMComponent.java
@@ -161,6 +161,10 @@ public ComponentState getState() { return state; } + + public void setState(ComponentState state) { + this.state = state; + } public void setActive() { requestedToBeActive = true;