previous   next   contents   commands   index  

3.6. Querying MStream and Agent related Information


Querying System Information

Information about the System can be queried from an external shell or an Agent Handler. Those are:

The current Location (Agent Daemon identifier):

% stream_location
2
This example shows that we are currently working on Location 2

The list of active (Agent Daemon is running) Peers:

% get_active_peer_map
2 129.6.55.183 1 129.6.55.178 0 129.6.55.16
This command returns a list of pairs <Location IPAddress>. The previous result shows that:

The list of active and inactive (Agent Daemon was killed) Peers:

% get_peer_map
2 129.6.55.183 1 1 129.6.55.178 0 0 129.6.55.16 1
This command returns a list of triplets <Location IPAddress status>. When status is set to 0 that means the Peer is inactive, 1 means active. So the previous result shows that:

The IP address of a Peer::

% get_peer_addr 2
129.6.55.183
The result of this command shows that the Agent Daemon identified by the Location 2 is running at the IP address 129.6.55.183.


Querying information about MStreams

Information about the MStreams can be queried from an external shell or an Agent Handler. Those are:

The list of existing MStreams and where they are living:

% list_streams
foo 0 /system/agnid/0 0 /system/syscontroller 0
The result of this command shows that 3 MStreams are currently living at Location 0:

The existence of a MStream:

% stream_exists foo
1
This commands returns 1 if the MStream exists, 0 if not. In the example, the MStream called foo exists.

The Location of a MStream:

% stream_location foo
0
In this example, the MStream called foo is living at Location 0.

The Location where the MStream was created:

% stream_creator foo
2
This commands returns the Location where the MStream was created. In our example, the MStream called foo was created on Location 2.


Agents may also need information about the MStream they are attached to. So the following information can be queried from inside Agent Handlers:

The Name of MStream the Agent is attached to:

% stream_name
foo
In this example the Agent is attached to a MStream called foo

The Location where the MStream was created:

% stream_creator
0
In this example the Agent is attached to a MStream that was created at Location 0.


Querying information about Agents

Information about the Agents can be queried from an external shell or an Agent Handler. Those are:

The list of Agents attached to a MStream:

% list_agents foo
1 0
In this example, the MStream called foo has 2 Agents attached to it: 0 and 1 are their identifier.

The Location where an Agent was created:

% agent_creator foo 1
0
In this example, the Agent attached to the MStream foo and identified by 1 was created at Location 0.

The Location where an Agent was created:

% get_agent_code foo 1
 
       on_stream_append {
                puts "got a message!"
        }
 
In this example, the Agent identified by 1 has only one Handler attached to it. The command get_agent_code can also return (depending on the arguments provided) the code of every Agents attached to a MStream, including the Stream Controller, or the code of the Stream controller alone.


Agents may also need information about themselves. So the following information can be queried from inside Agent Handlers:

The identifier of the current Agent:

set id [agent_id]
In this example, the variable id will be set to the value of the current Agent identifier (1 for example).

The Location where the current Agent was created:

set initLoc [agent_creator]
In this example, the variable initLoc will be set to the Location where the Agent was created (0 for example).


Feedback
Last modified: Wed Jan 27 12:01:18 EST 1999