Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions be/src/olap/rowset/segment_group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ SegmentGroup::SegmentGroup(int64_t tablet_id, int64_t rowset_id, const TabletSch
_short_key_length = 0;
_new_short_key_length = 0;
_short_key_buf = nullptr;
_file_created = false;
_new_segment_created = false;
_empty = false;

Expand Down Expand Up @@ -121,7 +120,6 @@ SegmentGroup::SegmentGroup(int64_t tablet_id, int64_t rowset_id, const TabletSch
_short_key_length = 0;
_new_short_key_length = 0;
_short_key_buf = NULL;
_file_created = false;
_new_segment_created = false;
_empty = false;

Expand Down Expand Up @@ -208,7 +206,9 @@ bool SegmentGroup::is_in_use() {
// you can not use SegmentGroup after delete_all_files(), or else unknown behavior occurs.
bool SegmentGroup::delete_all_files() {
bool success = true;
if (!_file_created) { return success; }
if (_empty) {
return success;
}
for (uint32_t seg_id = 0; seg_id < _num_segments; ++seg_id) {
// get full path for one segment
string index_path = construct_index_file_path(seg_id);
Expand Down Expand Up @@ -341,7 +341,6 @@ OLAPStatus SegmentGroup::load() {

_delete_flag = _index.delete_flag();
_index_loaded = true;
_file_created = true;

return OLAP_SUCCESS;
}
Expand Down Expand Up @@ -578,7 +577,6 @@ OLAPStatus SegmentGroup::add_short_key(const RowCursor& short_key, const uint32_
<< "' err='" << strerror_r(errno, errmsg, 64) << "']";
return res;
}
_file_created = true;
_new_segment_created = true;

// 准备FileHeader
Expand Down
1 change: 0 additions & 1 deletion be/src/olap/rowset/segment_group.h
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,6 @@ class SegmentGroup {
// 以下是写入流程时需要的一些中间状态
// 当前写入文件的FileHandler
FileHandler _current_file_handler;
bool _file_created;
bool _new_segment_created;
// 当前写入的FileHeader
FileHeader<OLAPIndexHeaderMessage, OLAPIndexFixedHeader> _file_header;
Expand Down