From 8c2c4602ee7b2a6a62d22a2a625009b1aea8e5e5 Mon Sep 17 00:00:00 2001 From: sdong Date: Tue, 13 May 2014 14:42:31 -0700 Subject: [PATCH] FixedPrefixTransform to include prefix length in its name Summary: As title Test Plan: make all check. Reviewers: haobo, igor, yhchiang Reviewed By: igor CC: leveldb Differential Revision: https://reviews.facebook.net/D18705 --- util/slice.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/util/slice.cc b/util/slice.cc index 55f561f0c..5a1f4f10e 100644 --- a/util/slice.cc +++ b/util/slice.cc @@ -17,13 +17,14 @@ namespace { class FixedPrefixTransform : public SliceTransform { private: size_t prefix_len_; + std::string name_; public: - explicit FixedPrefixTransform(size_t prefix_len) : prefix_len_(prefix_len) { } + explicit FixedPrefixTransform(size_t prefix_len) + : prefix_len_(prefix_len), + name_("rocksdb.FixedPrefix." + std::to_string(prefix_len_)) {} - virtual const char* Name() const { - return "rocksdb.FixedPrefix"; - } + virtual const char* Name() const { return name_.c_str(); } virtual Slice Transform(const Slice& src) const { assert(InDomain(src));