You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "xiaokang (via GitHub)" <gi...@apache.org> on 2023/06/19 06:29:45 UTC

[GitHub] [doris] xiaokang commented on a diff in pull request #20970: [Fix](inverted index) remove IndexReader::indexExists, use fs interface

xiaokang commented on code in PR #20970:
URL: https://github.com/apache/doris/pull/20970#discussion_r1233581289


##########
be/src/olap/rowset/segment_v2/inverted_index_writer.cpp:
##########
@@ -133,12 +133,18 @@ class InvertedIndexColumnWriterImpl : public InvertedIndexColumnWriter {
                 _directory + "/" + _segment_file_name, _index_meta->index_id());
 
         // LOG(INFO) << "inverted index path: " << index_path;
-
-        if (lucene::index::IndexReader::indexExists(index_path.c_str())) {
-            create = false;
-            if (lucene::index::IndexReader::isLocked(index_path.c_str())) {
-                LOG(WARNING) << ("Lucene Index was locked... unlocking it.\n");
-                lucene::index::IndexReader::unlock(index_path.c_str());
+        bool exists = false;
+        auto st = _fs->exists(index_path.c_str(), &exists);
+        if (!st.ok()) {
+            LOG(ERROR) << "index_path:"
+                       << " exists error:" << st;
+            return st;
+        }
+        if (exists) {
+            st = _fs->delete_directory(index_path.c_str());

Review Comment:
   can just return error Status



-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org