common/shared_cache.hpp: add clear()

Clear clears a key/value from the cache.

Signed-off-by: Samuel Just <sam.just@inktank.com>
doc/dev/osd_internals: add some info about throttles

Signed-off-by: Samuel Just <sam.just@inktank.com>
common/shared_cache.hpp: fix set_size()

Signed-off-by: Samuel Just <sam.just@inktank.com>
FileStore: add fd cache

Signed-off-by: Samuel Just <sam.just@inktank.com>
Revert "mon: fix validatation of mds ids in mon commands"

This reverts commit 5c305d63043762027323052b4bb3ae3063665c6f.

This will avoid a conflict with the mon command refactor merge.
mon: set tid on MMonCommandAck

Set the tid on the reply to match the request.  This will allow a client
to have multiple commands in flight.

Signed-off-by: Sage Weil <sage@inktank.com>
mon/MonClient: add mon command handling

Reimplement the ceph tool functionality to set a command to the monitor
and collect a response.

Signed-off-by: Sage Weil <sage@inktank.com>
mon/MonClient: assume tid 0 is the first command

If we get an ack with no tid, we have to assume it is the first (hopefully
only) command we have in flight.  Old code doesn't properly set the tid.

Signed-off-by: Sage Weil <sage@inktank.com>
osdc/Objecter: implement osd and pg commands

This is reimplementing the 'tell osd' and 'pg ...' commands in the ceph
tool in the Objecter infrastruture.  As a result we are forced to consider
all of the corner cases we have already handled for regular ops and
linger ops, so the result should be significantly more robust.

Signed-off-by: Sage Weil <sage@inktank.com>
str_list: cleanup/enhancement

- move #includes to str_list.h
- remove redundant std::, add using for vector, set, list
- add get_str_vec and get_str_set-no-delims

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Add C and C++ interfaces to mon_command, osd_command, pg_command

Signed-off-by: Dan Mick <dan.mick@inktank.com>
rados.py: functions for new librados functions {mon,osd,pg}_command

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Rename "ceph" tool to "ceph-legacy-cli"

Conflicts:
	src/Makefile.am

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Formatter: add new_formatter(type)

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Formatter: fix XML parsing assert

Signed-off-by: Dan Mick <dan.mick@inktank.com>
mon: add JSON command parsing framework

Use json_spirit to read/parse JSON command input into a "cmdmap",
which is a boost::variant typechecked discriminant union.
This means that requests to read from the map must match the type
given.  Types are string, bool, int64_t, double, and vector<string>,
and that type is a "cmd_vartype"; a cmdmap is a map of name (string) to
cmd_vartype.

Also, an evolutionary deadend hack "build_fullcmd()", which reassembles
certain commands from the cmdmap back into a string for the sole reason
of running them through _allowed_command.  This is due to be replaced by
a better allow mechanism very shortly.

Signed-off-by: Dan Mick <dan.mick@inktank.com>
mon, ceph: transition to separate CLI parsing

ceph is a new Python CLI that:
1) queries the underlying cephbin to get command descriptors,
2) parses user input and validates everything possible,
3) passes validated JSON command to cephbin for handling

The frontend also presents help, and takes over the CLI command
looping mode.

Signed-off-by: Dan Mick <dan.mick@inktank.com>

Conflicts:

	src/mon/Monitor.cc
	src/mon/OSDMonitor.cc
Enhance cephtool tests for coverage of CLI rewrite

Signed-off-by: Dan Mick <dan.mick@inktank.com>
wip: osd tell commands, CephFileparse, etc.
librados: add *_command() variants that allocate the result w/ malloc

These are helpful for commands that may have large results and are
expensive to process and/or transfer because retrying very inefficient.
The caller is expected to free(3) the result.

Signed-off-by: Sage Weil <sage@inktank.com>