You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@doris.apache.org by GitBox <gi...@apache.org> on 2019/08/05 09:06:48 UTC

[GitHub] [incubator-doris] chaoyli commented on a change in pull request #1576: Change cumulative compaction for decoupling storage from compution

chaoyli commented on a change in pull request #1576: Change cumulative compaction for decoupling storage from compution
URL: https://github.com/apache/incubator-doris/pull/1576#discussion_r310505634
 
 

 ##########
 File path: be/src/olap/base_compaction.cpp
 ##########
 @@ -40,487 +39,264 @@ using std::vector;
 
 namespace doris {
 
-OLAPStatus BaseCompaction::init(TabletSharedPtr tablet, bool is_manual_trigger) {
-    // 表在首次查询或PUSH等操作时,会被加载到内存
-    // 如果表没有被加载,表明该表上目前没有任何操作,所以不进行BE操作
-    if (!tablet->init_succeeded()) {
-        return OLAP_ERR_INPUT_PARAMETER_ERROR;
-    }
-
-    LOG(INFO) << "init base compaction handler. [tablet=" << tablet->full_name() << "]";
+static bool rowset_comparator(const RowsetSharedPtr& left, const RowsetSharedPtr& right) {
+    return left->end_version() < right->end_version();
+}
 
-    _tablet = tablet;
+BaseCompaction::BaseCompaction(TabletSharedPtr tablet)
+    : _tablet(tablet),
+      _base_locked(false),
+      _input_rowsets_size(0),
+      _input_row_num(0)
+    { }
 
-    // 1. 尝试取得base compaction的锁
-    if (!_try_base_compaction_lock()) {
-        LOG(WARNING) << "another base compaction is running. tablet=" << tablet->full_name();
-        return OLAP_ERR_BE_TRY_BE_LOCK_ERROR;
+BaseCompaction::~BaseCompaction() {
+    if (_base_locked) {
+        _tablet->release_base_compaction_lock();
 
 Review comment:
   OK, I will change it to another form

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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