Search in sources :

Example 1 with RTree

use of org.apache.hyracks.storage.am.rtree.impls.RTree in project asterixdb by apache.

the class LSMRTreeWithAntiMatterTuples method clearDiskComponent.

@Override
protected void clearDiskComponent(ILSMDiskComponent c) throws HyracksDataException {
    RTree rtree = ((LSMRTreeDiskComponent) c).getRTree();
    rtree.deactivate();
    rtree.destroy();
}
Also used : RTree(org.apache.hyracks.storage.am.rtree.impls.RTree)

Example 2 with RTree

use of org.apache.hyracks.storage.am.rtree.impls.RTree in project asterixdb by apache.

the class LSMRTreeWithAntiMatterTuples method deactivateDiskComponent.

@Override
protected void deactivateDiskComponent(ILSMDiskComponent c) throws HyracksDataException {
    RTree rtree = ((LSMRTreeDiskComponent) c).getRTree();
    rtree.deactivateCloseHandle();
}
Also used : RTree(org.apache.hyracks.storage.am.rtree.impls.RTree)

Example 3 with RTree

use of org.apache.hyracks.storage.am.rtree.impls.RTree in project asterixdb by apache.

the class LSMRTreeWithAntiMatterTuples method markAsValid.

@Override
public void markAsValid(ILSMDiskComponent lsmComponent) throws HyracksDataException {
    RTree rtree = ((LSMRTreeDiskComponent) lsmComponent).getRTree();
    markAsValidInternal(rtree);
}
Also used : RTree(org.apache.hyracks.storage.am.rtree.impls.RTree)

Example 4 with RTree

use of org.apache.hyracks.storage.am.rtree.impls.RTree in project asterixdb by apache.

the class LSMRTreeWithAntiMatterTuples method getLSMComponentPhysicalFiles.

@Override
public Set<String> getLSMComponentPhysicalFiles(ILSMComponent lsmComponent) {
    Set<String> files = new HashSet<>();
    RTree rtree = ((LSMRTreeDiskComponent) lsmComponent).getRTree();
    files.add(rtree.getFileReference().getFile().getAbsolutePath());
    return files;
}
Also used : RTree(org.apache.hyracks.storage.am.rtree.impls.RTree) HashSet(java.util.HashSet)

Example 5 with RTree

use of org.apache.hyracks.storage.am.rtree.impls.RTree in project asterixdb by apache.

the class LSMRTreeWithAntiMatterTuplesSearchCursor method open.

@Override
public void open(ICursorInitialState initialState, ISearchPredicate searchPred) throws HyracksDataException {
    LSMRTreeCursorInitialState lsmInitialState = (LSMRTreeCursorInitialState) initialState;
    cmp = lsmInitialState.getHilbertCmp();
    btreeCmp = lsmInitialState.getBTreeCmp();
    lsmHarness = lsmInitialState.getLSMHarness();
    comparatorFields = lsmInitialState.getComparatorFields();
    operationalComponents = lsmInitialState.getOperationalComponents();
    rtreeSearchPredicate = (SearchPredicate) searchPred;
    searchCallback = lsmInitialState.getSearchOperationCallback();
    includeMutableComponent = false;
    numMutableComponents = 0;
    int numImmutableComponents = 0;
    for (ILSMComponent component : operationalComponents) {
        if (component.getType() == LSMComponentType.MEMORY) {
            includeMutableComponent = true;
            numMutableComponents++;
        } else {
            numImmutableComponents++;
        }
    }
    if (includeMutableComponent) {
        btreeRangePredicate = new RangePredicate(null, null, true, true, btreeCmp, btreeCmp);
    }
    mutableRTreeCursors = new RTreeSearchCursor[numMutableComponents];
    mutableRTreeAccessors = new ITreeIndexAccessor[numMutableComponents];
    btreeCursors = new BTreeRangeSearchCursor[numMutableComponents];
    btreeAccessors = new ITreeIndexAccessor[numMutableComponents];
    for (int i = 0; i < numMutableComponents; i++) {
        ILSMComponent component = operationalComponents.get(i);
        RTree rtree = ((LSMRTreeMemoryComponent) component).getRTree();
        BTree btree = ((LSMRTreeMemoryComponent) component).getBTree();
        mutableRTreeCursors[i] = new RTreeSearchCursor((IRTreeInteriorFrame) lsmInitialState.getRTreeInteriorFrameFactory().createFrame(), (IRTreeLeafFrame) lsmInitialState.getRTreeLeafFrameFactory().createFrame());
        btreeCursors[i] = new BTreeRangeSearchCursor((IBTreeLeafFrame) lsmInitialState.getBTreeLeafFrameFactory().createFrame(), false);
        btreeAccessors[i] = btree.createAccessor(NoOpOperationCallback.INSTANCE, NoOpOperationCallback.INSTANCE);
        mutableRTreeAccessors[i] = rtree.createAccessor(NoOpOperationCallback.INSTANCE, NoOpOperationCallback.INSTANCE);
    }
    rangeCursors = new RTreeSearchCursor[numImmutableComponents];
    ITreeIndexAccessor[] immutableRTreeAccessors = new ITreeIndexAccessor[numImmutableComponents];
    int j = 0;
    for (int i = numMutableComponents; i < operationalComponents.size(); i++) {
        ILSMComponent component = operationalComponents.get(i);
        rangeCursors[j] = new RTreeSearchCursor((IRTreeInteriorFrame) lsmInitialState.getRTreeInteriorFrameFactory().createFrame(), (IRTreeLeafFrame) lsmInitialState.getRTreeLeafFrameFactory().createFrame());
        RTree rtree = ((LSMRTreeDiskComponent) component).getRTree();
        immutableRTreeAccessors[j] = rtree.createAccessor(NoOpOperationCallback.INSTANCE, NoOpOperationCallback.INSTANCE);
        immutableRTreeAccessors[j].search(rangeCursors[j], searchPred);
        j++;
    }
    searchNextCursor();
    setPriorityQueueComparator();
    initPriorityQueue();
    open = true;
}
Also used : RangePredicate(org.apache.hyracks.storage.am.btree.impls.RangePredicate) IRTreeLeafFrame(org.apache.hyracks.storage.am.rtree.api.IRTreeLeafFrame) BTreeRangeSearchCursor(org.apache.hyracks.storage.am.btree.impls.BTreeRangeSearchCursor) BTree(org.apache.hyracks.storage.am.btree.impls.BTree) RTreeSearchCursor(org.apache.hyracks.storage.am.rtree.impls.RTreeSearchCursor) ITreeIndexAccessor(org.apache.hyracks.storage.am.common.api.ITreeIndexAccessor) IRTreeInteriorFrame(org.apache.hyracks.storage.am.rtree.api.IRTreeInteriorFrame) IBTreeLeafFrame(org.apache.hyracks.storage.am.btree.api.IBTreeLeafFrame) ILSMComponent(org.apache.hyracks.storage.am.lsm.common.api.ILSMComponent) RTree(org.apache.hyracks.storage.am.rtree.impls.RTree)

Aggregations

RTree (org.apache.hyracks.storage.am.rtree.impls.RTree)16 BTree (org.apache.hyracks.storage.am.btree.impls.BTree)7 IBinaryComparatorFactory (org.apache.hyracks.api.dataflow.value.IBinaryComparatorFactory)5 ITreeIndexFrameFactory (org.apache.hyracks.storage.am.common.api.ITreeIndexFrameFactory)5 RTreeNSMInteriorFrameFactory (org.apache.hyracks.storage.am.rtree.frames.RTreeNSMInteriorFrameFactory)5 RTreeNSMLeafFrameFactory (org.apache.hyracks.storage.am.rtree.frames.RTreeNSMLeafFrameFactory)5 ITypeTraits (org.apache.hyracks.api.dataflow.value.ITypeTraits)4 ILSMComponent (org.apache.hyracks.storage.am.lsm.common.api.ILSMComponent)4 HyracksDataException (org.apache.hyracks.api.exceptions.HyracksDataException)3 BloomFilter (org.apache.hyracks.storage.am.bloomfilter.impls.BloomFilter)3 BTreeNSMInteriorFrameFactory (org.apache.hyracks.storage.am.btree.frames.BTreeNSMInteriorFrameFactory)3 BTreeNSMLeafFrameFactory (org.apache.hyracks.storage.am.btree.frames.BTreeNSMLeafFrameFactory)3 ITreeIndexTupleWriterFactory (org.apache.hyracks.storage.am.common.api.ITreeIndexTupleWriterFactory)3 ILSMIndexFileManager (org.apache.hyracks.storage.am.lsm.common.api.ILSMIndexFileManager)3 ExternalRTree (org.apache.hyracks.storage.am.lsm.rtree.impls.ExternalRTree)3 LSMRTree (org.apache.hyracks.storage.am.lsm.rtree.impls.LSMRTree)3 RTreeFactory (org.apache.hyracks.storage.am.lsm.rtree.impls.RTreeFactory)3 LSMRTreeTupleWriterFactoryForPointMBR (org.apache.hyracks.storage.am.lsm.rtree.tuples.LSMRTreeTupleWriterFactoryForPointMBR)3 LSMTypeAwareTupleWriterFactory (org.apache.hyracks.storage.am.lsm.rtree.tuples.LSMTypeAwareTupleWriterFactory)3 BloomFilterFactory (org.apache.hyracks.storage.am.bloomfilter.impls.BloomFilterFactory)2