bool RocksCollectionCatalogEntry::isIndexMultikey( const StringData& indexName) const {
     MetaData md;
     _getMetaData( &md );
     int offset = md.findIndexOffset( indexName );
     invariant( offset >= 0 );
     return md.indexes[offset].multikey;
 }
KVPrefix BSONCollectionCatalogEntry::getIndexPrefix(OperationContext* opCtx,
                                                    StringData indexName) const {
    MetaData md = _getMetaData(opCtx);
    int offset = md.findIndexOffset(indexName);
    invariant(offset >= 0);
    return md.indexes[offset].prefix;
}
 BSONObj RocksCollectionCatalogEntry::getIndexSpec( const StringData& indexName ) const {
     MetaData md;
     _getMetaData( &md );
     int offset = md.findIndexOffset( indexName );
     invariant( offset >= 0 );
     return md.indexes[offset].spec.getOwned();
 }
 DiskLoc RocksCollectionCatalogEntry::getIndexHead( const StringData& indexName ) const {
     MetaData md;
     _getMetaData( &md );
     int offset = md.findIndexOffset( indexName );
     invariant( offset >= 0 );
     return md.indexes[offset].head;
 }
bool BSONCollectionCatalogEntry::isIndexReady(OperationContext* opCtx, StringData indexName) const {
    MetaData md = _getMetaData(opCtx);

    int offset = md.findIndexOffset(indexName);
    invariant(offset >= 0);
    return md.indexes[offset].ready;
}
    void RocksCollectionCatalogEntry::getAllIndexes( std::vector<std::string>* names ) const {
        MetaData md;
        _getMetaData( &md );

        for ( unsigned i = 0; i < md.indexes.size(); i++ ) {
            names->push_back( md.indexes[i].spec["name"].String() );
        }
    }
BSONObj BSONCollectionCatalogEntry::getIndexSpec(OperationContext* opCtx,
                                                 StringData indexName) const {
    MetaData md = _getMetaData(opCtx);

    int offset = md.findIndexOffset(indexName);
    invariant(offset >= 0);
    return md.indexes[offset].spec.getOwned();
}
void BSONCollectionCatalogEntry::getAllIndexes(OperationContext* opCtx,
                                               std::vector<std::string>* names) const {
    MetaData md = _getMetaData(opCtx);

    for (unsigned i = 0; i < md.indexes.size(); i++) {
        names->push_back(md.indexes[i].spec["name"].String());
    }
}
RecordId BSONCollectionCatalogEntry::getIndexHead(OperationContext* txn,
                                                  const StringData& indexName) const {
    MetaData md = _getMetaData(txn);

    int offset = md.findIndexOffset(indexName);
    invariant(offset >= 0);
    return md.indexes[offset].head;
}
bool BSONCollectionCatalogEntry::isIndexMultikey(OperationContext* txn,
                                                 const StringData& indexName) const {
    MetaData md = _getMetaData(txn);

    int offset = md.findIndexOffset(indexName);
    invariant(offset >= 0);
    return md.indexes[offset].multikey;
}
int BSONCollectionCatalogEntry::getCompletedIndexCount(OperationContext* opCtx) const {
    MetaData md = _getMetaData(opCtx);

    int num = 0;
    for (unsigned i = 0; i < md.indexes.size(); i++) {
        if (md.indexes[i].ready)
            num++;
    }
    return num;
}
    int RocksCollectionCatalogEntry::getCompletedIndexCount() const {
        MetaData md;
        _getMetaData( &md );

        int num = 0;
        for ( unsigned i = 0; i < md.indexes.size(); i++ ) {
            if ( md.indexes[i].ready )
                num++;
        }
        return num;
    }
bool BSONCollectionCatalogEntry::isIndexMultikey(OperationContext* opCtx,
                                                 StringData indexName,
                                                 MultikeyPaths* multikeyPaths) const {
    MetaData md = _getMetaData(opCtx);

    int offset = md.findIndexOffset(indexName);
    invariant(offset >= 0);

    if (multikeyPaths && !md.indexes[offset].multikeyPaths.empty()) {
        *multikeyPaths = md.indexes[offset].multikeyPaths;
    }

    return md.indexes[offset].multikey;
}
    int RocksCollectionCatalogEntry::getTotalIndexCount() const {
        MetaData md;
        _getMetaData( &md );

        return static_cast<int>( md.indexes.size() );
    }
int BSONCollectionCatalogEntry::getTotalIndexCount(OperationContext* opCtx) const {
    MetaData md = _getMetaData(opCtx);

    return static_cast<int>(md.indexes.size());
}
CollectionOptions BSONCollectionCatalogEntry::getCollectionOptions(OperationContext* opCtx) const {
    MetaData md = _getMetaData(opCtx);
    return md.options;
}