summaryrefslogtreecommitdiff
path: root/src/mongo/db/keypattern.h
diff options
context:
space:
mode:
authorSiyuan Zhou <siyuan.zhou@mongodb.com>2014-05-01 16:19:01 -0400
committerSiyuan Zhou <siyuan.zhou@mongodb.com>2014-05-05 18:15:47 -0400
commit9ba412717035fa34502c89e5886fa3a3ae3e05d5 (patch)
tree865a784a4cc7f6e683776a609a21c720e03f8402 /src/mongo/db/keypattern.h
parent9aeb3d4c5a70f8fb3616c5aea22c15db86b0d6e1 (diff)
downloadmongo-9ba412717035fa34502c89e5886fa3a3ae3e05d5.tar.gz
SERVER-13807 Remove old query framework related to shard targeting
Diffstat (limited to 'src/mongo/db/keypattern.h')
-rw-r--r--src/mongo/db/keypattern.h40
1 files changed, 4 insertions, 36 deletions
diff --git a/src/mongo/db/keypattern.h b/src/mongo/db/keypattern.h
index 3e99a1c9d85..3e0eebfb613 100644
--- a/src/mongo/db/keypattern.h
+++ b/src/mongo/db/keypattern.h
@@ -38,9 +38,6 @@
namespace mongo {
- struct FieldInterval;
- class FieldRangeSet;
-
/**
* A BoundList contains intervals specified by inclusive start
* and end bounds. The intervals should be nonoverlapping and occur in
@@ -61,6 +58,10 @@ namespace mongo {
*/
class KeyPattern {
public:
+
+ //maximum number of intervals produced by $in queries.
+ static const unsigned MAX_IN_COMBINATIONS = 4000000;
+
/*
* We are allowing implicit conversion from BSON
*/
@@ -148,32 +149,6 @@ namespace mongo {
*/
BSONObj extractSingleKey( const BSONObj& doc ) const;
- /**@param queryConstraints a FieldRangeSet, usually formed from parsing a query
- * @return an ordered list of bounds generated using this KeyPattern and the
- * constraints from the FieldRangeSet. This function is used in sharding to
- * determine where to route queries according to the shard key pattern.
- *
- * Examples:
- * If this KeyPattern is { a : 1 }
- * FieldRangeSet( {a : 5 } ) --> returns [{a : 5}, {a : 5 } ]
- * FieldRangeSet( {a : {$gt : 3}} ) --> returns [({a : 3} , { a : MaxInt})]
- *
- * If this KeyPattern is { a : "hashed }
- * FieldRangeSet( {a : 5 } --> returns [ ({ a : hash(5) }, {a : hash(5) }) ]
- *
- * The bounds returned by this function may be a superset of those defined
- * by the constraints. For instance, if this KeyPattern is {a : 1}
- * FieldRanget( { a : {$in : [1,2]} , b : {$in : [3,4,5]} } )
- * --> returns [({a : 1 , b : 3} , {a : 1 , b : 5}]),
- * [({a : 2 , b : 3} , {a : 2 , b : 5}])
- *
- * The queryConstraints should be defined for all the fields in this keypattern
- * (i.e. the value of frsp->matchPossibleForSingleKeyFRS(_pattern) should be true,
- * otherwise this function could throw).
- *
- */
- BoundList keyBounds( const FieldRangeSet& queryConstraints ) const;
-
/**
* Return an ordered list of bounds generated using this KeyPattern and the
* bounds from the IndexBounds. This function is used in sharding to
@@ -228,13 +203,6 @@ namespace mongo {
return ( fieldExpression.isNumber() && fieldExpression.numberInt() == -1 );
}
- /* Takes a list of intervals corresponding to constraints on a given field
- * in this keypattern, and transforms them into a list of bounds
- * based on the expression for 'field'
- */
- BoundList _transformFieldBounds( const vector<FieldInterval>& oldIntervals ,
- const BSONElement& field ) const;
-
};
} // namespace mongo