-
Notifications
You must be signed in to change notification settings - Fork 52
/
SubmitStormTopology.ps1
44 lines (40 loc) · 1.64 KB
/
SubmitStormTopology.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
[CmdletBinding(PositionalBinding=$True)]
Param(
[Parameter(Mandatory = $true)]
[String]$ClusterOsType, # required
[Parameter(Mandatory = $true)]
[String]$ClusterUrl, # required
[Parameter(Mandatory = $true)]
[String]$ClusterUsername, # required
[Parameter(Mandatory = $true)]
[String]$ClusterPassword, # required
[Parameter(Mandatory = $true)]
[String]$JarPath, # required path of the jar in WASB to submit
[Parameter(Mandatory = $true)]
[String]$ClassName, # required
[String]$AdditionalParams # optional at least include the topology name
)
###########################################################
# Start - Initialization - Invocation, Logging etc
###########################################################
$VerbosePreference = "SilentlyContinue"
$ErrorActionPreference = "Stop"
$scriptPath = $MyInvocation.MyCommand.Path
$scriptDir = Split-Path $scriptPath
& "$scriptDir\..\init.ps1"
if(-not $?)
{
throw "Initialization failure."
exit -9999
}
###########################################################
# End - Initialization - Invocation, Logging etc
###########################################################
if($ClusterOsType -like "Windows")
{
& "$scriptDir\SubmitStormTopologyWindows.ps1" $ClusterUrl $ClusterUsername $ClusterPassword $JarPath $ClassName $AdditionalParams
}
else
{
& "$scriptDir\SubmitStormTopologyLinux.ps1" $ClusterUrl $ClusterUsername $ClusterPassword $JarPath $ClassName $AdditionalParams
}