All of lore.kernel.org
 help / color / mirror / Atom feed
* Patch for rados tool to allow listomapvals to list all k/v pairs
@ 2013-12-28 13:59 Bjørnar Ness
  2013-12-31  1:25 ` Josh Durgin
  0 siblings, 1 reply; 2+ messages in thread
From: Bjørnar Ness @ 2013-12-28 13:59 UTC (permalink / raw)
  To: ceph-devel

[-- Attachment #1: Type: text/plain, Size: 76 bytes --]

Current code only lists first 512 k/v pairs, attached patch.

-- 
Bj(/)rnar

[-- Attachment #2: rados_listomapvals_everything.patch --]
[-- Type: text/x-diff, Size: 820 bytes --]

diff --git a/src/tools/rados/rados.cc b/src/tools/rados/rados.cc
index a5a921c..bbd7ba2 100644
--- a/src/tools/rados/rados.cc
+++ b/src/tools/rados/rados.cc
@@ -1760,6 +1760,7 @@ static int rados_tool_common(const std::map < std::string, std
             << cpp_strerror(ret) << std::endl;
        return 1;
       }
+      ret = values.size();
       for (map<string, bufferlist>::const_iterator it = values.begin();
           it != values.end(); ++it) {
        // dump key in hex if it contains nonprintable characters
@@ -1771,6 +1772,7 @@ static int rados_tool_common(const std::map < std::string, std
          keybl.hexdump(cout);
        } else {
          cout << it->first;
+      last_read = it->first;
        }
        cout << std::endl;
        cout << "value: (" << it->second.length() << " bytes) :\n";

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: Patch for rados tool to allow listomapvals to list all k/v pairs
  2013-12-28 13:59 Patch for rados tool to allow listomapvals to list all k/v pairs Bjørnar Ness
@ 2013-12-31  1:25 ` Josh Durgin
  0 siblings, 0 replies; 2+ messages in thread
From: Josh Durgin @ 2013-12-31  1:25 UTC (permalink / raw)
  To: Bjørnar Ness, ceph-devel

On 12/28/2013 05:59 AM, Bjørnar Ness wrote:
> Current code only lists first 512 k/v pairs, attached patch.

Thanks for looking into this!
I moved the last_read assignment out of the conditional so it applies
to nonprintable values too, and added a simple test case:

https://github.com/ceph/ceph/pull/1022

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-12-31  1:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-28 13:59 Patch for rados tool to allow listomapvals to list all k/v pairs Bjørnar Ness
2013-12-31  1:25 ` Josh Durgin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.