Skip to content

Commit 36f9626

Browse files
authored
Merge pull request #7 from sd-giovannini/master
Added groovy.remote.{xms, xmx} parameters
2 parents 5edb486 + 6a99cef commit 36f9626

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

Readme.md

+2
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,8 @@ This job accepts also:
337337
- `groovy.remote.username` (*required*) the username
338338
- `groovy.remote.port` (*default*: `22`) the ssh connection port
339339
- `groovy.remote.password` the password, must be set if `groovy.remote.keyFile` is not set
340+
- `groovy.remote.xms` set the minimum heap size for the remote jvm (if not set uses the azkaban settings)
341+
- `groovy.remote.xmx` set the maximum heap size for the remote jvm (if not set uses the azkaban settings)
340342
- `groovy.remote.retry` (*default*: `5`) number of connection attempts. If connection cannot be established the plugin retries to connect to the host after 5 seconds (it may be useful in case of on-demand EC2 instances that are not immediately ready for ssh). After each attempt, the delay is doubled (so 5, 10, 20...)
341343
- `groovy.remote.keyFile` the path of file containing the ssh key, must be set if `groovy.remote.password` is not set
342344
- `groovy.remote.working.dir` the working directory on the remote machine, is created if not found.

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<groupId>eu-spaziodati</groupId>
88
<artifactId>azkaban-plugins-groovy</artifactId>
99
<packaging>jar</packaging>
10-
<version>0.5.4</version>
10+
<version>0.5.5</version>
1111
<description>A set of plugins for Azkaban workflow manager to run jobs as groovy scripts</description>
1212
<url>https://github.com/SpazioDati/azkaban-groovy-plugin</url>
1313
<properties>

src/main/groovy/eu/spaziodati/azkaban/jobtype/GroovyRemoteJob.groovy

+22
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ class GroovyRemoteJob extends GroovyProcessJob {
7777
static final INIT_SCRIPT = "groovy.remote.initScript"
7878
static final RETRY = "groovy.remote.retry"
7979

80+
static final XMS = "groovy.remote.xms"
81+
static final XMX = "groovy.remote.xmx"
82+
8083
static def DISCARD_LOG = ~/\d+ bytes transferred/
8184
static def FIRST_DELAY = 5
8285
static def random = new SecureRandom()
@@ -112,6 +115,25 @@ class GroovyRemoteJob extends GroovyProcessJob {
112115
new BigInteger(64, random).toString(32)
113116
}
114117

118+
119+
@Override
120+
String createCommandLine() {
121+
def command = JAVA_COMMAND + " "
122+
command += getJVMArguments() + " "
123+
124+
def xms = jobProps.getString(XMS, getInitialMemorySize())
125+
def xmx = jobProps.getString(XMX, getMaxMemorySize())
126+
127+
command += "-Xms" + xms + " "
128+
command += "-Xmx" + xmx + " "
129+
command += "-cp " + createArguments(getClassPaths(), ":") + " "
130+
command += getJavaClass() + " "
131+
command += getMainArguments()
132+
133+
return command
134+
}
135+
136+
115137
@Override
116138
void run() {
117139

0 commit comments

Comments
 (0)