User Tools

Site Tools


org.gramar.storm.gramar:walkthrough

This is an old revision of the document!


A PCRE internal error occured. This might be caused by a faulty plugin

This page walks through a sample usage of the org.gramar.storm.gramar **gramar**. The specifics of the topology to be implemented aren't all that important. Instead we'll focus on how to use the gramar to generate almost all of the topology implementation. We start with an empty Eclipse workspace (except for a general project named "Sandbox"). We **New -> Other... -> Gramar -> Sample Model** and select the sample model for the gramar: {{:org.gramar.storm.gramar:wt03.png|}} And we get this skeletal sample: <code> <root> <!-- label : A multi-token displayable name for the topology --> <!-- mavenGroupId : The groupId for the maven artifacts to be created --> <!-- basePackage : The name prefix for all Java packages --> <!-- provider : The name of the person, prganization or company that owns this transformation tool --> <!-- stormProject : Optional, the name of the maven project containing the storm implementation --> <!-- allProject : Optional, the name of the maven module project --> <topology label="" mavenGroupId="" basePackage="" provider="" title="" > <!-- label : A multi-token, displayable name for the bolt --> <!-- instances : The number of instances of this bolt to be constructed at runtime --> <bolt label="" instances=""> <!-- stream : The single-token name of a stream emitted by the bolt --> <!-- type : The name of a defined type that describes the shape of the fields on the stream --> <emits stream="" type=""> </emits> <!-- stream : The name of a stream read by the bolt --> <!-- grouping : One of "fields", "shuffle", "global", "all", "local", "localOrShuffle", "none", "partialKey" (custom not yet supported) --> <reads stream="" grouping="" > <!-- name : The name of the fields whose value is used to direct tuples on this stream (for fields and partialKey groupings) --> <fieldRef name=""> </fieldRef> </reads> <!-- from : The id of an other component --> <in from="" /> <!-- to : The id of an other component --> <out to="" /> </bolt> <!-- label : A multi-token, displayable name for the spout --> <!-- instances : The number of instances of this bolt to be constructed at runtime --> <spout label="" instances=""> <!-- type : The name of a defined type that describes the shape of the fields on the stream --> <!-- idType : The type of the message ID for reliable emits. Defaults to the type. --> <!-- stream : The unique name of the stream --> <emits type="" stream=""> </emits> </spout> <!-- name : The capitalized, single-token name of the type --> <type name=""> <!-- name : The single-token name of the property --> <!-- type : One of String, Integer, Long, Double, Boolean, Date --> <!-- list : Boolean value indicating whether this field is really a list of the given type --> <field name="" type="" list="false" > </field> </type> <!-- name : The single-token name of the environment --> <!-- runLocally : Indicates whether execution is in a LocalCluster (true) or full cluster (false) --> <!-- default : True only if if the target environment is the default environment if none is specified during execution --> <environment name="" runLocally="" default=""> </environment> <!-- id : The unique id of the component --> <!-- kind : one of "kafka" --> <other id="" kind="" style="shape=box, fillcolor=skyblue1" lineStyle="penwidth=3, style=dashed, color=slateblue1" /> </topology> </root> </code> This means we have to think about what we want to implement. <code> </code>

org.gramar.storm.gramar/walkthrough.1470674501.txt.gz · Last modified: 2016/08/08 16:41 by chrisgerken