コード例 #1
0
    bool isMMAPV1() {
        if (hasGlobalEnvironment()) {
            StorageEngine* globalStorageEngine = getGlobalEnvironment()->getGlobalStorageEngine();
            if (globalStorageEngine != NULL) {
                return globalStorageEngine->isMmapV1();
            }
        }

        // For the purpose of unit-tests, which were written to assume MMAP V1-like behaviour
        return true;
    }
コード例 #2
0
    OperationContextImpl::OperationContextImpl() : _client(currentClient.get()) {
        invariant(_client);

        StorageEngine* storageEngine = getGlobalEnvironment()->getGlobalStorageEngine();
        invariant(storageEngine);
        _recovery.reset(storageEngine->newRecoveryUnit(this));

        if (storageEngine->isMmapV1()) {
            _locker.reset(new MMAPV1LockerImpl(idCounter.addAndFetch(1)));
        }
        else {
            _locker.reset(new LockerImpl<false>(idCounter.addAndFetch(1)));
        }

        _client->setOperationContext(this);
    }
コード例 #3
0
Status ReplicationCoordinatorExternalStateImpl::runRepairOnLocalDB(OperationContext* opCtx) {
    try {
        Lock::GlobalWrite globalWrite(opCtx);
        StorageEngine* engine = getGlobalServiceContext()->getGlobalStorageEngine();

        if (!engine->isMmapV1()) {
            return Status::OK();
        }

        UnreplicatedWritesBlock uwb(opCtx);
        Status status = repairDatabase(opCtx, engine, localDbName, false, false);

        // Open database before returning
        dbHolder().openDb(opCtx, localDbName);
    } catch (const DBException& ex) {
        return ex.toStatus();
    }
    return Status::OK();
}
コード例 #4
0
bool isMMAPV1() {
    StorageEngine* globalStorageEngine = getGlobalServiceContext()->getGlobalStorageEngine();

    invariant(globalStorageEngine);
    return globalStorageEngine->isMmapV1();
}