summaryrefslogtreecommitdiff
path: root/src/mongo/db/range_preserver.h
diff options
context:
space:
mode:
authorMark Benvenuto <mark.benvenuto@mongodb.com>2015-06-20 00:22:50 -0400
committerMark Benvenuto <mark.benvenuto@mongodb.com>2015-06-20 10:56:02 -0400
commit9c2ed42daa8fbbef4a919c21ec564e2db55e8d60 (patch)
tree3814f79c10d7b490948d8cb7b112ac1dd41ceff1 /src/mongo/db/range_preserver.h
parent01965cf52bce6976637ecb8f4a622aeb05ab256a (diff)
downloadmongo-9c2ed42daa8fbbef4a919c21ec564e2db55e8d60.tar.gz
SERVER-18579: Clang-Format - reformat code, no comment reflow
Diffstat (limited to 'src/mongo/db/range_preserver.h')
-rw-r--r--src/mongo/db/range_preserver.h58
1 files changed, 29 insertions, 29 deletions
diff --git a/src/mongo/db/range_preserver.h b/src/mongo/db/range_preserver.h
index 818d848914e..5b7b655b66f 100644
--- a/src/mongo/db/range_preserver.h
+++ b/src/mongo/db/range_preserver.h
@@ -32,40 +32,40 @@
namespace mongo {
+/**
+ * A RangePreserver prevents the RangeDeleter from removing any new data ranges in a collection.
+ * Previously queued ranges may still be deleted but the documents in those ranges will be
+ * filtered by CollectionMetadata::belongsToMe.
+ *
+ * TODO(greg/hk): Currently, creating a ClientCursor is how we accomplish this. This should
+ * change.
+ */
+class RangePreserver {
+public:
/**
- * A RangePreserver prevents the RangeDeleter from removing any new data ranges in a collection.
- * Previously queued ranges may still be deleted but the documents in those ranges will be
- * filtered by CollectionMetadata::belongsToMe.
- *
- * TODO(greg/hk): Currently, creating a ClientCursor is how we accomplish this. This should
- * change.
+ * Sharding uses the set of active cursor IDs as the current state. We add a dummy
+ * ClientCursor, which creates an additional cursor ID. The cursor ID lasts as long as this
+ * object does. The ClientCursorPin guarantees that the underlying ClientCursor is not
+ * deleted until this object goes out of scope.
*/
- class RangePreserver {
- public:
- /**
- * Sharding uses the set of active cursor IDs as the current state. We add a dummy
- * ClientCursor, which creates an additional cursor ID. The cursor ID lasts as long as this
- * object does. The ClientCursorPin guarantees that the underlying ClientCursor is not
- * deleted until this object goes out of scope.
- */
- RangePreserver(const Collection* collection) {
- // Empty collections don't have any data we need to preserve
- if (collection) {
- // Not a memory leak. Cached in a static structure by CC's ctor.
- ClientCursor* cc = new ClientCursor(collection);
+ RangePreserver(const Collection* collection) {
+ // Empty collections don't have any data we need to preserve
+ if (collection) {
+ // Not a memory leak. Cached in a static structure by CC's ctor.
+ ClientCursor* cc = new ClientCursor(collection);
- // Pin keeps the CC from being deleted while it's in scope. We delete it ourselves.
- _pin.reset(new ClientCursorPin(collection->getCursorManager(), cc->cursorid()));
- }
+ // Pin keeps the CC from being deleted while it's in scope. We delete it ourselves.
+ _pin.reset(new ClientCursorPin(collection->getCursorManager(), cc->cursorid()));
}
+ }
- ~RangePreserver() {
- if (_pin)
- _pin->deleteUnderlying();
- }
+ ~RangePreserver() {
+ if (_pin)
+ _pin->deleteUnderlying();
+ }
- private:
- std::unique_ptr<ClientCursorPin> _pin;
- };
+private:
+ std::unique_ptr<ClientCursorPin> _pin;
+};
} // namespace mongo