void CmdInterpreter::visit(ProxyCmdVersionIndexRoot &cmd) { TxnHandle *pTxnHandle = getTxnHandle(cmd.getTxnHandle()); SharedDatabase pDb = pTxnHandle->pDb; assert(pDb->areSnapshotsEnabled()); SnapshotRandomAllocationSegment *pSnapshotSegment = SegmentFactory::dynamicCast<SnapshotRandomAllocationSegment *>( pTxnHandle->pSnapshotSegment); pSnapshotSegment->versionPage( PageId(cmd.getOldRootPageId()), PageId(cmd.getNewRootPageId())); }
void ImageView::unremoveRightPage() { PageInfo page_info( m_ptrPages->unremovePage(PageId(m_imageId, PageId::RIGHT_PAGE)) ); m_rightUnremoveButton.unlink(); m_rightPageRemoved = false; update(); // We need invalidateThumbnail(PageInfo) rather than (PageId), // as we are updating page removal status. page_info.setId(PageId(m_imageId, PageId::SINGLE_PAGE)); emit invalidateThumbnail(page_info); }
void CmdInterpreter::visit(ProxyCmdVerifyIndex &cmd) { // block checkpoints during this method TxnHandle *pTxnHandle = getTxnHandle(cmd.getTxnHandle()); SXMutexSharedGuard actionMutexGuard( pTxnHandle->pDb->getCheckpointThread()->getActionMutex()); BTreeDescriptor treeDescriptor; getBTreeForIndexCmd(cmd, PageId(cmd.getRootPageId()), treeDescriptor); TupleProjection leafPageIdProj; if (cmd.getLeafPageIdProj()) { CmdInterpreter::readTupleProjection( leafPageIdProj, cmd.getLeafPageIdProj()); } bool estimate = cmd.isEstimate(); bool includeTuples = cmd.isIncludeTuples(); bool keys = (!estimate); bool leaf = ((!estimate) || includeTuples); BTreeVerifier verifier(treeDescriptor); verifier.verify(true, keys, leaf); BTreeStatistics statistics = verifier.getStatistics(); long pageCount = statistics.nNonLeafNodes + statistics.nLeafNodes; if (includeTuples) { pageCount += statistics.nTuples; } cmd.setResultPageCount(pageCount); if (keys) { cmd.setResultUniqueKeyCount(statistics.nUniqueKeys); } else { cmd.clearResultUniqueKeyCount(); } }
PageId CmdInterpreter::StreamGraphHandle::getRoot(PageOwnerId pageOwnerId) { JniEnvAutoRef pEnv; jlong x = opaqueToInt(pageOwnerId); x = pEnv->CallLongMethod( javaRuntimeContext, JniUtil::methGetIndexRoot, x); return PageId(x); }
void CmdInterpreter::dropOrTruncateIndex( ProxyCmdDropIndex &cmd, bool drop) { // block checkpoints during this method TxnHandle *pTxnHandle = getTxnHandle(cmd.getTxnHandle()); SXMutexSharedGuard actionMutexGuard( pTxnHandle->pDb->getCheckpointThread()->getActionMutex()); BTreeDescriptor treeDescriptor; getBTreeForIndexCmd(cmd, PageId(cmd.getRootPageId()), treeDescriptor); TupleProjection leafPageIdProj; if (cmd.getLeafPageIdProj()) { CmdInterpreter::readTupleProjection( leafPageIdProj, cmd.getLeafPageIdProj()); } BTreeBuilder builder(treeDescriptor); builder.truncate(drop, leafPageIdProj.size() ? &leafPageIdProj : NULL); }
void inc(uint64_t count) { assert(pageID != kInvalidPageId); while(count!=0 && pageID!=kInvalidPageId) { // Next extent if(pageID == (*extents)[extent].end()) { extent++; if(extent >= extents->size()) pageID = kInvalidPageId; else pageID = (*extents)[extent].begin(); } // uint64_t leftInThisExtent = (*extents)[extent].end().toInteger() - pageID.toInteger(); if(leftInThisExtent > count) { pageID = PageId(pageID.toInteger() + count); count = 0; } else { count -= leftInThisExtent; pageID = (*extents)[extent].end(); } } }
kerio::hashdb::PageId overflowFilePage(uint32_t pageNumber) { return PageId(PageId::OverflowFileType, pageNumber); }
kerio::hashdb::PageId bucketFilePage(uint32_t pageNumber) { return PageId(PageId::BucketFileType, pageNumber); }