Integers as String in osd_metadata (memory, rotational)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Looking at 'ceph osd metadata' I see that we return a lot of values as Strings in the JSON instead of a Integer, for example:

$ ceph osd metadata 2033

{
    "id": 2033,
    "arch": "x86_64",
    "journal_rotational": "0",
    "mem_swap_kb": "1046524",
    "mem_total_kb": "63641808",
    "rotational": "1"
}

Looking at some code I found this:

(*m)["mem_total_kb"] = std::to_string(size);
(*pm)["rotational"] = store_is_rotational ? "1" : "0";
(*pm)["journal_rotational"] = journal_is_rotational ? "1" : "0";

Why can't we return a int/long there? Is it the internal JSON parser which can't handle it?

Otherwise I'll write a PR for this. Saves me casting the things to Integers again afterwards in Python.

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



[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux