Skip to content

Commit 9d71f7e

Browse files
committed
refactor: Restructure catalog module
1 parent 4abc27a commit 9d71f7e

File tree

5 files changed

+113
-45
lines changed

5 files changed

+113
-45
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
install_headers(['in_memory_catalog.h'], subdir: 'iceberg/catalog/memory')

src/iceberg/catalog/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
install_headers(['in_memory_catalog.h'], subdir: 'iceberg/catalog')
18+
subdir('memory')
1919

2020
if get_option('rest').enabled()
2121
subdir('rest')

src/iceberg/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ configure_file(
4141
iceberg_include_dir = include_directories('..')
4242
iceberg_sources = files(
4343
'arrow_c_data_guard_internal.cc',
44-
'catalog/in_memory_catalog.cc',
44+
'catalog/memory/in_memory_catalog.cc',
4545
'expression/expression.cc',
4646
'expression/expressions.cc',
4747
'expression/literal.cc',

src/iceberg/test/meson.build

Lines changed: 66 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -28,53 +28,76 @@ configure_file(
2828
)
2929

3030
iceberg_tests = {
31-
'schema_test': files(
32-
'name_mapping_test.cc',
33-
'partition_field_test.cc',
34-
'partition_spec_test.cc',
35-
'schema_field_test.cc',
36-
'schema_test.cc',
37-
'schema_util_test.cc',
38-
'snapshot_test.cc',
39-
'sort_field_test.cc',
40-
'sort_order_test.cc',
41-
'transform_test.cc',
42-
'type_test.cc',
43-
),
44-
'table_test': files(
45-
'json_internal_test.cc',
46-
'schema_json_test.cc',
47-
'table_test.cc',
48-
'test_common.cc',
49-
),
50-
'expression_test': files(
51-
'expression_test.cc',
52-
'literal_test.cc',
53-
'predicate_test.cc',
54-
),
55-
'json_serde_test': files(
56-
'json_internal_test.cc',
57-
'metadata_serde_test.cc',
58-
'schema_json_test.cc',
59-
'test_common.cc',
60-
),
61-
'util_test': files(
62-
'config_test.cc',
63-
'decimal_test.cc',
64-
'endian_test.cc',
65-
'formatter_test.cc',
66-
'string_util_test.cc',
67-
'uuid_test.cc',
68-
'visit_type_test.cc',
69-
),
70-
'roaring_test': files('roaring_test.cc'),
31+
'schema_test': {
32+
'sources': files(
33+
'name_mapping_test.cc',
34+
'partition_field_test.cc',
35+
'partition_spec_test.cc',
36+
'schema_field_test.cc',
37+
'schema_test.cc',
38+
'schema_util_test.cc',
39+
'snapshot_test.cc',
40+
'sort_field_test.cc',
41+
'sort_order_test.cc',
42+
'transform_test.cc',
43+
'type_test.cc',
44+
),
45+
},
46+
'table_test': {
47+
'sources': files(
48+
'json_internal_test.cc',
49+
'schema_json_test.cc',
50+
'table_test.cc',
51+
'test_common.cc',
52+
),
53+
},
54+
'expression_test': {
55+
'sources': files(
56+
'expression_test.cc',
57+
'literal_test.cc',
58+
'predicate_test.cc',
59+
),
60+
},
61+
'json_serde_test': {
62+
'sources': files(
63+
'json_internal_test.cc',
64+
'metadata_serde_test.cc',
65+
'schema_json_test.cc',
66+
'test_common.cc',
67+
),
68+
},
69+
'util_test': {
70+
'sources': files(
71+
'config_test.cc',
72+
'decimal_test.cc',
73+
'endian_test.cc',
74+
'formatter_test.cc',
75+
'string_util_test.cc',
76+
'uuid_test.cc',
77+
'visit_type_test.cc',
78+
),
79+
},
80+
'roaring_test': {'sources': files('roaring_test.cc')},
7181
}
7282

73-
foreach test_name, sources : iceberg_tests
83+
if get_option('rest').enabled()
84+
cpp_httplib_dep = dependency('cpp-httplib')
85+
iceberg_tests += {
86+
'rest_catalog_test': {
87+
'sources': files('rest_catalog_test.cc'),
88+
'dependencies': [iceberg_rest_dep, cpp_httplib_dep],
89+
},
90+
}
91+
endif
92+
93+
foreach test_name, values : iceberg_tests
7494
exc = executable(
7595
test_name,
76-
sources: sources,
77-
dependencies: [iceberg_dep, gmock_main_dep],
96+
sources: values['sources'],
97+
dependencies: [iceberg_dep, gmock_main_dep] + values.get(
98+
'dependencies',
99+
[],
100+
),
78101
)
79102
test(test_name, exc)
80103
endforeach

subprojects/cpp-httplib.wrap

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
[wrap-file]
19+
directory = cpp-httplib-0.26.0
20+
source_url = https://github.com/yhirose/cpp-httplib/archive/refs/tags/v0.26.0.tar.gz
21+
source_filename = cpp-httplib-0.26.0.tar.gz
22+
source_hash = a66f908f50ccb119769adce44fe1eac75f81b6ffab7c4ac0211bb663ffeb2688
23+
source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/cpp-httplib_0.26.0-1/cpp-httplib-0.26.0.tar.gz
24+
wrapdb_version = 0.26.0-1
25+
26+
[provide]
27+
dependency_names = cpp-httplib

0 commit comments

Comments
 (0)