You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/06/01 04:42:24 UTC

[GitHub] [incubator-doris] yiguolei commented on a diff in pull request #9890: [feature] support convert alpha rowset

yiguolei commented on code in PR #9890:
URL: https://github.com/apache/incubator-doris/pull/9890#discussion_r886312771


##########
be/src/olap/convert_rowset.cpp:
##########
@@ -0,0 +1,127 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include "olap/convert_rowset.h"
+
+namespace doris {
+
+Status ConvertRowset::do_convert() {
+    if (!_tablet->init_succeeded()) {
+        return Status::OLAPInternalError(OLAP_ERR_INPUT_PARAMETER_ERROR);
+    }
+    std::unique_lock<std::mutex> base_compaction_lock(_tablet->get_base_compaction_lock(), std::try_to_lock);
+    std::unique_lock<std::mutex> cumulative_compaction_lock(_tablet->get_cumulative_compaction_lock(), std::try_to_lock);
+    if (!base_compaction_lock.owns_lock() || !cumulative_compaction_lock.owns_lock()) {
+        LOG(INFO) << "The tablet is under compaction. tablet=" << _tablet->full_name();
+        return Status::OLAPInternalError(OLAP_ERR_CE_TRY_CE_LOCK_ERROR);
+    }
+
+    std::vector<RowsetSharedPtr> alpah_rowsets;
+    _tablet->find_alpha_rowsets(&alpah_rowsets);
+
+    Merger::Statistics stats;
+    Status res;
+    for (size_t i = 0; i < alpah_rowsets.size(); ++i) {
+        Version output_version =

Review Comment:
   这里不能一直跑, 这里可以记录一下我们写过多少个rowset,或者merge过多少行记录,就得退出,否则正常的compaction没法跑了



-- 
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