diff options
author | Hari Khalsa <hkhalsa@10gen.com> | 2013-05-01 10:01:08 -0400 |
---|---|---|
committer | Hari Khalsa <hkhalsa@10gen.com> | 2013-05-02 15:58:09 -0400 |
commit | c81781d4064998e1cd5d98f6e89c9359f2b7e323 (patch) | |
tree | f78ae5ebe5bbb660e383964ae17c6f523c298ebf /src/mongo/db/index_legacy.h | |
parent | 41a2d01e419cabd2011ce4ce7262eb8b7181d9e7 (diff) | |
download | mongo-c81781d4064998e1cd5d98f6e89c9359f2b7e323.tar.gz |
SERVER-8791 SERVER-9212 remove IndexSpec
Diffstat (limited to 'src/mongo/db/index_legacy.h')
-rw-r--r-- | src/mongo/db/index_legacy.h | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/src/mongo/db/index_legacy.h b/src/mongo/db/index_legacy.h new file mode 100644 index 00000000000..ffa880c929f --- /dev/null +++ b/src/mongo/db/index_legacy.h @@ -0,0 +1,67 @@ + +/** +* Copyright (C) 2013 10gen Inc. +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU Affero General Public License, version 3, +* as published by the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Affero General Public License for more details. +* +* You should have received a copy of the GNU Affero General Public License +* along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#pragma once + +#include "mongo/db/jsobj.h" + +namespace mongo { + + class IndexDetails; + class NamespaceDetails; + + /** + * There has been some behavior concerning indexed access patterns -- both pre and post-index + * construction -- that does not quite fit in the access pattern model implemented in + * index/index_access_pattern.h. Such behavior can't be changed in the current implementation of + * the code. + * + * We grouped such exception/legacy behavior here. + */ + class IndexLegacy { + public: + /** + * Adjust the provided index spec BSONObj depending on the type of index obj describes. + * + * This is a no-op unless the object describes a FTS index. To see what FTS does, look in + * FTSSpec::fixSpec in fts/fts_spec.cpp. + */ + static BSONObj adjustIndexSpecObject(const BSONObj& obj); + + /** + * Returns the BSONObj that is inserted into an index when the object is missing the keys + * the index is over. + * + * For every index *except hash*, this is the BSON equivalent of jstNULL. + * For the hash index, it's the hash of BSON("" << BSONNULL). + * + * s/d_split.cpp needs to know this. + * + * This is a significant leak of index functionality out of the index layer. + */ + static BSONObj getMissingField(const BSONObj& infoObj); + + /** + * Perform any post-build steps for this index. + * + * This is a no-op unless the index is a FTS index. In that case, we set the flag for using + * power of 2 sizes for space allocation. + */ + static void postBuildHook(NamespaceDetails* tableToIndex, const IndexDetails& idx); + }; + +} // namespace mongo |