msg: make messenger type configurable

Eventaully we may want to override this by passing the type in as an
arg, but let's do that later.

Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Sage Weil 2014-10-03 17:59:40 -07:00
parent 62b0bfdc07
commit 69acc8ae02
2 changed files with 5 additions and 1 deletions

View File

@ -113,6 +113,7 @@ OPTION(heartbeat_file, OPT_STR, "")
OPTION(heartbeat_inject_failure, OPT_INT, 0) // force an unhealthy heartbeat for N seconds
OPTION(perf, OPT_BOOL, true) // enable internal perf counters
OPTION(ms_type, OPT_STR, "simple") // messenger backend
OPTION(ms_tcp_nodelay, OPT_BOOL, true)
OPTION(ms_tcp_rcvbuf, OPT_INT, 0)
OPTION(ms_tcp_prefetch_max_size, OPT_INT, 4096) // max prefetch size, we limit this to avoid extra memcpy

View File

@ -9,5 +9,8 @@ Messenger *Messenger::create(CephContext *cct,
string lname,
uint64_t nonce)
{
return new SimpleMessenger(cct, name, lname, nonce);
if (cct->_conf->ms_type == "simple")
return new SimpleMessenger(cct, name, lname, nonce);
derr << "unrecognized ms_type '" << cct->_conf->ms_type << "'" << dendl;
return NULL;
}