Search in sources :

Example 1 with IFIFOPageQueue

use of org.apache.hyracks.storage.common.buffercache.IFIFOPageQueue in project asterixdb by apache.

the class AppendOnlyLinkedMetadataPageManager method close.

@Override
public void close() throws HyracksDataException {
    if (ready) {
        IFIFOPageQueue queue = bufferCache.createFIFOQueue();
        ITreeIndexMetadataFrame metaFrame = frameFactory.createFrame();
        confiscatedPage.acquireWriteLatch();
        try {
            metaFrame.setPage(confiscatedPage);
            metaFrame.setValid(true);
        } finally {
            confiscatedPage.releaseWriteLatch(false);
        }
        int finalMetaPage = getMaxPageId(metaFrame) + 1;
        bufferCache.setPageDiskId(confiscatedPage, BufferedFileHandle.getDiskPageId(fileId, finalMetaPage));
        queue.put(confiscatedPage);
        bufferCache.finishQueue();
        metadataPage = getMetadataPageId();
        ready = false;
    } else if (confiscatedPage != null) {
        bufferCache.returnPage(confiscatedPage, false);
    }
    confiscatedPage = null;
}
Also used : IFIFOPageQueue(org.apache.hyracks.storage.common.buffercache.IFIFOPageQueue) ITreeIndexMetadataFrame(org.apache.hyracks.storage.am.common.api.ITreeIndexMetadataFrame)

Aggregations

ITreeIndexMetadataFrame (org.apache.hyracks.storage.am.common.api.ITreeIndexMetadataFrame)1 IFIFOPageQueue (org.apache.hyracks.storage.common.buffercache.IFIFOPageQueue)1