Storage Engine API
mmap_v1_options.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 MongoDB Inc.
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Affero General Public License, version 3,
6  * as published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU Affero General Public License for more details.
12  *
13  * You should have received a copy of the GNU Affero General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * As a special exception, the copyright holders give permission to link the
17  * code of portions of this program with the OpenSSL library under certain
18  * conditions as described in each individual source file and distribute
19  * linked combinations including the program with the OpenSSL library. You
20  * must comply with the GNU Affero General Public License in all respects for
21  * all of the code used other than as permitted herein. If you modify file(s)
22  * with this exception, you may extend this exception to your version of the
23  * file(s), but you are not obligated to do so. If you do not wish to do so,
24  * delete this exception statement from your version. If you delete this
25  * exception statement from all source files in the program, then also delete
26  * it in the license file.
27  */
28 
29 #pragma once
30 
31 #include <string>
32 
33 /*
34  * This file defines the storage for options that come from the command line related to the
35  * mmap v1 storage engine.
36  */
37 
38 namespace mongo {
39 
40 struct MMAPV1Options {
42  : lenForNewNsFiles(16 * 1024 * 1024),
43  preallocj(true),
44  prealloc(false),
45  quota(false),
46  quotaFiles(8) {}
47 
48  // --nssize
49  // Specifies the default size for namespace files, which are files that end in .ns.
50  // Each collection and index counts as a namespace.
51  unsigned lenForNewNsFiles;
52 
53  bool preallocj; // --nopreallocj no preallocation of journal files
54  bool prealloc; // --noprealloc no preallocation of data files
55  bool smallfiles; // --smallfiles allocate smaller data files
56 
57  // --journalOptions 7 dump journal and terminate without doing anything further
58  // --journalOptions 4 recover and terminate without listening
59  enum { // bits to be ORed
60  JournalDumpJournal = 1, // dump diagnostics on the journal during recovery
61  JournalScanOnly = 2, // don't do any real work, just scan and dump if dump
62  // specified
63  JournalRecoverOnly = 4, // terminate after recovery step
64  JournalParanoid = 8, // paranoid mode enables extra checks
65  JournalAlwaysCommit = 16, // do a group commit every time the writelock is released
66  JournalAlwaysRemap = 32, // remap the private view after every group commit
67  // (may lag to the next write lock acquisition,
68  // but will do all files then)
69  JournalNoCheckSpace = 64 // don't check that there is enough room for journal files
70  // before startup (for diskfull tests)
71  };
72  int journalOptions; // --journalOptions <n> for debugging
73 
74  // --quota
75  // Enables a maximum limit for the number data files each database can have.
76  // When running with the --quota option, MongoDB has a maximum of 8 data files
77  // per database. Adjust the quota with --quotaFiles.
78  bool quota;
79 
80  // --quotaFiles
81  // Modifies the limit on the number of data files per database.
82  // --quotaFiles option requires that you set --quota.
83  int quotaFiles; // --quotaFiles
84 };
85 
87 
88 } // namespace mongo
Definition: mmap_v1_options.h:63
Definition: mmap_v1_options.h:40
bool quota
Definition: mmap_v1_options.h:78
bool prealloc
Definition: mmap_v1_options.h:54
int quotaFiles
Definition: mmap_v1_options.h:83
Definition: mmap_v1_options.h:66
Copyright (C) 2014 MongoDB Inc.
Definition: bson_collection_catalog_entry.cpp:38
bool preallocj
Definition: mmap_v1_options.h:53
Definition: mmap_v1_options.h:61
MMAPV1Options()
Definition: mmap_v1_options.h:41
int journalOptions
Definition: mmap_v1_options.h:72
Definition: mmap_v1_options.h:64
bool smallfiles
Definition: mmap_v1_options.h:55
Definition: mmap_v1_options.h:69
Definition: mmap_v1_options.h:65
Definition: mmap_v1_options.h:60
MMAPV1Options mmapv1GlobalOptions
Copyright (C) 2017 MongoDB Inc.
Definition: mmap_v1_options.cpp:31
unsigned lenForNewNsFiles
Definition: mmap_v1_options.h:51