forked from scylladb/scylladb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
flat_mutation_reader: Split readers by file and remove unnecessary in…
…cludes. The flat_mutation_reader files were conflated and contained multiple readers, which were not strictly necessary. Splitting optimizes both iterative compilation times, as touching rarely used readers doesn't recompile large chunks of codebase. Total compilation times are also improved, as the size of flat_mutation_reader.hh and flat_mutation_reader_v2.hh have been reduced and those files are included by many file in the codebase. With changes real 29m14.051s user 168m39.071s sys 5m13.443s Without changes real 30m36.203s user 175m43.354s sys 5m26.376s Closes scylladb#10194
- Loading branch information
Showing
83 changed files
with
2,178 additions
and
1,681 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
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,36 @@ | ||
/* | ||
* Modified by ScyllaDB | ||
* Copyright (C) 2022-present ScyllaDB | ||
*/ | ||
|
||
/* | ||
* SPDX-License-Identifier: (AGPL-3.0-or-later and Apache-2.0) | ||
*/ | ||
|
||
#pragma once | ||
#include <vector> | ||
#include "range.hh" | ||
|
||
namespace sstables { | ||
|
||
class key_view; | ||
class decorated_key_view; | ||
|
||
} | ||
|
||
namespace dht { | ||
|
||
class decorated_key; | ||
class ring_position; | ||
class token; | ||
|
||
using partition_range = nonwrapping_range<ring_position>; | ||
using token_range = nonwrapping_range<token>; | ||
|
||
using partition_range_vector = std::vector<partition_range>; | ||
using token_range_vector = std::vector<token_range>; | ||
|
||
class decorated_key; | ||
|
||
using decorated_key_opt = std::optional<decorated_key>; | ||
} |
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,20 @@ | ||
/* | ||
* Copyright (C) 2016-present ScyllaDB | ||
*/ | ||
|
||
/* | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
*/ | ||
|
||
#pragma once | ||
#include <seastar/util/bool_class.hh> | ||
#include <seastar/util/optimized_optional.hh> | ||
|
||
using namespace seastar; | ||
|
||
class mutation_fragment; | ||
class mutation_fragment_v2; | ||
|
||
using mutation_fragment_opt = optimized_optional<mutation_fragment>; | ||
using mutation_fragment_v2_opt = optimized_optional<mutation_fragment_v2>; | ||
|
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
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,18 @@ | ||
/* | ||
* Copyright (C) 2022-present ScyllaDB | ||
*/ | ||
|
||
/* | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
*/ | ||
|
||
#pragma once | ||
|
||
class flat_mutation_reader; | ||
class flat_mutation_reader_v2; | ||
|
||
// Adapts a v2 reader to v1 reader | ||
flat_mutation_reader downgrade_to_v1(flat_mutation_reader_v2); | ||
|
||
// Adapts a v1 reader to v2 reader | ||
flat_mutation_reader_v2 upgrade_to_v2(flat_mutation_reader); |
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,42 @@ | ||
/* | ||
* Copyright (C) 2022-present ScyllaDB | ||
*/ | ||
|
||
/* | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
*/ | ||
|
||
#pragma once | ||
#include "readers/flat_mutation_reader.hh" | ||
|
||
class flat_mutation_reader; | ||
|
||
flat_mutation_reader make_delegating_reader(flat_mutation_reader&); | ||
|
||
class delegating_reader : public flat_mutation_reader::impl { | ||
flat_mutation_reader_opt _underlying_holder; | ||
flat_mutation_reader* _underlying; | ||
public: | ||
// when passed a lvalue reference to the reader | ||
// we don't own it and the caller is responsible | ||
// for evenetually closing the reader. | ||
delegating_reader(flat_mutation_reader& r) | ||
: impl(r.schema(), r.permit()) | ||
, _underlying_holder() | ||
, _underlying(&r) | ||
{ } | ||
// when passed a rvalue reference to the reader | ||
// we assume ownership of it and will close it | ||
// in close(). | ||
delegating_reader(flat_mutation_reader&& r) | ||
: impl(r.schema(), r.permit()) | ||
, _underlying_holder(std::move(r)) | ||
, _underlying(&*_underlying_holder) | ||
{ } | ||
|
||
virtual future<> fill_buffer() override; | ||
virtual future<> fast_forward_to(position_range pr) override; | ||
virtual future<> next_partition() override; | ||
virtual future<> fast_forward_to(const dht::partition_range& pr) override; | ||
virtual future<> close() noexcept override; | ||
}; |
Oops, something went wrong.