Skip to content

Commit b49e3aa

Browse files
authored
Remove dead code from FragmentInfo and FragmentMetadata (#4667)
This just removes some unused constructor and assignment operators that are no longer used now that these classes are almost exclusively used with shared pointers. --- TYPE: NO_HISTORY DESC: Remove dead code from FragmentInfo and FragmentMetadata
1 parent 310dd6c commit b49e3aa

File tree

4 files changed

+5
-130
lines changed

4 files changed

+5
-130
lines changed

tiledb/sm/fragment/fragment_info.cc

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,6 @@ namespace tiledb::sm {
5151
/* CONSTRUCTORS & DESTRUCTORS */
5252
/* ****************************** */
5353

54-
FragmentInfo::FragmentInfo()
55-
: resources_(nullptr)
56-
, unconsolidated_metadata_num_(0) {
57-
}
58-
5954
FragmentInfo::FragmentInfo(const URI& array_uri, ContextResources& resources)
6055
: array_uri_(array_uri)
6156
, config_(resources.config())
@@ -65,28 +60,6 @@ FragmentInfo::FragmentInfo(const URI& array_uri, ContextResources& resources)
6560

6661
FragmentInfo::~FragmentInfo() = default;
6762

68-
FragmentInfo::FragmentInfo(const FragmentInfo& fragment_info)
69-
: FragmentInfo() {
70-
auto clone = fragment_info.clone();
71-
swap(clone);
72-
}
73-
74-
FragmentInfo::FragmentInfo(FragmentInfo&& fragment_info)
75-
: FragmentInfo() {
76-
swap(fragment_info);
77-
}
78-
79-
FragmentInfo& FragmentInfo::operator=(const FragmentInfo& fragment_info) {
80-
auto clone = fragment_info.clone();
81-
swap(clone);
82-
return *this;
83-
}
84-
85-
FragmentInfo& FragmentInfo::operator=(FragmentInfo&& fragment_info) {
86-
swap(fragment_info);
87-
return *this;
88-
}
89-
9063
/* ********************************* */
9164
/* API */
9265
/* ********************************* */
@@ -1221,36 +1194,4 @@ Status FragmentInfo::replace(
12211194
return Status::Ok();
12221195
}
12231196

1224-
FragmentInfo FragmentInfo::clone() const {
1225-
FragmentInfo clone;
1226-
clone.array_uri_ = array_uri_;
1227-
clone.array_schema_latest_ = array_schema_latest_;
1228-
clone.array_schemas_all_ = array_schemas_all_;
1229-
clone.config_ = config_;
1230-
clone.single_fragment_info_vec_ = single_fragment_info_vec_;
1231-
clone.resources_ = resources_;
1232-
clone.to_vacuum_ = to_vacuum_;
1233-
clone.unconsolidated_metadata_num_ = unconsolidated_metadata_num_;
1234-
clone.anterior_ndrange_ = anterior_ndrange_;
1235-
clone.timestamp_start_ = timestamp_start_;
1236-
clone.timestamp_end_ = timestamp_end_;
1237-
1238-
return clone;
1239-
}
1240-
1241-
void FragmentInfo::swap(FragmentInfo& fragment_info) {
1242-
std::swap(array_uri_, fragment_info.array_uri_);
1243-
std::swap(array_schema_latest_, fragment_info.array_schema_latest_);
1244-
std::swap(array_schemas_all_, fragment_info.array_schemas_all_);
1245-
std::swap(config_, fragment_info.config_);
1246-
std::swap(single_fragment_info_vec_, fragment_info.single_fragment_info_vec_);
1247-
std::swap(resources_, fragment_info.resources_);
1248-
std::swap(to_vacuum_, fragment_info.to_vacuum_);
1249-
std::swap(
1250-
unconsolidated_metadata_num_, fragment_info.unconsolidated_metadata_num_);
1251-
std::swap(anterior_ndrange_, fragment_info.anterior_ndrange_);
1252-
std::swap(timestamp_start_, fragment_info.timestamp_start_);
1253-
std::swap(timestamp_end_, fragment_info.timestamp_end_);
1254-
}
1255-
12561197
} // namespace tiledb::sm

tiledb/sm/fragment/fragment_info.h

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -54,26 +54,16 @@ class FragmentInfo {
5454
/* CONSTRUCTORS & DESTRUCTORS */
5555
/* ********************************* */
5656

57-
/** Constructor. */
58-
FragmentInfo();
57+
FragmentInfo() = delete;
5958

6059
/** Constructor. */
6160
FragmentInfo(const URI& array_uri, ContextResources& resources);
6261

6362
/** Destructor. */
6463
~FragmentInfo();
6564

66-
/** Copy constructor. */
67-
FragmentInfo(const FragmentInfo& fragment_info);
68-
69-
/** Move constructor. */
70-
FragmentInfo(FragmentInfo&& fragment_info);
71-
72-
/** Copy-assign operator. */
73-
FragmentInfo& operator=(const FragmentInfo& fragment_info);
74-
75-
/** Move-assign operator. */
76-
FragmentInfo& operator=(FragmentInfo&& fragment_info);
65+
DISABLE_COPY_AND_COPY_ASSIGN(FragmentInfo);
66+
DISABLE_MOVE_AND_MOVE_ASSIGN(FragmentInfo);
7767

7868
/* ********************************* */
7969
/* API */
@@ -484,15 +474,6 @@ class FragmentInfo {
484474
Status replace(
485475
const SingleFragmentInfo& new_single_fragment_info,
486476
const std::vector<TimestampedURI>& to_replace);
487-
488-
/** Returns a copy of this object. */
489-
FragmentInfo clone() const;
490-
491-
/**
492-
* Swaps the contents (all field values) of this object with the
493-
* given object.
494-
*/
495-
void swap(FragmentInfo& fragment_info);
496477
};
497478

498479
} // namespace sm

tiledb/sm/fragment/fragment_metadata.cc

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -113,51 +113,6 @@ FragmentMetadata::FragmentMetadata(
113113

114114
FragmentMetadata::~FragmentMetadata() = default;
115115

116-
// Copy initialization
117-
FragmentMetadata::FragmentMetadata(const FragmentMetadata& other) {
118-
resources_ = other.resources_;
119-
array_schema_ = other.array_schema_;
120-
dense_ = other.dense_;
121-
fragment_uri_ = other.fragment_uri_;
122-
timestamp_range_ = other.timestamp_range_;
123-
has_consolidated_footer_ = other.has_consolidated_footer_;
124-
rtree_ = other.rtree_;
125-
meta_file_size_ = other.meta_file_size_;
126-
version_ = other.version_;
127-
tile_index_base_ = other.tile_index_base_;
128-
has_timestamps_ = other.has_timestamps_;
129-
has_delete_meta_ = other.has_delete_meta_;
130-
sparse_tile_num_ = other.sparse_tile_num_;
131-
footer_size_ = other.footer_size_;
132-
footer_offset_ = other.footer_offset_;
133-
idx_map_ = other.idx_map_;
134-
array_schema_name_ = other.array_schema_name_;
135-
array_uri_ = other.array_uri_;
136-
}
137-
138-
FragmentMetadata& FragmentMetadata::operator=(const FragmentMetadata& other) {
139-
resources_ = other.resources_;
140-
array_schema_ = other.array_schema_;
141-
dense_ = other.dense_;
142-
fragment_uri_ = other.fragment_uri_;
143-
timestamp_range_ = other.timestamp_range_;
144-
has_consolidated_footer_ = other.has_consolidated_footer_;
145-
rtree_ = other.rtree_;
146-
meta_file_size_ = other.meta_file_size_;
147-
version_ = other.version_;
148-
tile_index_base_ = other.tile_index_base_;
149-
has_timestamps_ = other.has_timestamps_;
150-
has_delete_meta_ = other.has_delete_meta_;
151-
sparse_tile_num_ = other.sparse_tile_num_;
152-
footer_size_ = other.footer_size_;
153-
footer_offset_ = other.footer_offset_;
154-
idx_map_ = other.idx_map_;
155-
array_schema_name_ = other.array_schema_name_;
156-
array_uri_ = other.array_uri_;
157-
158-
return *this;
159-
}
160-
161116
/* ****************************** */
162117
/* API */
163118
/* ****************************** */

tiledb/sm/fragment/fragment_metadata.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,8 @@ class FragmentMetadata {
100100
/** Destructor. */
101101
~FragmentMetadata();
102102

103-
// Copy initialization
104-
FragmentMetadata(const FragmentMetadata& other);
105-
106-
FragmentMetadata& operator=(const FragmentMetadata& other);
103+
DISABLE_COPY_AND_COPY_ASSIGN(FragmentMetadata);
104+
DISABLE_MOVE_AND_MOVE_ASSIGN(FragmentMetadata);
107105

108106
/* ********************************* */
109107
/* TYPE DEFINITIONS */

0 commit comments

Comments
 (0)