range.hh was deprecated in bd794629f9 (2020) since its names
conflict with the C++ library concept of an iterator range. The name
::range also mapped to the dangerous wrapping_interval rather than
nonwrapping_interval.
Complete the deprecation by removing range.hh and replacing all the
aliases by the names they point to from the interval library. Note
this now exposes uses of wrapping intervals as they are now explicit.
The unit tests are renamed and range.hh is deleted.
Closes scylladb/scylladb#17428
43 lines
1.3 KiB
C++
43 lines
1.3 KiB
C++
/*
|
|
*
|
|
* Modified by ScyllaDB
|
|
* Copyright (C) 2015-present ScyllaDB
|
|
*/
|
|
|
|
/*
|
|
* SPDX-License-Identifier: (AGPL-3.0-or-later and Apache-2.0)
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <seastar/core/sstring.hh>
|
|
#include "interval.hh"
|
|
#include "partition_range_compat.hh"
|
|
#include <vector>
|
|
|
|
namespace streaming {
|
|
|
|
class stream_request {
|
|
public:
|
|
using token = dht::token;
|
|
sstring keyspace;
|
|
dht::token_range_vector ranges;
|
|
// For compatibility with <= 1.5, we send wrapping ranges (though they will never wrap).
|
|
std::vector<wrapping_interval<token>> ranges_compat() const {
|
|
return ::compat::wrap(ranges);
|
|
}
|
|
std::vector<sstring> column_families;
|
|
stream_request() = default;
|
|
stream_request(sstring _keyspace, dht::token_range_vector _ranges, std::vector<sstring> _column_families)
|
|
: keyspace(std::move(_keyspace))
|
|
, ranges(std::move(_ranges))
|
|
, column_families(std::move(_column_families)) {
|
|
}
|
|
stream_request(sstring _keyspace, std::vector<wrapping_interval<token>> _ranges, std::vector<sstring> _column_families)
|
|
: stream_request(std::move(_keyspace), ::compat::unwrap(std::move(_ranges)), std::move(_column_families)) {
|
|
}
|
|
friend std::ostream& operator<<(std::ostream& os, const stream_request& r);
|
|
};
|
|
|
|
} // namespace streaming
|