Files
scylladb/query.cc
Tomasz Grabiec 3779506990 db: query: Make partition_range hold ring_position
Current model was not really correct because Origin doesn't support
querying of partition ranges by their value. We can query slices
according to dht::decorated_key ordering, which orders partitions
first by token then by key value.

ring_position encapsulates range constraint. Key value is optional, in
which case only token is constrained.
2015-06-18 15:47:40 +02:00

36 lines
963 B
C++

/*
* Copyright (C) 2015 Cloudius Systems, Ltd.
*/
#include "query-request.hh"
#include "to_string.hh"
#include "bytes.hh"
namespace query {
std::ostream& operator<<(std::ostream& out, const partition_slice& ps) {
return out << "{"
<< "regular_cols=[" << join(", ", ps.regular_columns) << "]"
<< ", static_cols=[" << join(", ", ps.static_columns) << "]"
<< ", rows=[" << join(", ", ps.row_ranges) << "]"
<< ", options=" << sprint("%x", ps.options.mask()) // FIXME: pretty print options
<< "}";
}
std::ostream& operator<<(std::ostream& out, const read_command& r) {
return out << "read_command{"
<< "cf_id=" << r.cf_id
<< ", slice=" << r.slice << ""
<< ", limit=" << r.row_limit << "}";
}
std::ostream& operator<<(std::ostream& out, const ring_position& pos) {
out << "{" << pos.token();
if (pos.has_key()) {
out << ", " << *pos.key();
}
return out << "}";
}
}