Skip to content

Commit f737a40

Browse files
committed
fix conflict
1 parent b5fa0c4 commit f737a40

File tree

2 files changed

+116
-117
lines changed

2 files changed

+116
-117
lines changed

src/iceberg/table_metadata.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#include <vector>
3030

3131
#include "iceberg/iceberg_export.h"
32-
#include "iceberg/metadata_update.h"
3332
#include "iceberg/type_fwd.h"
3433
#include "iceberg/util/timepoint.h"
3534

src/iceberg/table_requirement.h

Lines changed: 116 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -33,153 +33,153 @@
3333
#include "iceberg/result.h"
3434
#include "iceberg/type_fwd.h"
3535

36-
namespace iceberg {
36+
namespace iceberg {
3737

38-
/// \brief Base class for update requirement operations
39-
///
40-
/// Represents a requirement that must be validated before applying
41-
/// metadata updates to a table. Each concrete subclass represents
42-
/// a specific type of requirement check.
43-
class ICEBERG_EXPORT TableRequirement {
44-
public:
45-
virtual ~TableRequirement() = default;
46-
47-
/// \brief Validate this requirement against table metadata
48-
///
49-
/// \param base The base table metadata to validate against (may be nullptr)
50-
/// \return Status indicating success or failure with error details
51-
virtual Status Validate(const TableMetadata* base) const = 0;
52-
};
53-
54-
/// \brief Requirement that the table does not exist
38+
/// \brief Base class for update requirement operations
39+
///
40+
/// Represents a requirement that must be validated before applying
41+
/// metadata updates to a table. Each concrete subclass represents
42+
/// a specific type of requirement check.
43+
class ICEBERG_EXPORT TableRequirement {
44+
public:
45+
virtual ~TableRequirement() = default;
46+
47+
/// \brief Validate this requirement against table metadata
5548
///
56-
/// This requirement is used when creating a new table to ensure
57-
/// it doesn't already exist.
58-
class ICEBERG_EXPORT AssertTableDoesNotExist : public TableRequirement {
59-
public:
60-
AssertTableDoesNotExist() = default;
49+
/// \param base The base table metadata to validate against (may be nullptr)
50+
/// \return Status indicating success or failure with error details
51+
virtual Status Validate(const TableMetadata* base) const = 0;
52+
};
6153

62-
Status Validate(const TableMetadata* base) const override;
63-
};
54+
/// \brief Requirement that the table does not exist
55+
///
56+
/// This requirement is used when creating a new table to ensure
57+
/// it doesn't already exist.
58+
class ICEBERG_EXPORT AssertTableDoesNotExist : public TableRequirement {
59+
public:
60+
AssertTableDoesNotExist() = default;
6461

65-
/// \brief Requirement that the table UUID matches the expected value
66-
///
67-
/// This ensures the table hasn't been replaced or recreated between
68-
/// reading the metadata and attempting to update it.
69-
class ICEBERG_EXPORT AssertTableUUID : public TableRequirement {
70-
public:
71-
explicit AssertTableUUID(std::string uuid) : uuid_(std::move(uuid)) {}
62+
Status Validate(const TableMetadata* base) const override;
63+
};
7264

73-
const std::string& uuid() const { return uuid_; }
65+
/// \brief Requirement that the table UUID matches the expected value
66+
///
67+
/// This ensures the table hasn't been replaced or recreated between
68+
/// reading the metadata and attempting to update it.
69+
class ICEBERG_EXPORT AssertTableUUID : public TableRequirement {
70+
public:
71+
explicit AssertTableUUID(std::string uuid) : uuid_(std::move(uuid)) {}
7472

75-
Status Validate(const TableMetadata* base) const override;
73+
const std::string& uuid() const { return uuid_; }
7674

77-
private:
78-
std::string uuid_;
79-
};
75+
Status Validate(const TableMetadata* base) const override;
8076

81-
/// \brief Requirement that a reference (branch or tag) points to a specific snapshot
82-
///
83-
/// This requirement validates that a named reference (branch or tag) either:
84-
/// - Points to the expected snapshot ID
85-
/// - Does not exist (if snapshot_id is nullopt)
86-
class ICEBERG_EXPORT AssertRefSnapshotID : public TableRequirement {
87-
public:
88-
AssertRefSnapshotID(std::string ref_name, std::optional<int64_t> snapshot_id)
89-
: ref_name_(std::move(ref_name)), snapshot_id_(snapshot_id) {}
77+
private:
78+
std::string uuid_;
79+
};
80+
81+
/// \brief Requirement that a reference (branch or tag) points to a specific snapshot
82+
///
83+
/// This requirement validates that a named reference (branch or tag) either:
84+
/// - Points to the expected snapshot ID
85+
/// - Does not exist (if snapshot_id is nullopt)
86+
class ICEBERG_EXPORT AssertTableRefSnapshotID : public TableRequirement {
87+
public:
88+
AssertTableRefSnapshotID(std::string ref_name, std::optional<int64_t> snapshot_id)
89+
: ref_name_(std::move(ref_name)), snapshot_id_(snapshot_id) {}
9090

91-
const std::string& ref_name() const { return ref_name_; }
91+
const std::string& ref_name() const { return ref_name_; }
9292

93-
const std::optional<int64_t>& snapshot_id() const { return snapshot_id_; }
93+
const std::optional<int64_t>& snapshot_id() const { return snapshot_id_; }
9494

95-
Status Validate(const TableMetadata* base) const override;
95+
Status Validate(const TableMetadata* base) const override;
9696

97-
private:
98-
std::string ref_name_;
99-
std::optional<int64_t> snapshot_id_;
100-
};
97+
private:
98+
std::string ref_name_;
99+
std::optional<int64_t> snapshot_id_;
100+
};
101101

102-
/// \brief Requirement that the last assigned field ID matches
103-
///
104-
/// This ensures the schema hasn't been modified (by adding fields)
105-
/// since the metadata was read.
106-
class ICEBERG_EXPORT AssertLastAssignedFieldId : public TableRequirement {
107-
public:
108-
explicit AssertLastAssignedFieldId(int32_t last_assigned_field_id)
109-
: last_assigned_field_id_(last_assigned_field_id) {}
102+
/// \brief Requirement that the last assigned field ID matches
103+
///
104+
/// This ensures the schema hasn't been modified (by adding fields)
105+
/// since the metadata was read.
106+
class ICEBERG_EXPORT AssertCurrentTableLastAssignedFieldId : public TableRequirement {
107+
public:
108+
explicit AssertCurrentTableLastAssignedFieldId(int32_t last_assigned_field_id)
109+
: last_assigned_field_id_(last_assigned_field_id) {}
110110

111-
int32_t last_assigned_field_id() const { return last_assigned_field_id_; }
111+
int32_t last_assigned_field_id() const { return last_assigned_field_id_; }
112112

113-
Status Validate(const TableMetadata* base) const override;
113+
Status Validate(const TableMetadata* base) const override;
114114

115-
private:
116-
int32_t last_assigned_field_id_;
117-
};
115+
private:
116+
int32_t last_assigned_field_id_;
117+
};
118118

119-
/// \brief Requirement that the current schema ID matches
120-
///
121-
/// This ensures the active schema hasn't changed since the
122-
/// metadata was read.
123-
class ICEBERG_EXPORT AssertCurrentSchemaID : public TableRequirement {
124-
public:
125-
explicit AssertCurrentSchemaID(int32_t schema_id) : schema_id_(schema_id) {}
119+
/// \brief Requirement that the current schema ID matches
120+
///
121+
/// This ensures the active schema hasn't changed since the
122+
/// metadata was read.
123+
class ICEBERG_EXPORT AssertCurrentTableSchemaID : public TableRequirement {
124+
public:
125+
explicit AssertCurrentTableSchemaID(int32_t schema_id) : schema_id_(schema_id) {}
126126

127-
int32_t schema_id() const { return schema_id_; }
127+
int32_t schema_id() const { return schema_id_; }
128128

129-
Status Validate(const TableMetadata* base) const override;
129+
Status Validate(const TableMetadata* base) const override;
130130

131-
private:
132-
int32_t schema_id_;
133-
};
131+
private:
132+
int32_t schema_id_;
133+
};
134134

135-
/// \brief Requirement that the last assigned partition ID matches
136-
///
137-
/// This ensures partition specs haven't been modified since the
138-
/// metadata was read.
139-
class ICEBERG_EXPORT AssertLastAssignedPartitionId : public TableRequirement {
140-
public:
141-
explicit AssertLastAssignedPartitionId(int32_t last_assigned_partition_id)
142-
: last_assigned_partition_id_(last_assigned_partition_id) {}
135+
/// \brief Requirement that the last assigned partition ID matches
136+
///
137+
/// This ensures partition specs haven't been modified since the
138+
/// metadata was read.
139+
class ICEBERG_EXPORT AssertCurrentTableLastAssignedPartitionId : public TableRequirement {
140+
public:
141+
explicit AssertCurrentTableLastAssignedPartitionId(int32_t last_assigned_partition_id)
142+
: last_assigned_partition_id_(last_assigned_partition_id) {}
143143

144-
int32_t last_assigned_partition_id() const { return last_assigned_partition_id_; }
144+
int32_t last_assigned_partition_id() const { return last_assigned_partition_id_; }
145145

146-
Status Validate(const TableMetadata* base) const override;
146+
Status Validate(const TableMetadata* base) const override;
147147

148-
private:
149-
int32_t last_assigned_partition_id_;
150-
};
148+
private:
149+
int32_t last_assigned_partition_id_;
150+
};
151151

152-
/// \brief Requirement that the default partition spec ID matches
153-
///
154-
/// This ensures the default partition spec hasn't changed since
155-
/// the metadata was read.
156-
class ICEBERG_EXPORT AssertDefaultSpecID : public TableRequirement {
157-
public:
158-
explicit AssertDefaultSpecID(int32_t spec_id) : spec_id_(spec_id) {}
152+
/// \brief Requirement that the default partition spec ID matches
153+
///
154+
/// This ensures the default partition spec hasn't changed since
155+
/// the metadata was read.
156+
class ICEBERG_EXPORT AssertDefaultTableSpecID : public TableRequirement {
157+
public:
158+
explicit AssertDefaultTableSpecID(int32_t spec_id) : spec_id_(spec_id) {}
159159

160-
int32_t spec_id() const { return spec_id_; }
160+
int32_t spec_id() const { return spec_id_; }
161161

162-
Status Validate(const TableMetadata* base) const override;
162+
Status Validate(const TableMetadata* base) const override;
163163

164-
private:
165-
int32_t spec_id_;
166-
};
164+
private:
165+
int32_t spec_id_;
166+
};
167167

168-
/// \brief Requirement that the default sort order ID matches
169-
///
170-
/// This ensures the default sort order hasn't changed since
171-
/// the metadata was read.
172-
class ICEBERG_EXPORT AssertDefaultSortOrderID : public TableRequirement {
173-
public:
174-
explicit AssertDefaultSortOrderID(int32_t sort_order_id)
175-
: sort_order_id_(sort_order_id) {}
168+
/// \brief Requirement that the default sort order ID matches
169+
///
170+
/// This ensures the default sort order hasn't changed since
171+
/// the metadata was read.
172+
class ICEBERG_EXPORT AssertDefaultTableSortOrderID : public TableRequirement {
173+
public:
174+
explicit AssertDefaultTableSortOrderID(int32_t sort_order_id)
175+
: sort_order_id_(sort_order_id) {}
176176

177-
int32_t sort_order_id() const { return sort_order_id_; }
177+
int32_t sort_order_id() const { return sort_order_id_; }
178178

179-
Status Validate(const TableMetadata* base) const override;
179+
Status Validate(const TableMetadata* base) const override;
180180

181-
private:
182-
int32_t sort_order_id_;
183-
};
181+
private:
182+
int32_t sort_order_id_;
183+
};
184184

185185
} // namespace iceberg

0 commit comments

Comments
 (0)