Ejemplo n.º 1
0
 Status RocksEngine::createRecordStore(OperationContext* opCtx, StringData ns, StringData ident,
                                       const CollectionOptions& options) {
     auto s = _createIdentPrefix(ident);
     if (s.isOK() && NamespaceString::oplog(ns)) {
         _oplogIdent = ident.toString();
         // oplog needs two prefixes, so we also reserve the next one
         uint64_t oplogTrackerPrefix = 0;
         {
             boost::lock_guard<boost::mutex> lk(_identPrefixMapMutex);
             oplogTrackerPrefix = ++_maxPrefix;
         }
         // we also need to write out the new prefix to the database. this is just an
         // optimization
         std::string encodedPrefix(encodePrefix(oplogTrackerPrefix));
         s = rocksToMongoStatus(
             _db->Put(rocksdb::WriteOptions(), encodedPrefix, rocksdb::Slice()));
     }
     return s;
 }
Ejemplo n.º 2
0
 Status RocksEngine::createSortedDataInterface(OperationContext* opCtx, StringData ident,
                                               const IndexDescriptor* desc) {
     return _createIdentPrefix(ident);
 }
Ejemplo n.º 3
0
 Status RocksEngine::createRecordStore(OperationContext* opCtx, StringData ns, StringData ident,
                                       const CollectionOptions& options) {
     return _createIdentPrefix(ident);
 }