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


##########
be/src/olap/rowset/segment_v2/inverted_index_compound_directory.h:
##########
@@ -69,26 +68,23 @@ class CLUCENE_EXPORT DorisCompoundDirectory : public 
lucene::store::Directory {
 private:
     int filemode;
 
-    std::mutex _this_lock;
-
 protected:
     DorisCompoundDirectory();
-    virtual void init(const io::FileSystemSPtr& fs, const char* path,
+    virtual void init(const io::FileSystemSPtr& fs, const char* path, DirType 
dir_type,
                       lucene::store::LockFactory* lock_factory = nullptr,
                       const io::FileSystemSPtr& compound_fs = nullptr,
                       const char* cfs_path = nullptr);
     void priv_getFN(char* buffer, const char* name) const;
 
-private:

Review Comment:
   delete private?



##########
be/src/olap/rowset/segment_v2/inverted_index_compound_directory.cpp:
##########
@@ -534,17 +532,12 @@ void DorisCompoundDirectory::init(const 
io::FileSystemSPtr& _fs, const char* _pa
     } else {
         cfs_directory = _path;
     }
-    bool doClearLockID = false;
 
     if (lock_factory == nullptr) {
         lock_factory = _CLNEW lucene::store::NoLockFactory();
     }
 
-    setLockFactory(lock_factory);
-
-    if (doClearLockID) {

Review Comment:
   why delete?



##########
be/src/olap/rowset/segment_v2/inverted_index_compound_directory.h:
##########
@@ -180,5 +232,20 @@ class DorisCompoundDirectory::FSIndexInput : public 
lucene::store::BufferedIndex
     void readInternal(uint8_t* b, const int32_t len) override;
 };
 
-} // namespace segment_v2
-} // namespace doris
+/**
+ * Factory function to create DorisCompoundDirectory
+ */
+class DorisCompoundDirectoryFactory {
+public:
+    static DorisCompoundDirectory* getDirectory(const io::FileSystemSPtr& fs, 
const char* file,
+                                                bool use_compound_file_writer,
+                                                const io::FileSystemSPtr& 
cfs_fs = nullptr,
+                                                const char* cfs_file = 
nullptr);
+
+    static DorisCompoundDirectory* getDirectory(const io::FileSystemSPtr& fs, 
const char* file,
+                                                DirType io_type = 
DirType::READ,

Review Comment:
   change to a flag



-- 
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-unsubscr...@doris.apache.org

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


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

Reply via email to