use of org.apache.hyracks.storage.am.lsm.common.api.ILSMComponentFilterReference in project asterixdb by apache.
the class LSMComponentFilterManager method writeFilter.
@Override
public void writeFilter(ILSMComponentFilter filter, ITreeIndex treeIndex) throws HyracksDataException {
IMetadataPageManager treeMetaManager = (IMetadataPageManager) treeIndex.getPageManager();
ILSMComponentFilterReference filterFrame = filterFrameFactory.createFrame();
try {
if (filter.getMinTuple() != null) {
filterFrame.writeMinTuple(filter.getMinTuple());
}
if (filter.getMaxTuple() != null) {
filterFrame.writeMaxTuple(filter.getMaxTuple());
}
} finally {
treeMetaManager.put(treeMetaManager.createMetadataFrame(), FILTER_KEY, filterFrame);
}
}
use of org.apache.hyracks.storage.am.lsm.common.api.ILSMComponentFilterReference in project asterixdb by apache.
the class LSMComponentFilterManager method readFilter.
@Override
public boolean readFilter(ILSMComponentFilter filter, ITreeIndex treeIndex) throws HyracksDataException {
IMetadataPageManager treeMetaManager = (IMetadataPageManager) treeIndex.getPageManager();
ILSMComponentFilterReference filterFrame = filterFrameFactory.createFrame();
treeMetaManager.get(treeMetaManager.createMetadataFrame(), FILTER_KEY, filterFrame);
// TODO: Filters never have one of min/max set and the other not
if (!filterFrame.isMinTupleSet() || !filterFrame.isMaxTupleSet()) {
return false;
}
List<ITupleReference> filterTuples = new ArrayList<>();
filterTuples.add(filterFrame.getMinTuple());
filterTuples.add(filterFrame.getMaxTuple());
updateFilter(filter, filterTuples);
return true;
}
Aggregations