diff options
author | Kyle Suarez <kyle.suarez@mongodb.com> | 2018-01-31 12:23:44 -0500 |
---|---|---|
committer | Kyle Suarez <kyle.suarez@mongodb.com> | 2018-01-31 12:28:55 -0500 |
commit | 0322da76ec976d240191b1ca8f70c2c732f9753a (patch) | |
tree | 95f285d0be51aeafbb22d1ac37bb615df28f20b7 /src/mongo/db/catalog/catalog_control.h | |
parent | 0fb3ff2ee1fc5305b9523cdeaaae9c7279f1c117 (diff) | |
download | mongo-0322da76ec976d240191b1ca8f70c2c732f9753a.tar.gz |
SERVER-32594 add mechanism to close and reopen the catalog
Diffstat (limited to 'src/mongo/db/catalog/catalog_control.h')
-rw-r--r-- | src/mongo/db/catalog/catalog_control.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/mongo/db/catalog/catalog_control.h b/src/mongo/db/catalog/catalog_control.h new file mode 100644 index 00000000000..85eff55ec25 --- /dev/null +++ b/src/mongo/db/catalog/catalog_control.h @@ -0,0 +1,48 @@ +/** + * Copyright (C) 2018 MongoDB Inc. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * As a special exception, the copyright holders give permission to link the + * code of portions of this program with the OpenSSL library under certain + * conditions as described in each individual source file and distribute + * linked combinations including the program with the OpenSSL library. You + * must comply with the GNU Affero General Public License in all respects + * for all of the code used other than as permitted herein. If you modify + * file(s) with this exception, you may extend this exception to your + * version of the file(s), but you are not obligated to do so. If you do not + * wish to do so, delete this exception statement from your version. If you + * delete this exception statement from all source files in the program, + * then also delete it in the license file. + */ + +#include "mongo/db/operation_context.h" + +namespace mongo { +namespace catalog { +/** + * Closes the catalog, destroying all associated in-memory data structures for all databases. After + * a call to this function, it is illegal to access the catalog before calling openCatalog(). + * + * Must be called with the global lock acquired in exclusive mode. + */ +void closeCatalog(OperationContext* opCtx); + +/** + * Restores the catalog and all in-memory state after a call to closeCatalog(). + * + * Must be called with the global lock acquired in exclusive mode. + */ +void openCatalog(OperationContext* opCtx); +} // namespace catalog +} // namespace mongo |