Skip to content

Commit

Permalink
5
Browse files Browse the repository at this point in the history
  • Loading branch information
Yukang-Lian committed May 16, 2024
1 parent cdfb62e commit f4bdbde
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
9 changes: 7 additions & 2 deletions be/src/olap/base_tablet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

#include <memory>

#include "common/exception.h"
#include "common/status.h"
#include "olap/calc_delete_bitmap_executor.h"
#include "olap/delete_bitmap_calculator.h"
Expand Down Expand Up @@ -555,8 +556,12 @@ Status BaseTablet::lookup_row_key(const Slice& encoded_key, bool with_seq_col,
SegmentCache::CacheKey cache_key(rs->rowset_id(), segments[id]->id());
auto cache_value = std::make_unique<SegmentCache::CacheValue>();
cache_value->segment = segments[id];
SegmentLoader::instance()->update_segment(cache_key, *cache_value);
cache_value.release();
try {
SegmentLoader::instance()->update_segment(cache_key, *cache_value);
cache_value.release();
} catch (const Exception& e) {
s = e.to_status();
}
if (s.is<KEY_NOT_FOUND>()) {
continue;
}
Expand Down
9 changes: 7 additions & 2 deletions be/src/olap/segment_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <string>

#include "common/config.h"
#include "common/exception.h"
#include "olap/olap_define.h"
#include "olap/rowset/beta_rowset.h"
#include "util/stopwatch.hpp"
Expand Down Expand Up @@ -67,8 +68,12 @@ Status SegmentLoader::load_segments(const BetaRowsetSharedPtr& rowset,
// memory of SegmentCache::CacheValue will be handled by SegmentCache
auto cache_value = std::make_unique<SegmentCache::CacheValue>();
cache_value->segment = std::move(segment);
_segment_cache->insert(cache_key, *cache_value, cache_handle);
cache_value.release();
try {
_segment_cache->insert(cache_key, *cache_value, cache_handle);
cache_value.release();
} catch (const Exception& e) {
return e.to_status();
}
} else {
cache_handle->push_segment(std::move(segment));
}
Expand Down

0 comments on commit f4bdbde

Please sign in to comment.