imay commented on a change in pull request #2691: add rowset state
URL: https://github.com/apache/incubator-doris/pull/2691#discussion_r364264929
 
 

 ##########
 File path: be/src/olap/rowset/rowset.h
 ##########
 @@ -127,6 +214,30 @@ class Rowset : public 
std::enable_shared_from_this<Rowset> {
         return left->end_version() < right->end_version();
     }
 
+    // this function is called by reader to increase reference of rowset
+    void aquire() {
+        ++_refs_by_reader;
+    }
+
+    void release() {
+        // if the refs by reader is 0 and the rowset is closed, should release 
the resouce
+        uint64_t current_refs = --_refs_by_reader;
+        if (current_refs == 0 && _rowset_state_machine.rowset_state() == 
ROWSET_UNLOADING) {
+            auto st = _rowset_state_machine.on_close(current_refs);
+            if (st != OLAP_SUCCESS) {
 
 Review comment:
   seems no usage, just leave a DCHECK(state == UNLOADED)

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to