Beispiel #1
0
/**
 * Unlink an overwritten dentry. From this dentry either the #fsid# entry or its inode is left.
 *
 * Locking:
 *   We lock everything ourself
 */
FhgfsOpsErr MetaStore::unlinkOverwrittenEntry(DirInode* parentDir,
   DirEntry* overWrittenEntry, FileInode** outInode)
{
   SafeRWLock safeLock(&rwlock, SafeRWLock_READ); // L O C K
   SafeRWLock parentLock(&parentDir->rwlock, SafeRWLock_WRITE);

   FhgfsOpsErr unlinkRes = unlinkOverwrittenEntryUnlocked(parentDir, overWrittenEntry, outInode);

   parentLock.unlock();
   safeLock.unlock();

   return unlinkRes;
}
SegmentTermDocs::SegmentTermDocs(const SegmentReaderPtr& parent) {
    this->_parent = parent;
    this->count = 0;
    this->df = 0;
    this->_doc = 0;
    this->_freq = 0;
    this->freqBasePointer = 0;
    this->proxBasePointer = 0;
    this->skipPointer = 0;
    this->haveSkipped = false;
    this->currentFieldStoresPayloads = false;
    this->currentFieldOmitTermFreqAndPositions = false;

    this->_freqStream = boost::dynamic_pointer_cast<IndexInput>(parent->core->freqStream->clone());
    {
        SyncLock parentLock(parent);
        this->deletedDocs = parent->deletedDocs;
    }
    this->skipInterval = parent->core->getTermsReader()->getSkipInterval();
    this->maxSkipLevels = parent->core->getTermsReader()->getMaxSkipLevels();
}
AllTermDocs::AllTermDocs(const SegmentReaderPtr& parent) : AbstractAllTermDocs(parent->maxDoc()) {
    SyncLock parentLock(parent);
    this->_deletedDocs = parent->deletedDocs;
}