Search in sources :

Example 6 with ITreeIndexFrame

use of org.apache.hyracks.storage.am.common.api.ITreeIndexFrame in project asterixdb by apache.

the class VirtualFreePageManager method init.

@Override
public void init(ITreeIndexFrameFactory interiorFrameFactory, ITreeIndexFrameFactory leafFrameFactory) throws HyracksDataException {
    currentPageId.set(1);
    ICachedPage page = bufferCache.pin(BufferedFileHandle.getDiskPageId(fileId, 0), true);
    page.acquireWriteLatch();
    page.releaseWriteLatch(false);
    bufferCache.unpin(page);
    page = bufferCache.pin(BufferedFileHandle.getDiskPageId(fileId, currentPageId.get()), true);
    if (leafFrameFactory != null) {
        page.acquireWriteLatch();
        ITreeIndexFrame leafFrame = leafFrameFactory.createFrame();
        leafFrame.setPage(page);
        leafFrame.initBuffer((byte) 0);
        page.releaseWriteLatch(true);
    }
    bufferCache.unpin(page);
}
Also used : ICachedPage(org.apache.hyracks.storage.common.buffercache.ICachedPage) ITreeIndexFrame(org.apache.hyracks.storage.am.common.api.ITreeIndexFrame)

Aggregations

ITreeIndexFrame (org.apache.hyracks.storage.am.common.api.ITreeIndexFrame)6 ByteBuffer (java.nio.ByteBuffer)2 HyracksDataException (org.apache.hyracks.api.exceptions.HyracksDataException)2 ITreeIndex (org.apache.hyracks.storage.am.common.api.ITreeIndex)2 ICachedPage (org.apache.hyracks.storage.common.buffercache.ICachedPage)2 DataOutput (java.io.DataOutput)1 VSizeFrame (org.apache.hyracks.api.comm.VSizeFrame)1 ArrayTupleBuilder (org.apache.hyracks.dataflow.common.comm.io.ArrayTupleBuilder)1 FrameTupleAppender (org.apache.hyracks.dataflow.common.comm.io.FrameTupleAppender)1 ITupleReference (org.apache.hyracks.dataflow.common.data.accessors.ITupleReference)1 BTreeRangeSearchCursor (org.apache.hyracks.storage.am.btree.impls.BTreeRangeSearchCursor)1 ISplitKey (org.apache.hyracks.storage.am.common.api.ISplitKey)1 ITreeIndexAccessor (org.apache.hyracks.storage.am.common.api.ITreeIndexAccessor)1 ITreeIndexCursor (org.apache.hyracks.storage.am.common.api.ITreeIndexCursor)1 ITreeIndexMetadataFrame (org.apache.hyracks.storage.am.common.api.ITreeIndexMetadataFrame)1 TreeIndexDiskOrderScanCursor (org.apache.hyracks.storage.am.common.impls.TreeIndexDiskOrderScanCursor)1 ISearchOperationCallback (org.apache.hyracks.storage.common.ISearchOperationCallback)1 LocalResource (org.apache.hyracks.storage.common.LocalResource)1