Repository: reef
Updated Branches:
refs/heads/master 2bfb7318f -> 1038a6da8
[REEF-1517] Fix warning in .\bin\runreef.ps1 script
* Rename PowerShell functions to match coding conventions,
e.g. Submit-YARN-Application -> SubmitYarnApplication
JIRA:
[REEF-1517](https://issues.apache.org/jira/browse/REEF-1517)
Pull request:
This closes #1090
Project: http://git-wip-us.apache.org/repos/asf/reef/repo
Commit: http://git-wip-us.apache.org/repos/asf/reef/commit/1038a6da
Tree: http://git-wip-us.apache.org/repos/asf/reef/tree/1038a6da
Diff: http://git-wip-us.apache.org/repos/asf/reef/diff/1038a6da
Branch: refs/heads/master
Commit: 1038a6da822ad591daaefea0cf518ccf860a9ea4
Parents: 2bfb731
Author: Sergiy Matusevych <[email protected]>
Authored: Wed Aug 10 15:07:08 2016 -0700
Committer: Mariia Mykhailova <[email protected]>
Committed: Fri Aug 12 13:01:12 2016 -0700
----------------------------------------------------------------------
bin/runreef.ps1 | 2 +-
bin/runreef.psm1 | 12 +++++++-----
2 files changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/reef/blob/1038a6da/bin/runreef.ps1
----------------------------------------------------------------------
diff --git a/bin/runreef.ps1 b/bin/runreef.ps1
index f334e0e..f7a8eae 100644
--- a/bin/runreef.ps1
+++ b/bin/runreef.ps1
@@ -47,7 +47,7 @@ param
Import-Module ((Split-Path -Parent $MyInvocation.MyCommand.Definition) +
"\runreef.psm1")
if ((Split-Path -Leaf
$MyInvocation.MyCommand.Definition).Equals("runreef.ps1")) {
- Submit-YARN-Application `
+ SubmitYarnApplication `
-Jars ($Jars -split ';') `
-Class $Class `
-JavaOptions $JavaOptions `
http://git-wip-us.apache.org/repos/asf/reef/blob/1038a6da/bin/runreef.psm1
----------------------------------------------------------------------
diff --git a/bin/runreef.psm1 b/bin/runreef.psm1
index c074759..d7b98a7 100644
--- a/bin/runreef.psm1
+++ b/bin/runreef.psm1
@@ -22,7 +22,7 @@ specific language governing permissions and limitations
under the License.
#>
-function Get-YARN-Classpath {
+function GetYarnClasspath {
<#
.SYNOPSIS
Returns the classpath setup by YARN.
@@ -33,7 +33,7 @@ function Get-YARN-Classpath {
}
-function Submit-YARN-Application {
+function SubmitYarnApplication {
<#
.SYNOPSIS
Runs a given main class from a given JAR file on a YARN cluster.
@@ -70,9 +70,9 @@ function Submit-YARN-Application {
}
# Assemble the classpath for the job
- if($env:HADOOP_HOME){
- $CLASSPATH = (Get-YARN-Classpath) + $Jars -join ";"
- }else{
+ if ($env:HADOOP_HOME) {
+ $CLASSPATH = (GetYarnClasspath) + $Jars -join ";"
+ } else {
$CLASSPATH = $Jars -join ";"
}
@@ -84,8 +84,10 @@ function Submit-YARN-Application {
# Assemble the command to run
# Note: We need to put the classpath within "", as it contains ";"
$command = "& `"$env:JAVA_HOME\bin\java.exe`" $JavaOptions -cp
`"$CLASSPATH`" $LogParams $Class $Arguments"
+
if ($VerboseLog) {
echo $command
}
+
Invoke-Expression -Command $command
}