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

Import("env")

#
# Schema and backward compatibility code for "config" collections.
#

env.Library('base', ['mongo_version_range.cpp',
                     'type_database.cpp',
                     'type_locks.cpp',
                     'type_lockpings.cpp',
                     'type_config_version.cpp',
                     'type_mongos.cpp',
                     'type_tags.cpp'],
            LIBDEPS=['$BUILD_DIR/mongo/base/base',
                     '$BUILD_DIR/mongo/bson'])

env.CppUnitTest('chunk_version_test', 'chunk_version_test.cpp',
                LIBDEPS=['base',
                         '$BUILD_DIR/mongo/db/common'])

env.CppUnitTest('mongo_version_range_test', 'mongo_version_range_test.cpp', 
                LIBDEPS=['base',
                         '$BUILD_DIR/mongo/bson',
                         '$BUILD_DIR/mongo/db/common'])

env.CppUnitTest('type_config_version_test', 'type_config_version_test.cpp',
                LIBDEPS=['base',
                         '$BUILD_DIR/mongo/db/common'])

env.CppUnitTest('type_database_test', 'type_database_test.cpp',
                LIBDEPS=['base',
                         '$BUILD_DIR/mongo/db/common'])

env.CppUnitTest('type_locks_test', 'type_locks_test.cpp',
                LIBDEPS=['base',
                         '$BUILD_DIR/mongo/db/common'])

env.CppUnitTest('type_lockpings_test', 'type_lockpings_test.cpp',
                LIBDEPS=['base',
                         '$BUILD_DIR/mongo/db/common'])

env.CppUnitTest('type_mongos_test', 'type_mongos_test.cpp',
                LIBDEPS=['base',
                         '$BUILD_DIR/mongo/db/common'])

env.CppUnitTest('type_tags_test', 'type_tags_test.cpp',
                LIBDEPS=['base',
                         '$BUILD_DIR/mongo/db/common'])

#
# Support for maintaining persistent sharding state and data.
#

env.Library(
    target='metadata',
    source=[
        'collection_metadata.cpp',
        'metadata_loader.cpp',
    ],
    LIBDEPS=[
        'base',
        'catalog/catalog_types',
        '$BUILD_DIR/mongo/bson',
        '$BUILD_DIR/mongo/base/base',
        '$BUILD_DIR/mongo/client/clientdriver',
        '$BUILD_DIR/mongo/range_arithmetic',
    ]
)

env.CppUnitTest(
    target='metadata_test',
    source=[
        'chunk_diff_test.cpp',
        'metadata_loader_test.cpp',
        'collection_metadata_test.cpp',
    ],
    LIBDEPS=[
        'catalog/legacy/catalog_manager_legacy',
        'metadata',
        '$BUILD_DIR/mongo/coredb',
        '$BUILD_DIR/mongo/coreserver',
        '$BUILD_DIR/mongo/coreshard',
        '$BUILD_DIR/mongo/mocklib',
        '$BUILD_DIR/mongo/mongocommon',
        '$BUILD_DIR/mongo/mongoscore',
        '$BUILD_DIR/mongo/db/common',
    ])

#
# Write Operations
#

# Types for write operations
# TODO: Push upward into shared types library between mongos/mongod
env.Library(
    target='batch_write_types',
    source=[
        'write_ops/batched_command_request.cpp',
        'write_ops/batched_command_response.cpp',
        'write_ops/batched_delete_request.cpp',
        'write_ops/batched_delete_document.cpp',
        'write_ops/batched_insert_request.cpp',
        'write_ops/batched_request_metadata.cpp',
        'write_ops/batched_update_request.cpp',
        'write_ops/batched_update_document.cpp',
        'write_ops/batched_upsert_detail.cpp',
        'write_ops/wc_error_detail.cpp',
        'write_ops/write_error_detail.cpp',
    ],
    LIBDEPS=[
        '$BUILD_DIR/mongo/base/base',
        '$BUILD_DIR/mongo/bson',
    ],
)

env.CppUnitTest(
    target='batch_write_types_test',
    source=[
        'write_ops/batched_command_response_test.cpp',
        'write_ops/batched_delete_request_test.cpp',
        'write_ops/batched_insert_request_test.cpp',
        'write_ops/batched_request_metadata_test.cpp',
        'write_ops/batched_update_request_test.cpp',
    ],
    LIBDEPS=[
        'batch_write_types',
        '$BUILD_DIR/mongo/db/common',
    ]
)

#
# State and execution of operations across multiple hosts
#
# This functionality is self-contained and independent of any network or system-level
# code.
#
env.Library(
    target='cluster_ops',
    source=[
        'write_ops/write_op.cpp',
        'write_ops/batch_write_op.cpp',
        'write_ops/batch_write_exec.cpp',
    ],
    LIBDEPS=[
        '$BUILD_DIR/mongo/bson',
        '$BUILD_DIR/mongo/client/clientdriver',
        'batch_write_types',
        '$BUILD_DIR/mongo/synchronization'
    ],
)

env.CppUnitTest(
    target='cluster_ops_test',
    source=[
        'write_ops/write_op_test.cpp',
        'write_ops/batch_write_op_test.cpp',
        'write_ops/batch_write_exec_test.cpp',
    ],
    LIBDEPS=[
        'cluster_ops',
        '$BUILD_DIR/mongo/db/common',
        '$BUILD_DIR/mongo/range_arithmetic',
    ]
)

# Upconvert/Downconvert write functionality for mongos
env.Library(
    target='cluster_write_op_conversion',
    source=[
        'write_ops/batch_upconvert.cpp',
        'write_ops/batch_downconvert.cpp',
    ],
    LIBDEPS=[
        '$BUILD_DIR/mongo/bson',
        'cluster_ops',
        '$BUILD_DIR/mongo/db/common', # for Message
    ],
)

env.CppUnitTest(
    target='cluster_write_op_conversion_test',
    source=[
        'write_ops/batch_upconvert_test.cpp',
        'write_ops/batch_downconvert_test.cpp',
    ],
    LIBDEPS=[
        'cluster_ops',
        'cluster_write_op_conversion',
        '$BUILD_DIR/mongo/db/common',
        '$BUILD_DIR/mongo/client/clientdriver',
    ]
)

#
# 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=[
        '$BUILD_DIR/mongo/bson',
        '$BUILD_DIR/mongo/s/client/sharding_client',
        'cluster_ops',
        'cluster_write_op_conversion',
    ],
)

env.CppUnitTest(
    target='chunk_manager_targeter_test',
    source=[
        'chunk_manager_targeter_test.cpp',
    ],
    LIBDEPS=[
        '$BUILD_DIR/mongo/coredb',
        '$BUILD_DIR/mongo/coreserver',
        '$BUILD_DIR/mongo/coreshard',
        '$BUILD_DIR/mongo/mongocommon',
        '$BUILD_DIR/mongo/mongoscore',
    ]
)