1CEPH-DENCODER(8) Ceph CEPH-DENCODER(8)
2
3
4
6 ceph-dencoder - ceph encoder/decoder utility
7
9 ceph-dencoder [commands...]
10
11
13 ceph-dencoder is a utility to encode, decode, and dump ceph data struc‐
14 tures. It is used for debugging and for testing inter-version compati‐
15 bility.
16
17 ceph-dencoder takes a simple list of commands and performs them in
18 order.
19
21 version
22 Print the version string for the ceph-dencoder binary.
23
24 import <file>
25 Read a binary blob of encoded data from the given file. It will
26 be placed in an in-memory buffer.
27
28 export <file>
29 Write the contents of the current in-memory buffer to the given
30 file.
31
32 list_types
33 List the data types known to this build of ceph-dencoder.
34
35 type <name>
36 Select the given type for future encode or decode operations.
37
38 skip <bytes>
39 Seek <bytes> into the imported file before reading data struc‐
40 ture, use this with objects that have a preamble/header before
41 the object of interest.
42
43 decode Decode the contents of the in-memory buffer into an instance of
44 the previously selected type. If there is an error, report it.
45
46 encode Encode the contents of the in-memory instance of the previously
47 selected type to the in-memory buffer.
48
49 dump_json
50 Print a JSON-formatted description of the in-memory object.
51
52 count_tests
53 Print the number of built-in test instances of the previously
54 selected type that ceph-dencoder is able to generate.
55
56 select_test <n>
57 Select the given build-in test instance as a the in-memory
58 instance of the type.
59
60 get_features
61 Print the decimal value of the feature set supported by this
62 version of ceph-dencoder. Each bit represents a feature. These
63 correspond to CEPH_FEATURE_* defines in src/include/ceph_fea‐
64 tures.h.
65
66 set_features <f>
67 Set the feature bits provided to encode to f. This allows you
68 to encode objects such that they can be understood by old ver‐
69 sions of the software (for those types that support it).
70
72 Say you want to examine an attribute on an object stored by ceph-osd.
73 You can do this:
74
75 $ cd /mnt/osd.12/current/2.b_head
76 $ attr -l foo_bar_head_EFE6384B
77 Attribute "ceph.snapset" has a 31 byte value for foo_bar_head_EFE6384B
78 Attribute "ceph._" has a 195 byte value for foo_bar_head_EFE6384B
79 $ attr foo_bar_head_EFE6384B -g ceph._ -q > /tmp/a
80 $ ceph-dencoder type object_info_t import /tmp/a decode dump_json
81 { "oid": { "oid": "foo",
82 "key": "bar",
83 "snapid": -2,
84 "hash": 4024842315,
85 "max": 0},
86 "locator": { "pool": 2,
87 "preferred": -1,
88 "key": "bar"},
89 "category": "",
90 "version": "9'1",
91 "prior_version": "0'0",
92 "last_reqid": "client.4116.0:1",
93 "size": 1681,
94 "mtime": "2012-02-21 08:58:23.666639",
95 "lost": 0,
96 "wrlock_by": "unknown.0.0:0",
97 "snaps": [],
98 "truncate_seq": 0,
99 "truncate_size": 0,
100 "watchers": {}}
101
102 Alternatively, perhaps you wish to dump an internal CephFS metadata
103 object, you might do that like this:
104
105 $ rados -p metadata get mds_snaptable mds_snaptable.bin
106 $ ceph-dencoder type SnapServer skip 8 import mds_snaptable.bin decode dump_json
107 { "snapserver": { "last_snap": 1,
108 "pending_noop": [],
109 "snaps": [],
110 "need_to_purge": {},
111 "pending_create": [],
112 "pending_destroy": []}}
113
115 ceph-dencoder is part of Ceph, a massively scalable, open-source, dis‐
116 tributed storage system. Please refer to the Ceph documentation at
117 http://ceph.com/docs for more information.
118
120 ceph(8)
121
123 2010-2014, Inktank Storage, Inc. and contributors. Licensed under Cre‐
124 ative Commons Attribution Share Alike 3.0 (CC-BY-SA-3.0)
125
126
127
128
129dev Apr 29, 2019 CEPH-DENCODER(8)