Skip to content

Commit

Permalink
broker: Update attribute names
Browse files Browse the repository at this point in the history
Given recent additions of the tbon.endpoint and mcast.endpoint
attributes, rename number of broker attributes for consistency.

tbon-request-uri -> tbon.endpoint-uri

tbon-parent-uri -> tbon.parent-endpoint-uri

event-uri -> mcast.endpoint-uri

event-relay-uri -> mcast.relay-endpoint-uri

Update documentation and add tests appropriately.

Fixes #1040
  • Loading branch information
chu11 committed Apr 14, 2017
1 parent 082818c commit 9e79ccc
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 15 deletions.
16 changes: 9 additions & 7 deletions doc/man7/flux-broker-attributes.adoc
Expand Up @@ -80,19 +80,21 @@ distributed over the tree based overlay network. Defaults to "tbon".
SOCKET ATTRIBUTES
-----------------
tbon-parent-uri::
tbon.parent-endpoint-uri::
The URI of the ZeroMQ endpoint this rank is connected to in the tree
based overlay network. This attribute will not be set on rank zero.
tbon-request-uri::
The URI of the ZeroMQ endpoint this rank is bound to in the tree
based overlay network.
tbon.endpoint-uri::
The URI of the ZeroMQ endpoint this rank is bound to in the tree based
overlay network. Compared to tbon.endpoint, this attribute may be
fully expanded out (e.g. a "%h" may be expanded to an IP).
event-uri::
mcast.endpoint-uri::
The URI of the ZeroMQ endpoint this rank is bound to for multicast
messaging.
messaging. Compared to mcast.endpoint, this attribute may be fully
expanded out (e.g. a "%h" may be expanded to an IP).
event-relay-uri::
mcast.relay-endpoint-uri::
The URI of the ZeroMQ endpoint this rank is bound to for relay of
multicast messages if multiple ranks are spawned per node.
Expand Down
16 changes: 8 additions & 8 deletions src/broker/broker.c
Expand Up @@ -477,15 +477,15 @@ int main (int argc, char *argv[])

/* Configure attributes.
*/
if (attr_add_active (ctx.attrs, "tbon-parent-uri", 0,
if (attr_add_active (ctx.attrs, "tbon.parent-endpoint-uri", 0,
attr_get_overlay, NULL, ctx.overlay) < 0
|| attr_add_active (ctx.attrs, "tbon-request-uri",
|| attr_add_active (ctx.attrs, "tbon.endpoint-uri",
FLUX_ATTRFLAG_IMMUTABLE,
attr_get_overlay, NULL, ctx.overlay) < 0
|| attr_add_active (ctx.attrs, "event-uri",
|| attr_add_active (ctx.attrs, "mcast.endpoint-uri",
FLUX_ATTRFLAG_IMMUTABLE,
attr_get_overlay, NULL, ctx.overlay) < 0
|| attr_add_active (ctx.attrs, "event-relay-uri",
|| attr_add_active (ctx.attrs, "mcast.relay-endpoint-uri",
FLUX_ATTRFLAG_IMMUTABLE,
attr_get_overlay, NULL, ctx.overlay) < 0
|| attr_add_active_uint32 (ctx.attrs, "rank", &ctx.rank,
Expand Down Expand Up @@ -1514,13 +1514,13 @@ static int attr_get_overlay (const char *name, const char **val, void *arg)
overlay_t *overlay = arg;
int rc = -1;

if (!strcmp (name, "tbon-parent-uri"))
if (!strcmp (name, "tbon.parent-endpoint-uri"))
*val = overlay_get_parent (overlay);
else if (!strcmp (name, "tbon-request-uri"))
else if (!strcmp (name, "tbon.endpoint-uri"))
*val = overlay_get_child (overlay);
else if (!strcmp (name, "event-uri"))
else if (!strcmp (name, "mcast.endpoint-uri"))
*val = overlay_get_event (overlay);
else if (!strcmp (name, "event-relay-uri"))
else if (!strcmp (name, "mcast.relay-endpoint-uri"))
*val = overlay_get_relay (overlay);
else {
errno = ENOENT;
Expand Down
21 changes: 21 additions & 0 deletions t/t0001-basic.t
Expand Up @@ -128,6 +128,17 @@ test_expect_success 'tbon.endpoint with %B works' '
test_expect_success 'tbon.endpoint fails on bad endpoint' '
! flux start -o,--setattr=tbon.endpoint='foo://bar' flux getattr tbon.endpoint
'
test_expect_success 'tbon.endpoint-uri can be read' '
ATTR_VAL=`flux start flux getattr tbon.endpoint-uri` &&
echo $ATTR_VAL | grep "^tcp"
'
test_expect_success 'tbon.parent-endpoint-uri cannot be read on rank 0' '
! flux start flux getattr tbon.parent-endpoint-uri
'
test_expect_success 'tbon.parent-endpoint-uri can be read on not rank 0' '
NUM=`flux start --size 4 flux wreckrun -N4 flux getattr tbon.parent-endpoint-uri | grep ipc | wc -l` &&
test $NUM -eq 3
'
test_expect_success 'mcast.endpoint can be read' '
ATTR_VAL=`flux start flux getattr mcast.endpoint` &&
echo $ATTR_VAL | grep "^tbon$"
Expand All @@ -138,6 +149,16 @@ test_expect_success 'mcast.endpoint works with ipc endpoints' '
test_expect_success 'mcast.endpoint fails on bad endpoint' '
! flux start -o,--setattr=mcast.endpoint='foo://bar' flux getattr mcast.endpoint
'
test_expect_success 'mcast.endpoint-uri not set by default' '
! flux start flux getattr mcast.endpoint-uri
'
test_expect_success 'mcast.endpoint-uri can be read when set' '
ATTR_VAL=`flux start -o,--setattr=mcast.endpoint='ipc://%B/event' flux getattr mcast.endpoint-uri` &&
echo $ATTR_VAL | grep "^ipc"
'
test_expect_success 'mcast.relay-endpoint-uri not set by default' '
! flux start flux getattr mcast.relay-endpoint-uri
'
test_expect_success 'broker.rundir override works' '
RUNDIR=`mktemp -d` &&
DIR=`flux start ${BUG1006} -o,--setattr=broker.rundir=$RUNDIR flux getattr broker.rundir` &&
Expand Down

0 comments on commit 9e79ccc

Please sign in to comment.