Re: json, binary data, and ceph config-key

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

 



On Tue, Apr 10, 2018 at 4:59 AM, Patrick Donnelly <pdonnell@xxxxxxxxxx> wrote:
> On Mon, Apr 9, 2018 at 8:39 PM, Sage Weil <sweil@xxxxxxxxxx> wrote:
>> Should we
>>
>> 1- Print something else there even though it is not strictly correct?
>> That would mean that something can't parse the (JSON) dump output and
>> get the right answer.
>>
>> 2- Disallow binary data.  This seems weak, but at least behavior would be
>> consistent.  We'll probably break some random out-of-tree users out there.
>>
>> 3- Use XML as the output format for this command?
>>
>> 4- Remove the 'dump' command entirely and make you get each item.  There
>> is still 'ceph config-key list' to get the keys you would need to
>> individually get.
>>
>> All of these options kind of suck.  Is there a better option I'm missing?
>
> 5) (I don't know about "better" but:) Encode all strings with e.g.
> base64? Then at least the user of the json output must deal with
> decoding the strings in a consistent way. Obviously that has the
> unfortunate side-effect of making the json output completely human
> unreadable.

Yeah, at the point the output isn't human readable any more I think
we've kind of lost the usefulness of it as a CLI operation.

> Or, (6) output values as
>
>     "config-history/1/": {
>       "type": "string",
>       "value": "bar"
>     },
>     "config-history/1/": {
>       "type": "blob",
>       "value": "base64://ABCD=="
>     }
>     "config-history/2/": {
>       "type": "integer",
>       "value": 1
>     }
>
> (Perhaps a last minute change to add blobs or maybe just dynamically
> recognize them.)

This makes me wonder whether we really want a value type[1] (int,
printable string, binary string), or a MIME type (text/plain,
application/json, application/octet stream).  Either one would let the
CLI identify which fields were printable, so it would be a question of
what was more useful to other KV store consumers.

John

1. There is probably a proper computer science name for this but I
wasted my time studying physics :-)

>
>> I'm feeling pretty let down by the collective industry decision to use
>> JSON for all the things.
>
> Indeed.
>
> --
> Patrick Donnelly
> --
> 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
--
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