kaka11chen commented on code in PR #49671:
URL: https://github.com/apache/doris/pull/49671#discussion_r2048802218


##########
be/src/vec/exec/executor/time_sharing/split_concurrency_controller.h:
##########
@@ -0,0 +1,88 @@
+// 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.
+#pragma once
+
+#include <chrono>
+#include <cmath>
+#include <cstdint>
+#include <stdexcept>
+
+#include "common/factory_creator.h"
+#include "common/status.h"
+
+namespace doris::vectorized {
+
+class SplitConcurrencyController {
+    ENABLE_FACTORY_CREATOR(SplitConcurrencyController);
+
+public:
+    SplitConcurrencyController(int initial_concurrency,
+                               std::chrono::nanoseconds adjustment_interval)
+            : _adjustment_interval_nanos(adjustment_interval),
+              _target_concurrency(initial_concurrency) {}
+
+    void update(uint64_t nanos, double utilization, int current_concurrency) {
+        _validate_args(nanos, utilization, current_concurrency);
+        _thread_nanos_since_adjust += nanos;
+        if (_should_increase_concurrency(current_concurrency, utilization)) {
+            _reset_adjust_counter();
+            ++_target_concurrency;
+        }
+    }
+
+    int target_concurrency() const { return _target_concurrency; }
+
+    void split_finished(uint64_t split_nanos, double utilization, int 
current_concurrency) {

Review Comment:
   Yes, there is no dynamic queue control currently. In theory, it can be 
controlled by looking at the queue utilization of the sender of the exchange 
where the sharding task is completed, but there are some problems with this 
implementation at present, so it will be implemented in the future.



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