This folder contains the original SCP.Net examples the details the different concepts of SCP.Net and usage patterns.
If you are looking for Azure Services related templates look into this directory: [HDInsight Storm Azure Application Templates] (../templates)
Build the examples using build.bat
in this directory.
-
TopologyBuilder: Following examples use TopologyBuilder and SCPHost.exe as the executable container. They can be easily submitted to the cluster using HDInsight VS Tools.
-
HelloWorldHostMode
-
HelloWorldHostModeMultiSpout
-
HybridTopologyHostMode
-
Executable: Following examples show executable based invocation i.e. one has to use the provided spec files or create one of their own.
-
HelloWorld
-
HelloWorldKafka
-
HybridTopology
You can also choose to use the alternative SetSpout & SetBolt methods of the TopologyBuilder if you want to use executables as an application type:
public SpoutDeclarer SetSpout(string spoutName, string pluginName, List<string> pluginArgs, Dictionary<string, List<string>> outputSchema, int parallelismHint, bool enableAck = false)
public BoltDeclarer SetBolt(string boltName, string pluginName, List<string> pluginArgs, Dictionary<string, List<string>> outputSchema, int parallelismHint, bool enableAck = false)
-
Build the examples using
build.bat
in this directory. -
Go to the respective example folder like
HelloWorld
and run the following command -
[OPTIONAL] Create the SCP.Net spec using the topology dll, applicable to TopologyBuilder based examples. Make sure you set the Active attribute on your Topology or provide the fully qualified class name.
..\..\scripts\scpnet\CreateScpSpec.ps1 -TopologyAssembly .\bin\Debug\HelloWorldHostMode.dll -SpecFile HelloWorldHostMode.spec
- Create the SCP.Net package using the binaries directory:
..\..\scripts\scpnet\CreateScpPackage.ps1 -TopologyAssemblyDir .\bin\Debug -PackageFile HelloWorld.zip
For a Hybrid topology like HybridTopology
provide the Java dependencies folder
..\..\scripts\scpnet\CreateScpPackage.ps1 -TopologyAssemblyDir .\bin\Debug -PackageFile HelloWorld.zip -JavaDependencies .\java\target\HybridTopology-1.0-SNAPSHOT.jar
- Submit the topology using the following command:
..\..\scripts\scpnet\SubmitSCPNetTopology.ps1 -ClusterUrl $clusterUrl -ClusterUsername $clusterUsername -ClusterPassword $clusterPassword -SpecFile .\HelloWorld.spec -PackageFile .\HelloWorld.zip
This approach is useful for Executable type of topologies or when you are hitting issues submitting the topologies from SCPAPI.
-
Build the examples using
build.bat
in this directory. -
Go to the respective example folder like
HelloWorld
and copy the spec file likeHelloWorld.spec
and the binaries directory likeHelloWorld\bin\debug
to your Storm cluster -
Open the
Storm Command Line
shortcut on your Storm cluster desktop -
Submit the topology using the following command (NOTE: Do not forget to specify the specs agrument as that is the temp directory where spec compilation takes place):
bin\runSpec.cmd MyExample\HelloWorld.spec specs MyExample\bin\Debug
Output:
C:\apps\dist\storm-0.9.3.2.2.6.1-0011>bin\runSpec.cmd MyExample\HelloWorld.spec specs MyExample\bin\Debug
Version: 0.9.4.124
Compiling MyExample\HelloWorld.spec...
Submitting topology HelloWorld...
Clean the examples using cleanup.bat
in this directory.