summaryrefslogtreecommitdiff
path: root/src/mongo/s/SConscript
blob: a99be665ed3ee085879bbf13268d3c8eb189bd44 (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
# -*- mode: python -*-

Import("env")

env.SConscript(
    dirs=[
        'catalog',
        'client',
        'commands',
        'query',
        'write_ops',
    ],
)

# Functionality for initializing global sharding state
env.Library(
    target='sharding_initialization',
    source=[
        'sharding_initialization.cpp',
    ],
    LIBDEPS=[
        '$BUILD_DIR/mongo/executor/network_interface_factory',
        '$BUILD_DIR/mongo/executor/network_interface_thread_pool',
        '$BUILD_DIR/mongo/executor/thread_pool_task_executor',
        '$BUILD_DIR/mongo/s/catalog/catalog_manager_impl',
        'client/sharding_connection_hook',
        'coreshard',
    ],
    LIBDEPS_TAGS=[
        # Depends on saveGLEStats, which lacks a unique definition
        'incomplete',
    ],
)

# Functionality shared between mongod and mongos
env.Library(
    target='common',
    source=[
        'chunk_diff.cpp',
        'chunk_version.cpp',
        'migration_secondary_throttle_options.cpp',
        'move_chunk_request.cpp',
        'set_shard_version_request.cpp',
    ],
    LIBDEPS=[
        'catalog/catalog_types',
        '$BUILD_DIR/mongo/client/connection_string',
        '$BUILD_DIR/mongo/db/common',
        '$BUILD_DIR/mongo/db/query/lite_parsed_query',
        '$BUILD_DIR/mongo/db/repl/optime',
        '$BUILD_DIR/mongo/rpc/metadata',
    ]
)

env.Library(
    target='shard_util',
    source=[
        'shard_util.cpp',
    ],
    LIBDEPS=[
        'client/sharding_client',
    ]
)

env.Library(
    target='sharding_test_fixture',
    source=[
        'sharding_test_fixture.cpp',
    ],
    LIBDEPS=[
        '$BUILD_DIR/mongo/client/remote_command_targeter_mock',
        '$BUILD_DIR/mongo/db/auth/authorization_manager_mock_init',
        '$BUILD_DIR/mongo/executor/network_test_env',
        '$BUILD_DIR/mongo/executor/task_executor_pool',
        '$BUILD_DIR/mongo/executor/thread_pool_task_executor_test_fixture',
        '$BUILD_DIR/mongo/rpc/metadata',
        '$BUILD_DIR/mongo/s/catalog/dist_lock_manager_mock',
        '$BUILD_DIR/mongo/s/catalog/catalog_manager_impl',
        '$BUILD_DIR/mongo/s/catalog/replset/catalog_manager_replica_set',
        '$BUILD_DIR/mongo/s/coreshard',
        '$BUILD_DIR/mongo/s/mongoscore',
        '$BUILD_DIR/mongo/util/clock_source_mock',
        '$BUILD_DIR/mongo/util/net/message_port_mock',
    ],
    LIBDEPS_TAGS=[
        # Depends on coreshard, but that would be circular
        'incomplete',
    ],
)

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

env.CppUnitTest(
    target='sharding_request_types_test',
    source=[
        'chunk_version_test.cpp',
        'migration_secondary_throttle_options_test.cpp',
        'move_chunk_request_test.cpp',
        'set_shard_version_request_test.cpp',
    ],
    LIBDEPS=[
        'common',
    ]
)

#
# Implementations of components to perform cluster operations in mongos
#
# This is the glue code implementing the interfaces required by cluster ops
# in particular environments.
#
env.Library(
    target='cluster_ops_impl',
    source=[
        'chunk_manager_targeter.cpp',
        'cluster_explain.cpp',
        'cluster_write.cpp',
        'dbclient_shard_resolver.cpp',
    ],
    LIBDEPS=[
        'client/sharding_client',
        'write_ops/cluster_write_op',
        'write_ops/cluster_write_op_conversion',
        '$BUILD_DIR/mongo/base',
    ],
    LIBDEPS_TAGS=[
        # Circular with coreshard, below
        'incomplete',
    ],
)

env.CppUnitTest(
    target='chunk_manager_targeter_test',
    source=[
        'chunk_manager_targeter_test.cpp',
    ],
    LIBDEPS=[
        'coreshard',
        'mongoscore',
        '$BUILD_DIR/mongo/db/auth/authorization_manager_mock_init',
    ]
)

env.CppUnitTest(
    target='chunk_manager_tests',
    source=[
        'chunk_manager_tests.cpp'
    ],
    LIBDEPS=[
        'coreshard',
        '$BUILD_DIR/mongo/s/catalog/replset/catalog_manager_replica_set_test_fixture']
)

# This library contains sharding functionality used by both mongod and mongos. Certain tests,
# which exercise this functionality also link against it.
env.Library(
    target='coreshard',
    source=[
        # This is only here temporarily for auto-split logic in chunk.cpp.
        'balancer_policy.cpp',
        'chunk.cpp',
        'chunk_manager.cpp',
        'config.cpp',
        'grid.cpp',
        'shard_key_pattern.cpp',
        'version_manager.cpp',
    ],
    LIBDEPS=[
        '$BUILD_DIR/mongo/s/query/cluster_cursor_manager',
        '$BUILD_DIR/mongo/executor/task_executor_pool',
        'catalog/catalog_manager_impl',
        'catalog/catalog_types',
        'client/sharding_client',
        'cluster_ops_impl',
        'common',
        'shard_util',
    ],
    LIBDEPS_TAGS=[
        'incomplete',
    ],
)

# This library is only used by the mongos execuable and any tests which require mongos runtime
# objects, such as the request processing pipeline or the balancer.
env.Library(
    target='mongoscore',
    source=[
        'balance.cpp',
        'cluster_cursor_stats.cpp',
        'cluster_last_error_info.cpp',
        'request.cpp',
        's_only.cpp',
        's_sharding_server_status.cpp',
        'strategy.cpp',
        'version_mongos.cpp',
    ],
    LIBDEPS=[
        '$BUILD_DIR/mongo/db/auth/authmongos',
        '$BUILD_DIR/mongo/client/parallel',
        '$BUILD_DIR/mongo/db/fts/ftsmongos',
        '$BUILD_DIR/mongo/db/stats/counters',
        '$BUILD_DIR/mongo/s/query/cluster_query',
        '$BUILD_DIR/mongo/util/concurrency/task',
        'write_ops/cluster_write_op',
        'write_ops/cluster_write_op_conversion',
    ],
    LIBDEPS_TAGS=[
        # Depends on inShutdown
        'incomplete',
    ],
)

env.CppUnitTest(
    target='mongoscore_test',
    source=[
        'balancer_policy_tests.cpp',
        'shard_key_pattern_test.cpp',
    ],
    LIBDEPS=[
        "$BUILD_DIR/mongo/db/auth/authorization_manager_mock_init",
        'coreshard',
        'mongoscore',
    ]
)

env.Library(
    target='serveronly',
    source=[
        "d_merge.cpp",
        "d_migrate.cpp",
        'd_sharding_server_status.cpp',
        "d_split.cpp",
        "d_state.cpp",
    ],
    LIBDEPS=[
        "$BUILD_DIR/mongo/db/concurrency/lock_manager",
        "$BUILD_DIR/mongo/db/query/query",
        "$BUILD_DIR/mongo/db/range_deleter",
        "$BUILD_DIR/mongo/db/s/metadata",
        "$BUILD_DIR/mongo/db/s/sharding",
        "$BUILD_DIR/mongo/executor/network_interface_factory",
        "coreshard",
    ],
    LIBDEPS_TAGS=[
        # Depends on symbols from files in serverOnlyFiles
        'incomplete',
    ],
)