From 71041eb0d65fbcb575807f5fa7695efeb5f4e19f Mon Sep 17 00:00:00 2001 From: Tomasz Grabiec Date: Thu, 23 Apr 2015 20:58:22 +0200 Subject: [PATCH] dht: Implement operator<< for decorated_key --- dht/i_partitioner.cc | 4 ++++ dht/i_partitioner.hh | 2 ++ 2 files changed, 6 insertions(+) diff --git a/dht/i_partitioner.cc b/dht/i_partitioner.cc index ee9f913b22..6a313ab145 100644 --- a/dht/i_partitioner.cc +++ b/dht/i_partitioner.cc @@ -158,6 +158,10 @@ std::ostream& operator<<(std::ostream& out, const token& t) { return out; } +std::ostream& operator<<(std::ostream& out, const decorated_key& dk) { + return out << "{key: " << dk._key << ", token:" << dk._token << "}"; +} + // FIXME: get from global config // FIXME: make it per-keyspace murmur3_partitioner default_partitioner; diff --git a/dht/i_partitioner.hh b/dht/i_partitioner.hh index d3f1a1753a..ea61ab06c7 100644 --- a/dht/i_partitioner.hh +++ b/dht/i_partitioner.hh @@ -170,6 +170,8 @@ bool operator!=(const decorated_key& lht, const decorated_key& rht); std::ostream& operator<<(std::ostream& out, const token& t); +std::ostream& operator<<(std::ostream& out, const decorated_key& t); + i_partitioner& global_partitioner(); } // dht