github-actions[bot] commented on code in PR #27367:
URL: https://github.com/apache/doris/pull/27367#discussion_r1400427631
##########
be/src/olap/rowset/segment_v2/inverted_index_cache.cpp:
##########
@@ -39,19 +42,78 @@
namespace doris {
namespace segment_v2 {
-IndexSearcherPtr InvertedIndexSearcherCache::build_index_searcher(const
io::FileSystemSPtr& fs,
- const
std::string& index_dir,
- const
std::string& file_name) {
+Status FulltextIndexSearcherBuilder::build(const io::FileSystemSPtr& fs,
+ const std::string& index_dir,
+ const std::string& file_name,
+ OptionalIndexSearcherPtr&
output_searcher) {
DorisCompoundReader* directory =
new DorisCompoundReader(DorisCompoundDirectory::getDirectory(fs,
index_dir.c_str()),
file_name.c_str(),
config::inverted_index_read_buffer_size);
auto closeDirectory = true;
auto index_searcher =
std::make_shared<lucene::search::IndexSearcher>(directory,
closeDirectory);
+ if (!index_searcher) {
+ _CLDECDELETE(directory)
+ output_searcher = std::nullopt;
+ return Status::Error<ErrorCode::INVERTED_INDEX_CLUCENE_ERROR>(
+ "FulltextIndexSearcherBuilder build index_searcher error.");
+ }
// NOTE: need to cl_refcount-- here, so that directory will be deleted when
// index_searcher is destroyed
_CLDECDELETE(directory)
- return index_searcher;
+ output_searcher = index_searcher;
+ return Status::OK();
+}
+
+Status BKDIndexSearcherBuilder::build(const io::FileSystemSPtr& fs, const
std::string& index_dir,
Review Comment:
warning: method 'build' can be made static
[readability-convert-member-functions-to-static]
```suggestion
static Status BKDIndexSearcherBuilder::build(const io::FileSystemSPtr& fs,
const std::string& index_dir,
```
##########
be/src/olap/rowset/segment_v2/inverted_index_cache.h:
##########
@@ -54,16 +55,44 @@ namespace lucene {
namespace search {
class IndexSearcher;
} // namespace search
+namespace util {
+namespace bkd {
Review Comment:
warning: nested namespaces can be concatenated
[modernize-concat-nested-namespaces]
```suggestion
namespace util::bkd {
```
be/src/olap/rowset/segment_v2/inverted_index_cache.h:60:
```diff
- }
- } // namespace util
+ } // namespace util
```
##########
be/src/olap/rowset/segment_v2/inverted_index_cache.cpp:
##########
@@ -39,19 +42,78 @@
namespace doris {
namespace segment_v2 {
-IndexSearcherPtr InvertedIndexSearcherCache::build_index_searcher(const
io::FileSystemSPtr& fs,
- const
std::string& index_dir,
- const
std::string& file_name) {
+Status FulltextIndexSearcherBuilder::build(const io::FileSystemSPtr& fs,
Review Comment:
warning: method 'build' can be made static
[readability-convert-member-functions-to-static]
```suggestion
static Status FulltextIndexSearcherBuilder::build(const io::FileSystemSPtr&
fs,
```
##########
be/src/olap/rowset/segment_v2/inverted_index_reader.cpp:
##########
@@ -479,7 +484,7 @@ Status FullTextIndexReader::match_all_index_search(
return Status::OK();
}
-void FullTextIndexReader::check_null_bitmap(const IndexSearcherPtr&
index_searcher,
+void FullTextIndexReader::check_null_bitmap(const FulltextIndexSearcherPtr&
index_searcher,
Review Comment:
warning: method 'check_null_bitmap' can be made static
[readability-convert-member-functions-to-static]
be/src/olap/rowset/segment_v2/inverted_index_reader.h:145:
```diff
- void check_null_bitmap(const FulltextIndexSearcherPtr& index_searcher,
+ static void check_null_bitmap(const FulltextIndexSearcherPtr&
index_searcher,
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]