Bug #3140
closedRBNBToKepler2 actor output port generation problem
0%
Description
This actor is having problems dealing with output port generation when pointed at "niagara-dev.sdsc.edu:3333" (an sdsc test server). Below my discussion of what I think are the issues are (as posted to the rbnb-dev list https://lists.sdsc.edu/pipermail/rbnb-dev/2008/000298.html):
I have two RBNB questions:
1) Does one need to do a Fetch to get channel types?
2) Why does a Fetch sometimes reduce the number of channels in a channelmap?
I hope the answer to 1) is No. Is there a way to get type without first doing a Fetch? Below are some snippets that illustrate the two issues.
I first set up a registrationMap:
------------------------------
_map.Clear();
_registrationMap.Clear();
_sink.RequestRegistration(_registrationMap);
_sink.Fetch(_blockTimeout,_registrationMap);
_numChans = _registrationMap.NumberOfChannels();
for (int i=0; i < _numChans; i++){
chanType = _registrationMap.GetType(i);
System.out.println("chanType of _registrationMap chan " +i + " is: " + chanType);
_map.Add(_chanNames[i]);
}
------------------------------
Unfortunately the types printed are all 9, i.e. string....not true! (If I try to GetType on _map instead, after the _map.Add, I get NullPointerExceptions).
So what I've been doing after the above is the below code. After the following Request and Fetch I can use GetType to receive the variety of channeltypes I expect--strings, float64s, etc.
However, I was hoping I could get this 'metadata' without actually fetching data.
The below also illustrates issue 2).
------------------------------
_numChans2 = _map.NumberOfChannels();
System.out.println("num chans of _map: " + _numChans2);
// just get one small chunk of data so we are able to check the data types
_sink.Request(_map, 0, 1, "oldest");
_numChans2 = _map.NumberOfChannels();
System.out.println("num chans of _map: " + _numChans2);
_sink.Fetch(_blockTimeout,_map);
_numChans2 = _map.NumberOfChannels();
System.out.println("num chans of _map: " + _numChans2);
------------------------------
When I point at niagara-dev.sdsc.edu the stdouts print:
num chans of _map: 106
num chans of _map: 106
num chans of _map: 100
The Fetch seems to be changing the number of channels in _map! Does that make sense? Does Fetch throw-away / auto-disregard certain channels? On my server this does not happen, num chans does not change in those three stdouts. I also don't think it's that rbnb is throwing away channels with duration 0--I see more channels than 6 that have duration 0 on niagara-dev.
This is with v3.1b1 and v3.1b2.