-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[test](scanner) Scanner scheduler unit test (#47783)
### What problem does this PR solve? Unit test for scanner schedule. Adaptive scan schedule is introduced by #44690 * ScannerContext::init * ScannerContext::_push_back_scan_task * ScannerContext::_get_margin * ScannerContext::_pull_next_scan_task * ScannerContext::_schedule_scan_task * Additional test for scan operator, make sure `adaptive_pipeline_task_serial_read_on_limit` is working correctlly. * ScannerContext::get_free_block * ScannerContext::return_free_block * ScannerContext::get_block_from_queue
- Loading branch information
1 parent
dd0c2d8
commit 5cec569
Showing
9 changed files
with
1,104 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// 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 <gmock/gmock.h> | ||
|
||
#include "common/status.h" | ||
#include "vec/exec/scan/scanner_scheduler.h" | ||
|
||
namespace doris::vectorized { | ||
class MockScannerScheduler : ScannerScheduler { | ||
public: | ||
MockScannerScheduler() = default; | ||
|
||
MOCK_METHOD2(submit, Status(std::shared_ptr<ScannerContext>, std::shared_ptr<ScanTask>)); | ||
}; | ||
} // namespace doris::vectorized |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// 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 <gmock/gmock.h> | ||
|
||
#include "vec/exec/scan/scanner_scheduler.h" | ||
|
||
namespace doris::vectorized { | ||
class MockSimplifiedScanScheduler : SimplifiedScanScheduler { | ||
public: | ||
MockSimplifiedScanScheduler(std::shared_ptr<CgroupCpuCtl> cgroup_cpu_ctl) | ||
: SimplifiedScanScheduler("ForTest", cgroup_cpu_ctl) {} | ||
|
||
MOCK_METHOD0(get_active_threads, int()); | ||
MOCK_METHOD0(get_queue_size, int()); | ||
MOCK_METHOD3(schedule_scan_task, Status(std::shared_ptr<ScannerContext> scanner_ctx, | ||
std::shared_ptr<ScanTask> current_scan_task, | ||
std::unique_lock<std::mutex>& transfer_lock)); | ||
}; | ||
} // namespace doris::vectorized |
Oops, something went wrong.