ceph-dencoder – ceph encoder/decoder utility
Description
ceph-dencoder is a utility to encode, decode, and dump ceph datastructures. It is used for debugging and for testing inter-versioncompatibility.
- Print the version string for the ceph-dencoder binary.
import
<file>
- Read a binary blob of encoded data from the given file. It will beplaced in an in-memory buffer.
export
<file>
- Write the contents of the current in-memory buffer to the givenfile.
- List the data types known to this build of ceph-dencoder.
skip
<bytes>
- Seek
into the imported file before reading data structure, usethis with objects that have a preamble/header before the object of interest.
decode
- Decode the contents of the in-memory buffer into an instance of thepreviously selected type. If there is an error, report it.
encode
- Encode the contents of the in-memory instance of the previouslyselected type to the in-memory buffer.
get_features
- Print the decimal value of the feature set supported by this versionof ceph-dencoder. Each bit represents a feature. These correspond toCEPHFEATURE* defines in src/include/ceph_features.h.
set_features
<f>
- Set the feature bits provided to
encode
to f. This allowsyou to encode objects such that they can be understood by oldversions of the software (for those types that support it).
Example
Alternatively, perhaps you wish to dump an internal CephFS metadata object, you mightdo that like this:
- $ rados -p metadata get mds_snaptable mds_snaptable.bin
- $ ceph-dencoder type SnapServer skip 8 import mds_snaptable.bin decode dump_json
- { "snapserver": { "last_snap": 1,
- "pending_noop": [],
- "snaps": [],
- "need_to_purge": {},
- "pending_destroy": []}}
See also
(8)