Commit 68607a93 authored by Robert Ricci's avatar Robert Ricci

Added a new function, TBWideareaNodeID . Given a physical node ID,

returns the node ID that should be used in the widearea_* tables.
This is mainly so that we don't have to hardcode 'boss' as the local
representative in too many places (all local node are assumed to
have the same network characteristics as boss.)
parent 3a4ff62b
......@@ -89,6 +89,9 @@ use Exporter;
TBUnixGroupList TBOSID TBImageID TBdbfork VnameToNodeid TBExpLocked
TBIsNodeRemote TBExptSetLogFile TBExptClearLogFile TBExptGetLogFile
TBIsNodeVirtual TBControlNetIP TBPhysNodeID
TBDB_WIDEAREA_LOCALNODE
TBWideareaNodeID
);
# Must come after package declaration!
......@@ -286,6 +289,12 @@ sub TBDB_NODEOPMODE_UNKNOWNOS { TBDB_TBEVENT_UNKNOWNOS; }
sub TBDB_NODEOPMODE_RELOADING { TBDB_TBEVENT_RELOADING; }
sub TBDB_NODEOPMODE_UNKNOWN { "UNKNOWN"; }
#
# Node name we use in the widearea_* tables to represent a generic local node.
# All local nodes are considered to have the same network characteristcs.
#
sub TBDB_WIDEAREA_LOCALNODE { "boss"; }
#
# We should list all of the DB limits.
#
......@@ -1680,6 +1689,28 @@ sub TBPhysNodeID($$)
return 0;
}
#
# From the physical node name, get the name that the should be used in the
# widearea_* tables
#
# usage TBWideareaNodeID(char *nodeid, char \*widearea_nodeid)
# Return 1 if success.
# Return 0 if error. (Currently, not possible)
#
sub TBWideareaNodeID($$)
{
my ($nodeid, $pwide) = @_;
if (TBIsNodeRemote($nodeid)) {
$$pwide = $nodeid;
} else {
$$pwide = TBDB_WIDEAREA_LOCALNODE;
}
return 1;
}
#
# Issue a DB query. Argument is a string. Returns the actual query object, so
# it is up to the caller to test it. I would not for one moment view this
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment