-
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.
Fix several issues related with disaggregate remote read (#7053)
ref #6827
- Loading branch information
1 parent
835ad98
commit a7642ef
Showing
18 changed files
with
264 additions
and
105 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
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,44 @@ | ||
// 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 <Storages/DeltaMerge/Remote/RNDataProvider.h> | ||
#include <Storages/DeltaMerge/Remote/RNLocalPageCache.h> | ||
|
||
namespace DB::DM::Remote | ||
{ | ||
|
||
Page ColumnFileDataProviderRNLocalPageCache::readTinyData( | ||
PageId page_id, | ||
const std::optional<std::vector<size_t>> & fields) const | ||
{ | ||
RUNTIME_CHECK_MSG( | ||
fields.has_value(), | ||
"ColumnFileDataProviderRNLocalPageCache currently does not support read all data from a page"); | ||
|
||
auto oid = Remote::PageOID{ | ||
.store_id = store_id, | ||
.table_id = table_id, | ||
.page_id = page_id, | ||
}; | ||
return page_cache->getPage(oid, *fields); | ||
} | ||
|
||
size_t ColumnFileDataProviderRNLocalPageCache::getTinyDataSize(PageId) const | ||
{ | ||
RUNTIME_CHECK_MSG( | ||
false, | ||
"ColumnFileDataProviderRNLocalPageCache currently does not support getTinyDataSize"); | ||
} | ||
|
||
} // namespace DB::DM::Remote |
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,52 @@ | ||
// 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 <Storages/DeltaMerge/ColumnFile/ColumnFileDataProvider.h> | ||
#include <Storages/DeltaMerge/Remote/RNDataProvider_fwd.h> | ||
#include <Storages/DeltaMerge/Remote/RNLocalPageCache_fwd.h> | ||
|
||
namespace DB::DM::Remote | ||
{ | ||
|
||
class ColumnFileDataProviderRNLocalPageCache : public IColumnFileDataProvider | ||
{ | ||
private: | ||
RNLocalPageCachePtr page_cache; | ||
RNLocalPageCacheGuardPtr pages_guard; // Only keep for maintaining lifetime for related keys | ||
|
||
UInt64 store_id; | ||
Int64 table_id; | ||
|
||
public: | ||
explicit ColumnFileDataProviderRNLocalPageCache( | ||
RNLocalPageCachePtr page_cache_, | ||
RNLocalPageCacheGuardPtr pages_guard_, | ||
UInt64 store_id_, | ||
Int64 table_id_) | ||
: page_cache(page_cache_) | ||
, pages_guard(pages_guard_) | ||
, store_id(store_id_) | ||
, table_id(table_id_) | ||
{} | ||
|
||
Page readTinyData( | ||
PageId page_id, | ||
const std::optional<std::vector<size_t>> & fields) const override; | ||
|
||
size_t getTinyDataSize(PageId page_id) const override; | ||
}; | ||
|
||
} // namespace DB::DM::Remote |
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,22 @@ | ||
// 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 | ||
|
||
namespace DB::DM::Remote | ||
{ | ||
|
||
class ColumnFileDataProviderLocalPageCache; | ||
|
||
} |
Oops, something went wrong.