MySamplerStream does not return null for sampling the future
Created by: apcarp
The documentation for MySamplerStream states that calling the read() method of a stream should return null if the time to be sampled is in the future. However, the stream currently returns an event with the future timestamp and the value/code of the most recent preceding event. This is consistent with the command line mySampler tool, but not consistent with the documentation.
Upon reflection, I do not like either approach. Sampling into the future should not return definite values since we do not know yet what those values will be. However, a user that requests 10 samples would be reasonably justified in expecting a response with 10 Events. I think the best result here is to return an event with EventCode.UNDEFINED, similarly to how we handle sampling before data exists in the stream. This keeps the number of results similar to previous behavior, a definite number of responses and an UNDEFINED code for when there is no known data.