diff options
author | Haley Connelly <haley.connelly@10gen.com> | 2019-09-25 17:03:51 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2019-09-25 17:03:51 +0000 |
commit | 996f1ed14075eb66b87259181809507756737870 (patch) | |
tree | 6b7d2bc381ab08411967fc34384bc86088279e81 /src/mongo/db/catalog | |
parent | 55c54c3c287d07ba2764521a085dff9add20b505 (diff) | |
download | mongo-996f1ed14075eb66b87259181809507756737870.tar.gz |
SERVER-42524 remove the touch command
Diffstat (limited to 'src/mongo/db/catalog')
-rw-r--r-- | src/mongo/db/catalog/collection.h | 8 | ||||
-rw-r--r-- | src/mongo/db/catalog/collection_impl.cpp | 32 | ||||
-rw-r--r-- | src/mongo/db/catalog/collection_impl.h | 8 | ||||
-rw-r--r-- | src/mongo/db/catalog/collection_mock.h | 7 |
4 files changed, 0 insertions, 55 deletions
diff --git a/src/mongo/db/catalog/collection.h b/src/mongo/db/catalog/collection.h index ee12d90656d..492b0628e32 100644 --- a/src/mongo/db/catalog/collection.h +++ b/src/mongo/db/catalog/collection.h @@ -335,14 +335,6 @@ public: virtual Status truncate(OperationContext* const opCtx) = 0; /** - * forces data into cache. - */ - virtual Status touch(OperationContext* const opCtx, - const bool touchData, - const bool touchIndexes, - BSONObjBuilder* const output) const = 0; - - /** * Truncate documents newer than the document at 'end' from the capped * collection. The collection cannot be completely emptied using this * function. An assertion will be thrown if that is attempted. diff --git a/src/mongo/db/catalog/collection_impl.cpp b/src/mongo/db/catalog/collection_impl.cpp index dae155bdb28..61df6557190 100644 --- a/src/mongo/db/catalog/collection_impl.cpp +++ b/src/mongo/db/catalog/collection_impl.cpp @@ -1003,38 +1003,6 @@ StatusWith<std::vector<BSONObj>> CollectionImpl::addCollationDefaultsToIndexSpec return newIndexSpecs; } -Status CollectionImpl::touch(OperationContext* opCtx, - bool touchData, - bool touchIndexes, - BSONObjBuilder* output) const { - if (touchData) { - BSONObjBuilder b; - Status status = _recordStore.get()->touch(opCtx, &b); - if (!status.isOK()) - return status; - output->append("data", b.obj()); - } - - if (touchIndexes) { - Timer t; - std::unique_ptr<IndexCatalog::IndexIterator> ii = - _indexCatalog->getIndexIterator(opCtx, false); - while (ii->more()) { - const IndexCatalogEntry* entry = ii->next(); - const IndexAccessMethod* iam = entry->accessMethod(); - Status status = iam->touch(opCtx); - if (!status.isOK()) - return status; - } - - output->append( - "indexes", - BSON("num" << _indexCatalog->numIndexesTotal(opCtx) << "millis" << t.millis())); - } - - return Status::OK(); -} - std::unique_ptr<PlanExecutor, PlanExecutor::Deleter> CollectionImpl::makePlanExecutor( OperationContext* opCtx, PlanExecutor::YieldPolicy yieldPolicy, ScanDirection scanDirection) { auto isForward = scanDirection == ScanDirection::kForward; diff --git a/src/mongo/db/catalog/collection_impl.h b/src/mongo/db/catalog/collection_impl.h index baf5e5a61f1..a33c507ecda 100644 --- a/src/mongo/db/catalog/collection_impl.h +++ b/src/mongo/db/catalog/collection_impl.h @@ -216,14 +216,6 @@ public: Status truncate(OperationContext* opCtx) final; /** - * forces data into cache - */ - Status touch(OperationContext* opCtx, - bool touchData, - bool touchIndexes, - BSONObjBuilder* output) const final; - - /** * Truncate documents newer than the document at 'end' from the capped * collection. The collection cannot be completely emptied using this * function. An assertion will be thrown if that is attempted. diff --git a/src/mongo/db/catalog/collection_mock.h b/src/mongo/db/catalog/collection_mock.h index 458fd31722b..c851d8ceb51 100644 --- a/src/mongo/db/catalog/collection_mock.h +++ b/src/mongo/db/catalog/collection_mock.h @@ -154,13 +154,6 @@ public: std::abort(); } - Status touch(OperationContext* opCtx, - bool touchData, - bool touchIndexes, - BSONObjBuilder* output) const { - std::abort(); - } - void cappedTruncateAfter(OperationContext* opCtx, RecordId end, bool inclusive) { std::abort(); } |