summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenety Goh <benety@mongodb.com>2019-11-21 20:39:34 +0000
committerevergreen <evergreen@mongodb.com>2019-11-21 20:39:34 +0000
commit457cf7bc256105cd227fa4d362c36df7a6969de8 (patch)
tree77a789fb8a53d519ab39356dfb514b54d6d3d491
parent2808aa41736d241000f81f1f7147a72a4fbd47c5 (diff)
downloadmongo-457cf7bc256105cd227fa4d362c36df7a6969de8.tar.gz
SERVER-43642 remove IndexLegacy::getMissingField()
Last reference was removed in commit 2f5feed026e1c22bce29cf2efe746d55879d4a14.
-rw-r--r--src/mongo/db/SConscript1
-rw-r--r--src/mongo/db/index_legacy.cpp34
-rw-r--r--src/mongo/db/index_legacy.h17
-rw-r--r--src/mongo/db/s/SConscript1
4 files changed, 2 insertions, 51 deletions
diff --git a/src/mongo/db/SConscript b/src/mongo/db/SConscript
index bb653aa9e7c..f49da245bac 100644
--- a/src/mongo/db/SConscript
+++ b/src/mongo/db/SConscript
@@ -863,7 +863,6 @@ env.Library(
],
LIBDEPS=[
'index/index_access_methods',
- '$BUILD_DIR/mongo/db/catalog/index_catalog',
],
)
diff --git a/src/mongo/db/index_legacy.cpp b/src/mongo/db/index_legacy.cpp
index a44c609b340..a18d4a9dc52 100644
--- a/src/mongo/db/index_legacy.cpp
+++ b/src/mongo/db/index_legacy.cpp
@@ -27,15 +27,13 @@
* it in the license file.
*/
+#include "mongo/platform/basic.h"
+
#include "mongo/db/index_legacy.h"
#include <string>
-#include "mongo/db/catalog/collection.h"
-#include "mongo/db/catalog/index_catalog.h"
-#include "mongo/db/client.h"
#include "mongo/db/fts/fts_spec.h"
-#include "mongo/db/index/expression_keys_private.h"
#include "mongo/db/index/s2_access_method.h"
#include "mongo/db/index_names.h"
#include "mongo/db/jsobj.h"
@@ -57,32 +55,4 @@ StatusWith<BSONObj> IndexLegacy::adjustIndexSpecObject(const BSONObj& obj) {
return obj;
}
-// static
-BSONObj IndexLegacy::getMissingField(Collection* collection, const BSONObj& infoObj) {
- BSONObj keyPattern = infoObj.getObjectField("key");
- std::string accessMethodName;
- if (collection)
- accessMethodName = collection->getIndexCatalog()->getAccessMethodName(keyPattern);
- else
- accessMethodName = IndexNames::findPluginName(keyPattern);
-
- if (IndexNames::HASHED == accessMethodName) {
- int hashVersion = infoObj["hashVersion"].numberInt();
- HashSeed seed = infoObj["seed"].numberInt();
-
- // Explicit null valued fields and missing fields are both represented in hashed indexes
- // using the hash value of the null BSONElement. This is partly for historical reasons
- // (hash of null was used in the initial release of hashed indexes and changing would
- // alter the data format). Additionally, in certain places the hashed index code and
- // the index bound calculation code assume null and missing are indexed identically.
- BSONObj nullObj = BSON("" << BSONNULL);
- return BSON("" << ExpressionKeysPrivate::makeSingleHashKey(
- nullObj.firstElement(), seed, hashVersion));
- } else {
- BSONObjBuilder b;
- b.appendNull("");
- return b.obj();
- }
-}
-
} // namespace mongo
diff --git a/src/mongo/db/index_legacy.h b/src/mongo/db/index_legacy.h
index 16b38b2de0a..7ac6f8eb983 100644
--- a/src/mongo/db/index_legacy.h
+++ b/src/mongo/db/index_legacy.h
@@ -34,10 +34,6 @@
namespace mongo {
-class Collection;
-class IndexDescriptor;
-class OperationContext;
-
/**
* 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
@@ -56,19 +52,6 @@ public:
* object to conform to their expected format.
*/
static StatusWith<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(Collection* collection, const BSONObj& infoObj);
};
} // namespace mongo
diff --git a/src/mongo/db/s/SConscript b/src/mongo/db/s/SConscript
index 5db7844a060..06f557c108b 100644
--- a/src/mongo/db/s/SConscript
+++ b/src/mongo/db/s/SConscript
@@ -311,7 +311,6 @@ env.Library(
'$BUILD_DIR/mongo/db/commands/server_status',
'$BUILD_DIR/mongo/db/commands/test_commands_enabled',
'$BUILD_DIR/mongo/db/commands/txn_cmd_request',
- '$BUILD_DIR/mongo/db/index_d',
'$BUILD_DIR/mongo/db/repl/repl_coordinator_interface',
'$BUILD_DIR/mongo/db/repl/replica_set_messages',
'$BUILD_DIR/mongo/s/commands/shared_cluster_commands',