diff options
author | Benety Goh <benety@mongodb.com> | 2016-09-19 15:05:41 -0400 |
---|---|---|
committer | Benety Goh <benety@mongodb.com> | 2016-09-20 14:49:58 -0400 |
commit | 963d2a0d952a65e84157aa52bc4d71a40fcb9707 (patch) | |
tree | 9a93b9052989129411fb744812f6869c161a3c82 /src/mongo/db/repl/storage_interface.h | |
parent | ad9f3df970b0b7d2465268e1d34d5198d7296298 (diff) | |
download | mongo-963d2a0d952a65e84157aa52bc4d71a40fcb9707.tar.gz |
SERVER-25268 added StorageInterfaceImpl::findOne and deleteOne support for startKey and boundInclusion
Diffstat (limited to 'src/mongo/db/repl/storage_interface.h')
-rw-r--r-- | src/mongo/db/repl/storage_interface.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/mongo/db/repl/storage_interface.h b/src/mongo/db/repl/storage_interface.h index bb72cfed19b..a65c7b2b0f3 100644 --- a/src/mongo/db/repl/storage_interface.h +++ b/src/mongo/db/repl/storage_interface.h @@ -36,6 +36,7 @@ #include "mongo/base/disallow_copying.h" #include "mongo/base/string_data.h" #include "mongo/db/namespace_string.h" +#include "mongo/db/query/index_bounds.h" #include "mongo/db/repl/collection_bulk_loader.h" #include "mongo/db/repl/optime.h" #include "mongo/db/service_context.h" @@ -227,6 +228,12 @@ public: * Finds the first document returned by a collection or index scan on the collection in the * requested direction. * If "indexName" is boost::none, a collection scan is used to locate the document. + * Index scan options: + * If "startKey" is not empty, the index scan will start from the given key (instead of + * MinKey/MaxKey). + * Set "boundInclusion" to BoundInclusion::kIncludeStartKeyOnly to include "startKey" in + * the index scan results. Set to BoundInclusion::kIncludeEndKeyOnly to return the key + * immediately following "startKey" from the index. */ enum class ScanDirection { kForward = 1, @@ -235,7 +242,9 @@ public: virtual StatusWith<BSONObj> findOne(OperationContext* txn, const NamespaceString& nss, boost::optional<StringData> indexName, - ScanDirection scanDirection) = 0; + ScanDirection scanDirection, + const BSONObj& startKey, + BoundInclusion boundInclusion) = 0; /** * Deletes the first document returned by a collection or index scan on the collection in the @@ -245,7 +254,9 @@ public: virtual StatusWith<BSONObj> deleteOne(OperationContext* txn, const NamespaceString& nss, boost::optional<StringData> indexName, - ScanDirection scanDirection) = 0; + ScanDirection scanDirection, + const BSONObj& startKey, + BoundInclusion boundInclusion) = 0; }; } // namespace repl |