Hey Jonathan, I've attempted to answer your questions by updating the Javadocs. :)
http://samza.incubator.apache.org/learn/documentation/0.7.0/api/javadocs/or g/apache/samza/system/SystemConsumer.html Let me know if anything doesn't make sense. Also, it'd be awesome if you could contribute your file reader SystemConsumer. This seems like it'd be really useful for a lot of things. Could you open a JIRA and submit a patch when you're ready? Cheers, Chris On 1/29/14 11:14 PM, "Jonathan Poltak Samosir" <[email protected]> wrote: >Hello, > >Currently trying to write a simple Samza System that reads from a file >and puts the contents onto a Samza-compatible stream. Been basing it off >the hello-samza WikipediaSystem example so far. The SystemFactory >implementation seemed to be pretty straightforward (get path to file from >config and return a SystemConsumer that reads the file at that path), >although I am not 100% sure of what the purpose of all the SystemConsumer >interface methods are. > >start() and stop() seem fairly self-explanatory, getting called at the >when the System is started and stopped, respectively (please let me know >if I am wrong about any of my understandings). register() seems to be >similar to start() in that it will be called near the beginning of the >System, although giving access to the SystemStreamPartition and a given >partition offset, correct? The poll() method seems to be where most of >the action takes place, and going by its name, it is called often or at >specified intervals? If so, how does this polling work and how is the >interval specified? >Also, the List of IncomingMessageEnvelopes that get returned from poll(): >these are then forwarded on to their specified SystemStreamPartitions >(first arg in the IncomingMessageEnvelope constructor)? > >Anyway, thanks for your time and let me know how far off I am with my >understanding of this (as I can't get anything working with my current >system implementation). Will be happy to contribute back Javadoc patch >reflecting my amended understanding of this interface afterwards. > >Jonathan
