summaryrefslogtreecommitdiff
path: root/src/mongo/db/storage/mmap_v1/SConscript
blob: 50f32018f8d02bbaeedff8e139572c04000f49df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
# -*- mode: python -*-

Import("env")
Import("mmapv1")

env = env.Clone()

env.Library(
    target='paths',
    source=[
        'paths.cpp',
    ],
    LIBDEPS=[
        '$BUILD_DIR/mongo/base',
    ],
)

env.Library(
    target='mmap_v1_options',
    source=[
        'mmap_v1_options.cpp',
    ],
)

env.Library(
    target = 'storage_mmapv1',
    source = [ "aligned_builder.cpp",
               "catalog/hashtab.cpp",
               "catalog/index_details.cpp",
               "catalog/namespace_details.cpp",
               "catalog/namespace_details_collection_entry.cpp",
               "catalog/namespace_details_rsv1_metadata.cpp",
               "catalog/namespace_index.cpp",
               "commit_notifier.cpp",
               "data_file.cpp",
               "data_file_sync.cpp",
               "durable_mapped_file.cpp",
               "dur.cpp",
               "durop.cpp",
               "dur_preplogbuffer.cpp",
               "dur_commitjob.cpp",
               "dur_recover.cpp",
               "dur_journal.cpp",
               "dur_journal_writer.cpp",
               "dur_recovery_unit.cpp",
               "journal_latency_test_cmd.cpp",
               "mmap_v1_database_catalog_entry.cpp",
               "mmap_v1_engine.cpp",
               "mmap_v1_extent_manager.cpp",
               "mmap_v1_init.cpp" if mmapv1 else "mmap_v1_noinit.cpp",
               "repair_database.cpp",
             ],
    LIBDEPS = [
        'record_store_v1',
        'record_access_tracker',
        'btree',
        'file_allocator',
        'logfile',
        'compress',
        'paths',
        'mmap_v1_options',
        '$BUILD_DIR/mongo/db/catalog/collection_options',
        '$BUILD_DIR/mongo/db/catalog/database',
        '$BUILD_DIR/mongo/db/catalog/database_holder',
        '$BUILD_DIR/mongo/db/catalog/index_catalog',
        '$BUILD_DIR/mongo/db/catalog/index_create',
        '$BUILD_DIR/mongo/db/commands',
        '$BUILD_DIR/mongo/db/commands/server_status',
        '$BUILD_DIR/mongo/db/concurrency/lock_manager',
        '$BUILD_DIR/mongo/db/index_names',
        '$BUILD_DIR/mongo/db/index/index_descriptor',
        '$BUILD_DIR/mongo/db/storage/journal_listener',
        '$BUILD_DIR/mongo/db/storage/kv/kv_prefix',
        '$BUILD_DIR/mongo/db/storage/storage_engine_lock_file',
        '$BUILD_DIR/mongo/db/storage/storage_engine_metadata',
        '$BUILD_DIR/mongo/db/index/index_access_methods',
        '$BUILD_DIR/mongo/db/write_ops',
    ],
)

compressEnv = env.Clone()
compressEnv.InjectThirdPartyIncludePaths(libraries=['snappy'])
compressEnv
compressEnv.Library(
    target='compress',
    source=[
        'compress.cpp',
    ],
    LIBDEPS=[
        'paths',
        '$BUILD_DIR/third_party/shim_snappy',
    ],
)

env.Library(
    target= 'extent',
    source= [
        'extent.cpp',
        'extent_manager.cpp',
        ],
    LIBDEPS= [
        '$BUILD_DIR/mongo/base',
        ]
    )

env.Library(
    target='file_allocator',
    source=[
        'file_allocator.cpp',
    ],
    LIBDEPS=[
        'paths',
        '$BUILD_DIR/mongo/util/fail_point',
        '$BUILD_DIR/mongo/util/processinfo',
    ],
)

env.Library(
    target='logfile',
    source=[
        'logfile.cpp',
    ],
    LIBDEPS=[
        'mmap',
        'paths',
    ],
)

env.Library(
    target='mmap',
    source=[
        'mmap.cpp',
        'mmap_${TARGET_OS_FAMILY}.cpp',
    ],
    LIBDEPS=[
        '$BUILD_DIR/mongo/db/concurrency/lock_manager',
        '$BUILD_DIR/mongo/db/service_context',
        '$BUILD_DIR/mongo/db/storage/storage_options',
        '$BUILD_DIR/mongo/util/progress_meter',
        'file_allocator',
    ],
)

env.Library(
    target= 'record_store_v1',
    source= [
        'record_store_v1_base.cpp',
        'record_store_v1_capped.cpp',
        'record_store_v1_capped_iterator.cpp',
        'record_store_v1_repair_iterator.cpp',
        'record_store_v1_simple.cpp',
        'record_store_v1_simple_iterator.cpp',
        'touch_pages.cpp',
        ],
    LIBDEPS= [
        '$BUILD_DIR/mongo/db/commands/server_status_core',
        '$BUILD_DIR/mongo/db/curop',
        '$BUILD_DIR/mongo/db/service_context',
        '$BUILD_DIR/mongo/db/storage/storage_options',
        '$BUILD_DIR/mongo/util/concurrency/spin_lock',
        '$BUILD_DIR/mongo/util/progress_meter',
        'extent',
        ]
    )

env.Library(
    target='record_store_v1_test_help',
    source=['record_store_v1_test_help.cpp',
            ],
    LIBDEPS=[
        '$BUILD_DIR/mongo/unittest/unittest',
        'record_store_v1'
        ]
    )

env.Library(
    target='record_access_tracker',
    source=['record_access_tracker.cpp',
            ],
    LIBDEPS=[
        '$BUILD_DIR/mongo/base',
        '$BUILD_DIR/mongo/util/net/network',
        '$BUILD_DIR/mongo/util/processinfo',
        ]
    )

env.Library(
    target= 'btree',
    source= [
        'btree/btree_logic.cpp',
        'btree/btree_interface.cpp',
        'btree/btree_ondisk.cpp',
        'btree/key.cpp'
        ],
    LIBDEPS= [
        '$BUILD_DIR/mongo/base',
        '$BUILD_DIR/mongo/db/service_context',
        'record_store_v1',
        ]
    )

if mmapv1:
    env.CppUnitTest(
        target='storage_engine_mmap_v1_init_test',
        source=['mmap_v1_init_test.cpp',
                ],
        LIBDEPS=[
            '$BUILD_DIR/mongo/db/serveronly',
            '$BUILD_DIR/mongo/db/service_context',
            '$BUILD_DIR/mongo/db/storage/storage_engine_metadata',
            '$BUILD_DIR/mongo/db/storage/storage_options',
            ],
        )

    env.CppUnitTest(target = 'record_access_tracker_test',
                    source = ['record_access_tracker_test.cpp'],
                    LIBDEPS = ['record_access_tracker',
                               '$BUILD_DIR/mongo/util/clock_source_mock',
                               '$BUILD_DIR/mongo/util/processinfo',
                               '$BUILD_DIR/mongo/util/net/network'])

    env.CppUnitTest(target = 'namespace_test',
                    source = ['catalog/namespace_test.cpp'],
                    LIBDEPS = ['$BUILD_DIR/mongo/base'])

    env.CppUnitTest(
        target='record_store_v1_simple_test',
        source=['record_store_v1_simple_test.cpp',
                ],
        LIBDEPS=[
            '$BUILD_DIR/mongo/util/decorable',
            'record_store_v1_test_help'
            ]
        )

    env.CppUnitTest(
        target='record_store_v1_capped_test',
        source=['record_store_v1_capped_test.cpp',
                ],
        LIBDEPS=[
            '$BUILD_DIR/mongo/util/decorable',
            'record_store_v1_test_help'
            ]
        )


    env.CppUnitTest(
        target='record_store_v1_test',
        source=['mmap_v1_record_store_test.cpp',
                ],
        LIBDEPS=[
            'record_store_v1_test_help',
            '$BUILD_DIR/mongo/db/storage/record_store_test_harness'
            ]
        )

    env.Library(
        target= 'btree_test_help',
        source= [
            'btree/btree_test_help.cpp',
            'heap_record_store_btree.cpp'
            ],
        LIBDEPS= [
            'btree',
            'record_store_v1_test_help',
            ]
        )

    env.CppUnitTest(
        target='btree_logic_test',
        source=['btree/btree_logic_test.cpp'
                ],
        LIBDEPS=[
            '$BUILD_DIR/mongo/util/decorable',
            'btree_test_help'
            ]
        )

    env.CppUnitTest(
        target='btree_interface_test',
        source=['btree/btree_interface_test.cpp'
                ],
        LIBDEPS=[
            'btree_test_help',
            '$BUILD_DIR/mongo/db/storage/sorted_data_interface_test_harness'
            ]
        )

    env.CppUnitTest(
        target='data_file_version_test',
        source=[
            'data_file_version_test.cpp',
        ],
        LIBDEPS=[
        ],
    )