Skip to content

Commit 3691a5c

Browse files
authored
refactor: add a manifest dir to hold all manifest related files (#372)
Improve code organization by collecting manifest-related files into a dedicate directory. Writer helpers are renamed with _internal.h suffix to prevent installation, keeping the public API clean.
1 parent 7e99399 commit 3691a5c

34 files changed

+164
-117
lines changed

src/iceberg/CMakeLists.txt

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,15 @@ set(ICEBERG_SOURCES
3333
file_writer.cc
3434
inheritable_metadata.cc
3535
json_internal.cc
36-
manifest_adapter.cc
37-
manifest_entry.cc
38-
manifest_list.cc
39-
manifest_reader.cc
40-
manifest_reader_internal.cc
41-
manifest_writer.cc
36+
manifest/manifest_adapter.cc
37+
manifest/manifest_entry.cc
38+
manifest/manifest_list.cc
39+
manifest/manifest_reader.cc
40+
manifest/manifest_reader_internal.cc
41+
manifest/manifest_writer.cc
42+
manifest/v1_metadata.cc
43+
manifest/v2_metadata.cc
44+
manifest/v3_metadata.cc
4245
metadata_columns.cc
4346
name_mapping.cc
4447
partition_field.cc
@@ -74,10 +77,7 @@ set(ICEBERG_SOURCES
7477
util/temporal_util.cc
7578
util/timepoint.cc
7679
util/truncate_util.cc
77-
util/uuid.cc
78-
v1_metadata.cc
79-
v2_metadata.cc
80-
v3_metadata.cc)
80+
util/uuid.cc)
8181

8282
set(ICEBERG_STATIC_BUILD_INTERFACE_LIBS)
8383
set(ICEBERG_SHARED_BUILD_INTERFACE_LIBS)
@@ -131,6 +131,7 @@ iceberg_install_all_headers(iceberg)
131131

132132
add_subdirectory(catalog)
133133
add_subdirectory(expression)
134+
add_subdirectory(manifest)
134135
add_subdirectory(row)
135136
add_subdirectory(util)
136137

src/iceberg/inheritable_metadata.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323

2424
#include <iceberg/result.h>
2525

26-
#include "iceberg/manifest_entry.h"
27-
#include "iceberg/manifest_list.h"
26+
#include "iceberg/manifest/manifest_entry.h"
27+
#include "iceberg/manifest/manifest_list.h"
2828
#include "iceberg/snapshot.h"
2929

3030
namespace iceberg {
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+
iceberg_install_all_headers(iceberg/manifest)
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,15 @@
1717
* under the License.
1818
*/
1919

20-
#include "iceberg/manifest_adapter.h"
21-
2220
#include <memory>
2321
#include <utility>
2422

2523
#include <nanoarrow/nanoarrow.h>
2624

2725
#include "iceberg/arrow/nanoarrow_status_internal.h"
28-
#include "iceberg/manifest_entry.h"
29-
#include "iceberg/manifest_list.h"
26+
#include "iceberg/manifest/manifest_adapter_internal.h"
27+
#include "iceberg/manifest/manifest_entry.h"
28+
#include "iceberg/manifest/manifest_list.h"
3029
#include "iceberg/result.h"
3130
#include "iceberg/schema.h"
3231
#include "iceberg/util/checked_cast.h"

src/iceberg/manifest_adapter.h renamed to src/iceberg/manifest/manifest_adapter_internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
#pragma once
2121

22-
/// \file iceberg/manifest_adapter.h
22+
/// \file iceberg/manifest/manifest_adapter_internal.h
2323
/// Base class for adapters handling v1/v2/v3/v4 manifest metadata.
2424

2525
#include <memory>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* under the License.
1818
*/
1919

20-
#include "iceberg/manifest_entry.h"
20+
#include "iceberg/manifest/manifest_entry.h"
2121

2222
#include <memory>
2323
#include <vector>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919

2020
#pragma once
2121

22+
/// \file iceberg/manifest/manifest_entry.h
23+
2224
#include <cstdint>
2325
#include <map>
2426
#include <memory>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* under the License.
1818
*/
1919

20-
#include "iceberg/manifest_list.h"
20+
#include "iceberg/manifest/manifest_list.h"
2121

2222
#include "iceberg/schema.h"
2323

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
#pragma once
2121

22-
/// \file iceberg/manifest_list.h
22+
/// \file iceberg/manifest/manifest_list.h
2323

2424
#include <cstdint>
2525
#include <optional>
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
* under the License.
1818
*/
1919

20-
#include "iceberg/manifest_reader.h"
20+
#include "iceberg/manifest/manifest_reader.h"
2121

22-
#include "iceberg/manifest_entry.h"
23-
#include "iceberg/manifest_list.h"
24-
#include "iceberg/manifest_reader_internal.h"
22+
#include "iceberg/manifest/manifest_entry.h"
23+
#include "iceberg/manifest/manifest_list.h"
24+
#include "iceberg/manifest/manifest_reader_internal.h"
2525
#include "iceberg/schema.h"
2626
#include "iceberg/schema_internal.h"
2727
#include "iceberg/type.h"

0 commit comments

Comments
 (0)