Make IMergeTreeDataPart::getState() inlinable (#56461)

This commit is contained in:
Alexander Gololobov 2023-11-08 20:30:45 +01:00 committed by GitHub
parent ba87360114
commit 517a184d5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 8 deletions

View File

@ -381,11 +381,6 @@ void IMergeTreeDataPart::setState(MergeTreeDataPartState new_state) const
incrementStateMetric(state);
}
MergeTreeDataPartState IMergeTreeDataPart::getState() const
{
return state;
}
std::pair<DayNum, DayNum> IMergeTreeDataPart::getMinMaxDate() const
{

View File

@ -210,6 +210,8 @@ public:
private:
String mutable_name;
mutable MergeTreeDataPartState state{MergeTreeDataPartState::Temporary};
public:
const String & name; // const ref to private mutable_name
MergeTreePartInfo info;
@ -274,7 +276,7 @@ public:
/// Current state of the part. If the part is in working set already, it should be accessed via data_parts mutex
void setState(MergeTreeDataPartState new_state) const;
MergeTreeDataPartState getState() const;
ALWAYS_INLINE MergeTreeDataPartState getState() const { return state; }
static constexpr std::string_view stateString(MergeTreeDataPartState state) { return magic_enum::enum_name(state); }
constexpr std::string_view stateString() const { return stateString(state); }
@ -676,8 +678,6 @@ private:
void incrementStateMetric(MergeTreeDataPartState state) const;
void decrementStateMetric(MergeTreeDataPartState state) const;
mutable MergeTreeDataPartState state{MergeTreeDataPartState::Temporary};
/// This ugly flag is needed for debug assertions only
mutable bool part_is_probably_removed_from_disk = false;
};