# -*- mode: python -*- Import("env") env = env.Clone() # This is the main library to use for consumers of sharding on a mongod shard. It will pull the # version checking and document filtering functionality. # # This is the only library, which should be referenced directly outside of mongo/s/ and mongo/db/s/ env.Library( target='sharding_api_d', source=[ 'collection_metadata.cpp', 'collection_sharding_state.cpp', 'database_sharding_state.cpp', 'operation_sharding_state.cpp', 'sharded_connection_info.cpp', 'sharding_migration_critical_section.cpp', 'sharding_state.cpp', 'transaction_coordinator_curop.cpp', 'transaction_coordinator_factory.cpp', 'transaction_coordinator_worker_curop_repository.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/db/concurrency/lock_manager', '$BUILD_DIR/mongo/db/range_arithmetic', '$BUILD_DIR/mongo/s/sharding_routing_table', ], ) env.Library( target='sharding_runtime_d', source=[ 'active_migrations_registry.cpp', 'active_move_primaries_registry.cpp', 'active_shard_collection_registry.cpp', 'chunk_move_write_concern_options.cpp', 'chunk_splitter.cpp', 'collection_sharding_runtime.cpp', 'collection_sharding_state_factory_shard.cpp', 'collection_sharding_state_factory_standalone.cpp', 'config_server_op_observer.cpp', 'implicit_create_collection.cpp', 'metadata_manager.cpp', 'migration_chunk_cloner_source_legacy.cpp', 'migration_chunk_cloner_source.cpp', 'migration_coordinator.cpp', 'migration_destination_manager.cpp', 'migration_session_id.cpp', 'migration_source_manager.cpp', 'migration_util.cpp', 'move_primary_source_manager.cpp', 'move_timing_helper.cpp', 'namespace_metadata_change_notifications.cpp', 'periodic_balancer_config_refresher.cpp', 'periodic_sharded_index_consistency_checker.cpp', 'range_deletion_util.cpp', 'read_only_catalog_cache_loader.cpp', 'scoped_operation_completion_sharding_actions.cpp', 'session_catalog_migration_destination.cpp', 'session_catalog_migration_source.cpp', 'shard_filtering_metadata_refresh.cpp', 'shard_identity_rollback_notifier.cpp', 'shard_key_util.cpp', 'shard_metadata_util.cpp', 'shard_server_catalog_cache_loader.cpp', 'shard_server_op_observer.cpp', 'sharding_config_optime_gossip.cpp', 'sharding_initialization_mongod.cpp', 'sharding_state_recovery.cpp', 'sharding_statistics.cpp', 'split_chunk.cpp', 'split_vector.cpp', 'start_chunk_clone_request.cpp', env.Idlc('sharding_runtime_d_params.idl')[0], env.Idlc('range_deletion_task.idl')[0], env.Idlc('migration_coordinator_document.idl')[0], ], LIBDEPS=[ '$BUILD_DIR/mongo/db/catalog/multi_index_block', '$BUILD_DIR/mongo/db/commands/mongod_fcv', '$BUILD_DIR/mongo/db/db_raii', '$BUILD_DIR/mongo/db/dbhelpers', '$BUILD_DIR/mongo/db/op_observer_impl', '$BUILD_DIR/mongo/db/ops/write_ops_exec', '$BUILD_DIR/mongo/db/repl/oplog', '$BUILD_DIR/mongo/db/repl/repl_coordinator_interface', '$BUILD_DIR/mongo/db/rw_concern_d', '$BUILD_DIR/mongo/db/server_options_core', '$BUILD_DIR/mongo/db/storage/remove_saver', '$BUILD_DIR/mongo/db/transaction', '$BUILD_DIR/mongo/s/client/shard_local', '$BUILD_DIR/mongo/s/query/cluster_aggregate', '$BUILD_DIR/mongo/s/sharding_initialization', 'chunk_splitter', 'sharding_api_d', 'sharding_catalog_manager', 'sharding_logging', 'transaction_coordinator', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/db/index_builds_coordinator_interface', '$BUILD_DIR/mongo/db/session_catalog', '$BUILD_DIR/mongo/idl/server_parameter', ], ) env.Library( target='sharding_runtime_d_embedded', source=[ 'collection_sharding_state_factory_embedded.cpp', ], LIBDEPS=[ 'sharding_api_d', ], ) env.Library( target='op_observer_sharding_impl', source=[ 'op_observer_sharding_impl.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/db/op_observer_impl', ], LIBDEPS_PRIVATE=[ 'sharding_runtime_d', ], ) env.Library( target='transaction_coordinator', source=[ 'server_transaction_coordinators_metrics.cpp', 'single_transaction_coordinator_stats.cpp', 'transaction_coordinator_catalog.cpp', 'transaction_coordinator_curop_mongod.cpp', 'transaction_coordinator_factory_mongod.cpp', 'transaction_coordinator_futures_util.cpp', 'transaction_coordinator_metrics_observer.cpp', 'transaction_coordinator_service.cpp', 'transaction_coordinator_structures.cpp', 'transaction_coordinator_util.cpp', 'transaction_coordinator_worker_curop_repository_mongod.cpp', 'transaction_coordinator.cpp', 'wait_for_majority_service.cpp', env.Idlc('transaction_coordinator_document.idl')[0], env.Idlc('transaction_coordinators_stats.idl')[0], ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/db/transaction', '$BUILD_DIR/mongo/db/commands/server_status', '$BUILD_DIR/mongo/db/commands/txn_cmd_request', '$BUILD_DIR/mongo/db/dbdirectclient', '$BUILD_DIR/mongo/db/rw_concern_d', '$BUILD_DIR/mongo/executor/task_executor_pool', '$BUILD_DIR/mongo/s/grid', 'sharding_api_d', ] ) env.Library( target='chunk_splitter', source=[ 'chunk_split_state_driver.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/s/chunk_writes_tracker' ], ) env.Library( target='type_shard_identity', source=[ env.Idlc('add_shard_cmd.idl')[0], 'type_shard_identity.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/s/write_ops/batch_write_types', '$BUILD_DIR/mongo/bson/util/bson_extract', '$BUILD_DIR/mongo/s/common_s', ], ) env.Library( target='balancer', source=[ 'balancer/balancer_chunk_selection_policy_impl.cpp', 'balancer/balancer_chunk_selection_policy.cpp', 'balancer/balancer_policy.cpp', 'balancer/balancer.cpp', 'balancer/cluster_statistics_impl.cpp', 'balancer/cluster_statistics.cpp', 'balancer/migration_manager.cpp', 'balancer/scoped_migration_request.cpp', 'balancer/type_migration.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/bson/util/bson_extract', '$BUILD_DIR/mongo/db/common', '$BUILD_DIR/mongo/db/repl/repl_coordinator_interface', '$BUILD_DIR/mongo/s/catalog/dist_lock_manager', '$BUILD_DIR/mongo/s/client/sharding_client', '$BUILD_DIR/mongo/s/coreshard', 'sharding_logging', ], ) env.Library( target='sharding_catalog_manager', source=[ 'add_shard_util.cpp', 'config/initial_split_policy.cpp', 'config/namespace_serializer.cpp', 'config/sharding_catalog_manager_chunk_operations.cpp', 'config/sharding_catalog_manager_collection_operations.cpp', 'config/sharding_catalog_manager_database_operations.cpp', 'config/sharding_catalog_manager_shard_operations.cpp', 'config/sharding_catalog_manager_zone_operations.cpp', 'config/sharding_catalog_manager.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/db/audit', '$BUILD_DIR/mongo/db/catalog/collection_options', '$BUILD_DIR/mongo/db/catalog_raii', '$BUILD_DIR/mongo/db/repl/read_concern_args', '$BUILD_DIR/mongo/db/rw_concern_d', '$BUILD_DIR/mongo/executor/network_interface', '$BUILD_DIR/mongo/s/catalog/sharding_catalog_client', '$BUILD_DIR/mongo/s/client/sharding_client', '$BUILD_DIR/mongo/s/coreshard', '$BUILD_DIR/mongo/s/sharding_legacy_api', 'balancer', 'type_shard_identity', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/db/commands/mongod_fcv', '$BUILD_DIR/mongo/s/catalog/sharding_catalog_client_impl', ], ) env.Library( target='sharding_commands_d', source=[ 'add_shard_cmd.cpp', 'check_sharding_index_command.cpp', 'cleanup_orphaned_cmd.cpp', 'clone_catalog_data_command.cpp', 'clone_collection_options_from_primary_shard_cmd.cpp', 'config/configsvr_add_shard_command.cpp', 'config/configsvr_add_shard_to_zone_command.cpp', 'config/configsvr_balancer_collection_status_command.cpp', 'config/configsvr_clear_jumbo_flag_command.cpp', 'config/configsvr_commit_chunk_migration_command.cpp', 'config/configsvr_commit_move_primary_command.cpp', 'config/configsvr_control_balancer_command.cpp', 'config/configsvr_create_collection_command.cpp', 'config/configsvr_create_database_command.cpp', 'config/configsvr_drop_collection_command.cpp', 'config/configsvr_drop_database_command.cpp', 'config/configsvr_enable_sharding_command.cpp', 'config/configsvr_ensure_chunk_version_is_greater_than_command.cpp', 'config/configsvr_merge_chunk_command.cpp', 'config/configsvr_move_chunk_command.cpp', 'config/configsvr_move_primary_command.cpp', 'config/configsvr_refine_collection_shard_key_command.cpp', 'config/configsvr_remove_shard_command.cpp', 'config/configsvr_remove_shard_from_zone_command.cpp', 'config/configsvr_shard_collection_command.cpp', 'config/configsvr_split_chunk_command.cpp', 'config/configsvr_update_zone_key_range_command.cpp', 'flush_database_cache_updates_command.cpp', 'flush_routing_table_cache_updates_command.cpp', 'get_database_version_command.cpp', 'get_shard_version_command.cpp', 'merge_chunks_command.cpp', 'migration_chunk_cloner_source_legacy_commands.cpp', 'migration_destination_manager_legacy_commands.cpp', 'move_chunk_command.cpp', 'move_primary_command.cpp', 'set_shard_version_command.cpp', 'sharding_server_status.cpp', 'sharding_state_command.cpp', 'shardsvr_shard_collection.cpp', 'split_chunk_command.cpp', 'split_vector_command.cpp', 'txn_two_phase_commit_cmds.cpp', 'unset_sharding_command.cpp', 'wait_for_ongoing_chunk_splits_command.cpp', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/db/bson/dotted_path_support', '$BUILD_DIR/mongo/db/catalog/catalog_helpers', '$BUILD_DIR/mongo/db/cloner', '$BUILD_DIR/mongo/db/commands/mongod_fcv', '$BUILD_DIR/mongo/db/commands/server_status', '$BUILD_DIR/mongo/db/commands/test_commands_enabled', '$BUILD_DIR/mongo/db/commands/txn_cmd_request', '$BUILD_DIR/mongo/db/repl/repl_coordinator_interface', '$BUILD_DIR/mongo/db/repl/replica_set_messages', '$BUILD_DIR/mongo/s/commands/shared_cluster_commands', '$BUILD_DIR/mongo/s/sharding_router_api', '$BUILD_DIR/mongo/s/sharding_initialization', 'balancer', 'sharding_runtime_d', ], ) env.Library( target='sharding_logging', source=[ 'sharding_logging.cpp', ], LIBDEPS=[ 'sharding_api_d', '$BUILD_DIR/mongo/s/catalog/sharding_catalog_client_impl', ], ) env.CppUnitTest( target='db_s_test', source=[ 'chunk_split_state_driver_test.cpp', 'config_server_op_observer_test.cpp', 'migration_session_id_test.cpp', 'sharding_logging_test.cpp', 'start_chunk_clone_request_test.cpp', 'type_shard_identity_test.cpp', 'wait_for_majority_service_test.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/db/auth/authmocks', '$BUILD_DIR/mongo/db/auth/authmocks', '$BUILD_DIR/mongo/s/config_server_test_fixture', '$BUILD_DIR/mongo/s/sharding_router_test_fixture', 'chunk_splitter', 'sharding_logging', 'sharding_runtime_d', 'sharding_runtime_d', 'type_shard_identity', ], ) env.CppUnitTest( target='db_s_balancer_test', source=[ 'balancer/balancer_chunk_selection_policy_test.cpp', 'balancer/balancer_policy_test.cpp', 'balancer/cluster_statistics_test.cpp', 'balancer/migration_manager_test.cpp', 'balancer/migration_test_fixture.cpp', 'balancer/scoped_migration_request_test.cpp', 'balancer/type_migration_test.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/db/auth/authmocks', '$BUILD_DIR/mongo/db/read_write_concern_defaults_mock', '$BUILD_DIR/mongo/db/repl/replication_info', '$BUILD_DIR/mongo/s/config_server_test_fixture', '$BUILD_DIR/mongo/util/version_impl', 'balancer', ] ) env.CppUnitTest( target='db_s_shard_server_test', source=[ 'active_migrations_registry_test.cpp', 'active_move_primaries_registry_test.cpp', 'active_shard_collection_registry_test.cpp', 'catalog_cache_loader_mock.cpp', 'implicit_create_collection_test.cpp', 'migration_chunk_cloner_source_legacy_test.cpp', 'migration_destination_manager_test.cpp', 'migration_util_test.cpp', 'namespace_metadata_change_notifications_test.cpp', 'session_catalog_migration_destination_test.cpp', 'session_catalog_migration_source_test.cpp', 'shard_metadata_util_test.cpp', 'shard_server_catalog_cache_loader_test.cpp', 'sharding_initialization_mongod_test.cpp', 'sharding_initialization_op_observer_test.cpp', 'split_vector_test.cpp', ], LIBDEPS_PRIVATE=[ '$BUILD_DIR/mongo/db/auth/authmocks', '$BUILD_DIR/mongo/db/logical_session_cache_impl', '$BUILD_DIR/mongo/db/ops/write_ops_exec', '$BUILD_DIR/mongo/db/query/query_request', '$BUILD_DIR/mongo/db/repl/mock_repl_coord_server_fixture', '$BUILD_DIR/mongo/db/repl/storage_interface_impl', '$BUILD_DIR/mongo/s/catalog/dist_lock_manager_mock', '$BUILD_DIR/mongo/s/catalog/sharding_catalog_client_impl', '$BUILD_DIR/mongo/s/catalog/sharding_catalog_client_mock', '$BUILD_DIR/mongo/s/shard_server_test_fixture', 'sharding_runtime_d', ], ) env.CppUnitTest( target='db_s_collection_sharding_runtime_test', source=[ 'collection_metadata_filtering_test.cpp', 'collection_metadata_test.cpp', 'collection_sharding_state_test.cpp', 'metadata_manager_test.cpp', 'persistent_task_store_test.cpp', 'persistent_task_queue_test.cpp', 'range_deletion_util_test.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/client/remote_command_targeter_mock', '$BUILD_DIR/mongo/db/auth/authmocks', '$BUILD_DIR/mongo/db/repl/replmocks', '$BUILD_DIR/mongo/executor/network_test_env', '$BUILD_DIR/mongo/executor/thread_pool_task_executor_test_fixture', '$BUILD_DIR/mongo/s/shard_server_test_fixture', ], ) env.CppUnitTest( target='db_s_transaction_coordinator_test', source=[ 'transaction_coordinator_catalog_test.cpp', 'transaction_coordinator_futures_util_test.cpp', 'transaction_coordinator_service_test.cpp', 'transaction_coordinator_structures_test.cpp', 'transaction_coordinator_test_fixture.cpp', 'transaction_coordinator_test.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/db/auth/authmocks', '$BUILD_DIR/mongo/db/commands/server_status', '$BUILD_DIR/mongo/s/catalog/sharding_catalog_client_mock', '$BUILD_DIR/mongo/s/shard_server_test_fixture', 'transaction_coordinator', ], ) env.CppUnitTest( target='db_s_sharding_catalog_manager_test', source=[ 'config/initial_split_policy_test.cpp', 'config/sharding_catalog_manager_add_shard_test.cpp', 'config/sharding_catalog_manager_add_shard_to_zone_test.cpp', 'config/sharding_catalog_manager_assign_key_range_to_zone_test.cpp', 'config/sharding_catalog_manager_clear_jumbo_flag_test.cpp', 'config/sharding_catalog_manager_commit_chunk_migration_test.cpp', 'config/sharding_catalog_manager_config_initialization_test.cpp', 'config/sharding_catalog_manager_create_collection_test.cpp', 'config/sharding_catalog_manager_create_database_test.cpp', 'config/sharding_catalog_manager_drop_coll_test.cpp', 'config/sharding_catalog_manager_enable_sharding_test.cpp', 'config/sharding_catalog_manager_ensure_chunk_version_is_greater_than_test.cpp', 'config/sharding_catalog_manager_merge_chunks_test.cpp', 'config/sharding_catalog_manager_remove_shard_from_zone_test.cpp', 'config/sharding_catalog_manager_remove_shard_test.cpp', 'config/sharding_catalog_manager_shard_collection_test.cpp', 'config/sharding_catalog_manager_split_chunk_test.cpp', ], LIBDEPS=[ '$BUILD_DIR/mongo/db/auth/authmocks', '$BUILD_DIR/mongo/s/config_server_test_fixture', '$BUILD_DIR/mongo/util/version_impl', ] )