sstables: switch to const ref wherever possible

Signed-off-by: Raphael S. Carvalho <raphaelsc@scylladb.com>
This commit is contained in:
Raphael S. Carvalho
2017-11-30 05:57:47 -02:00
parent d916c8cdad
commit d2ab154f12
3 changed files with 6 additions and 6 deletions

View File

@@ -112,7 +112,7 @@ static void delete_sstables_for_interrupted_compaction(std::vector<shared_sstabl
}
}
static std::vector<shared_sstable> get_uncompacting_sstables(column_family& cf, std::vector<shared_sstable>& sstables) {
static std::vector<shared_sstable> get_uncompacting_sstables(column_family& cf, std::vector<shared_sstable> sstables) {
auto all_sstables = boost::copy_range<std::vector<shared_sstable>>(*cf.get_sstables_including_compacted_undeleted());
boost::sort(all_sstables, [] (const shared_sstable& x, const shared_sstable& y) {
return x->generation() < y->generation();
@@ -541,7 +541,7 @@ reshard_sstables(std::vector<shared_sstable> sstables, column_family& cf, std::f
}
std::unordered_set<sstables::shared_sstable>
get_fully_expired_sstables(column_family& cf, std::vector<sstables::shared_sstable>& compacting, gc_clock::time_point gc_before) {
get_fully_expired_sstables(column_family& cf, const std::vector<sstables::shared_sstable>& compacting, gc_clock::time_point gc_before) {
clogger.debug("Checking droppable sstables in {}.{}", cf.schema()->ks_name(), cf.schema()->cf_name());
if (compacting.empty()) {

View File

@@ -132,5 +132,5 @@ namespace sstables {
// In simpler words, a sstable is fully expired if all of its live cells with TTL is expired
// and possibly doesn't contain any tombstone that covers cells in other sstables.
std::unordered_set<sstables::shared_sstable>
get_fully_expired_sstables(column_family& cf, std::vector<sstables::shared_sstable>& compacting, gc_clock::time_point gc_before);
get_fully_expired_sstables(column_family& cf, const std::vector<sstables::shared_sstable>& compacting, gc_clock::time_point gc_before);
}

View File

@@ -333,7 +333,7 @@ public:
}
template <typename T>
static std::vector<sstables::shared_sstable> overlapping(const schema& s, std::vector<sstables::shared_sstable>& candidates, T& others) {
static std::vector<sstables::shared_sstable> overlapping(const schema& s, const std::vector<sstables::shared_sstable>& candidates, const T& others) {
assert(!candidates.empty());
/*
* Picking each sstable from others that overlap one of the sstable of candidates is not enough
@@ -364,7 +364,7 @@ public:
}
template <typename T>
static std::vector<sstables::shared_sstable> overlapping(const schema& s, sstables::shared_sstable& sstable, T& others) {
static std::vector<sstables::shared_sstable> overlapping(const schema& s, const sstables::shared_sstable& sstable, const T& others) {
return overlapping(s, sstable->get_first_decorated_key()._token, sstable->get_last_decorated_key()._token, others);
}
@@ -372,7 +372,7 @@ public:
* @return sstables from @param sstables that contain keys between @param start and @param end, inclusive.
*/
template <typename T>
static std::vector<sstables::shared_sstable> overlapping(const schema& s, dht::token start, dht::token end, T& sstables) {
static std::vector<sstables::shared_sstable> overlapping(const schema& s, dht::token start, dht::token end, const T& sstables) {
assert(start <= end);
std::vector<sstables::shared_sstable> overlapped;