-
Notifications
You must be signed in to change notification settings - Fork 409
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into pagestorage_test
- Loading branch information
Showing
75 changed files
with
2,578 additions
and
988 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
Submodule tiflash-proxy
updated
14 files
+39 −32 | Cargo.lock | |
+1 −4 | Cargo.toml | |
+27 −0 | Makefile | |
+20 −7 | build.sh | |
+6 −1 | cargo-build.sh | |
+3 −2 | components/raftstore/src/store/config.rs | |
+1 −1 | components/raftstore/src/store/fsm/apply.rs | |
+1 −2 | components/raftstore/src/store/mod.rs | |
+20 −20 | components/raftstore/src/store/worker/pd.rs | |
+10 −0 | debug.sh | |
+107 −1 | metrics/grafana/tikv_details.json | |
+11 −0 | release.sh | |
+13 −2 | src/server/service/kv.rs | |
+2 −20 | src/server/status_server/profile.rs |
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,57 @@ | ||
// Copyright 2022 PingCAP, Ltd. | ||
// | ||
// Licensed 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 <DataStreams/MockExchangeReceiverInputStream.h> | ||
#include <Flash/Coprocessor/ChunkCodec.h> | ||
|
||
namespace DB | ||
{ | ||
MockExchangeReceiverInputStream::MockExchangeReceiverInputStream(const tipb::ExchangeReceiver & receiver, size_t max_block_size, size_t rows_) | ||
: output_index(0) | ||
, max_block_size(max_block_size) | ||
, rows(rows_) | ||
{ | ||
for (int i = 0; i < receiver.field_types_size(); ++i) | ||
{ | ||
columns.emplace_back( | ||
getDataTypeByColumnInfoForComputingLayer(TiDB::fieldTypeToColumnInfo(receiver.field_types(i))), | ||
fmt::format("exchange_receiver_{}", i)); | ||
} | ||
} | ||
|
||
ColumnPtr MockExchangeReceiverInputStream::makeColumn(ColumnWithTypeAndName elem) const | ||
{ | ||
auto column = elem.type->createColumn(); | ||
size_t row_count = 0; | ||
for (size_t i = output_index; (i < rows) & (row_count < max_block_size); ++i) | ||
{ | ||
column->insert((*elem.column)[i]); | ||
++row_count; | ||
} | ||
return column; | ||
} | ||
|
||
Block MockExchangeReceiverInputStream::readImpl() | ||
{ | ||
if (output_index >= rows) | ||
return {}; | ||
ColumnsWithTypeAndName output_columns; | ||
for (const auto & elem : columns) | ||
{ | ||
output_columns.push_back({makeColumn(elem), elem.type, elem.name, elem.column_id}); | ||
} | ||
output_index += max_block_size; | ||
return Block(output_columns); | ||
} | ||
} // namespace DB |
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,41 @@ | ||
// Copyright 2022 PingCAP, Ltd. | ||
// | ||
// Licensed 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 <DataStreams/IProfilingBlockInputStream.h> | ||
#include <Storages/Transaction/TypeMapping.h> | ||
#include <tipb/executor.pb.h> | ||
|
||
namespace DB | ||
{ | ||
/// Mock the receiver like table scan, can mock blocks according to the receiver's schema. | ||
/// TODO: Mock the receiver process | ||
class MockExchangeReceiverInputStream : public IProfilingBlockInputStream | ||
{ | ||
public: | ||
MockExchangeReceiverInputStream(const tipb::ExchangeReceiver & receiver, size_t max_block_size, size_t rows_); | ||
Block getHeader() const override { return Block(columns); } | ||
String getName() const override { return "MockExchangeReceiver"; } | ||
ColumnsWithTypeAndName columns; | ||
size_t output_index; | ||
size_t max_block_size; | ||
size_t rows; | ||
|
||
protected: | ||
Block readImpl() override; | ||
ColumnPtr makeColumn(ColumnWithTypeAndName elem) const; | ||
}; | ||
|
||
} // namespace DB |
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,46 @@ | ||
// Copyright 2022 PingCAP, Ltd. | ||
// | ||
// Licensed 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 <DataStreams/MockExchangeSenderInputStream.h> | ||
namespace DB | ||
{ | ||
MockExchangeSenderInputStream::MockExchangeSenderInputStream( | ||
const BlockInputStreamPtr & input, | ||
const String & req_id) | ||
: log(Logger::get(NAME, req_id)) | ||
{ | ||
children.push_back(input); | ||
} | ||
|
||
Block MockExchangeSenderInputStream::getTotals() | ||
{ | ||
if (IProfilingBlockInputStream * child = dynamic_cast<IProfilingBlockInputStream *>(&*children.back())) | ||
{ | ||
totals = child->getTotals(); | ||
} | ||
|
||
return totals; | ||
} | ||
|
||
Block MockExchangeSenderInputStream::getHeader() const | ||
{ | ||
return children.back()->getHeader(); | ||
} | ||
|
||
Block MockExchangeSenderInputStream::readImpl() | ||
{ | ||
return children.back()->read(); | ||
} | ||
|
||
} // namespace DB |
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,46 @@ | ||
// Copyright 2022 PingCAP, Ltd. | ||
// | ||
// Licensed 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 <DataStreams/IProfilingBlockInputStream.h> | ||
#include <Storages/Transaction/TypeMapping.h> | ||
#include <tipb/executor.pb.h> | ||
|
||
namespace DB | ||
{ | ||
/// Currently, this operator do nothing with the block. | ||
/// TODO: Mock the sender process | ||
class MockExchangeSenderInputStream : public IProfilingBlockInputStream | ||
{ | ||
private: | ||
static constexpr auto NAME = "MockExchangeSender"; | ||
|
||
public: | ||
MockExchangeSenderInputStream( | ||
const BlockInputStreamPtr & input, | ||
const String & req_id); | ||
|
||
String getName() const override { return NAME; } | ||
Block getTotals() override; | ||
Block getHeader() const override; | ||
|
||
protected: | ||
Block readImpl() override; | ||
|
||
private: | ||
const LoggerPtr log; | ||
}; | ||
|
||
} // namespace DB |
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
Oops, something went wrong.