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;
}
Aggregations