Update documentation regarding topology_bin in the SubmitterMain (#1939)
* Cli passes only the file name of the topology_bin. Thus it's not necessary for the schedulers to
get the basename.
* Removed FileUtil since it's no longer used
* Fixed the unittest
* Fixed comments based on feedback
diff --git a/heron/scheduler-core/src/java/com/twitter/heron/scheduler/SubmitterMain.java b/heron/scheduler-core/src/java/com/twitter/heron/scheduler/SubmitterMain.java
index b8de47f..4f9c43a 100644
--- a/heron/scheduler-core/src/java/com/twitter/heron/scheduler/SubmitterMain.java
+++ b/heron/scheduler-core/src/java/com/twitter/heron/scheduler/SubmitterMain.java
@@ -189,10 +189,10 @@
.build();
Option topologyJar = Option.builder("j")
- .desc("user heron topology jar/pex file path")
+ .desc("The filename of the heron topology jar/tar/pex file to be run by the executor")
.longOpt("topology_bin")
.hasArgs()
- .argName("topology binary file")
+ .argName("topology binary filename on the cluster")
.required()
.build();
diff --git a/heron/schedulers/src/java/com/twitter/heron/scheduler/aurora/AuroraScheduler.java b/heron/schedulers/src/java/com/twitter/heron/scheduler/aurora/AuroraScheduler.java
index 14b18be..ca9d195 100644
--- a/heron/schedulers/src/java/com/twitter/heron/scheduler/aurora/AuroraScheduler.java
+++ b/heron/schedulers/src/java/com/twitter/heron/scheduler/aurora/AuroraScheduler.java
@@ -200,7 +200,7 @@
auroraProperties.put(AuroraField.TOPOLOGY_PACKAGE_TYPE,
Context.topologyPackageType(config).name().toLowerCase());
auroraProperties.put(AuroraField.TOPOLOGY_BINARY_FILE,
- FileUtils.getBaseName(Context.topologyBinaryFile(config)));
+ Context.topologyBinaryFile(config));
auroraProperties.put(AuroraField.JAVA_HOME, Context.clusterJavaHome(config));
auroraProperties.put(AuroraField.SHELL_BINARY, Context.shellBinary(config));
diff --git a/heron/schedulers/src/java/com/twitter/heron/scheduler/marathon/MarathonScheduler.java b/heron/schedulers/src/java/com/twitter/heron/scheduler/marathon/MarathonScheduler.java
index ae0cd3b..067f289 100644
--- a/heron/schedulers/src/java/com/twitter/heron/scheduler/marathon/MarathonScheduler.java
+++ b/heron/schedulers/src/java/com/twitter/heron/scheduler/marathon/MarathonScheduler.java
@@ -24,7 +24,6 @@
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.google.common.base.Joiner;
-import com.twitter.heron.common.basics.FileUtils;
import com.twitter.heron.proto.scheduler.Scheduler;
import com.twitter.heron.scheduler.utils.Runtime;
import com.twitter.heron.scheduler.utils.SchedulerUtils;
@@ -108,7 +107,7 @@
config = Config.newBuilder()
.putAll(config)
.put(Key.TOPOLOGY_BINARY_FILE,
- FileUtils.getBaseName(Context.topologyBinaryFile(config)))
+ Context.topologyBinaryFile(config))
.build();
ObjectMapper mapper = new ObjectMapper();
diff --git a/heron/schedulers/tests/java/com/twitter/heron/scheduler/aurora/AuroraSchedulerTest.java b/heron/schedulers/tests/java/com/twitter/heron/scheduler/aurora/AuroraSchedulerTest.java
index 3e76dc0..c24a82a 100644
--- a/heron/schedulers/tests/java/com/twitter/heron/scheduler/aurora/AuroraSchedulerTest.java
+++ b/heron/schedulers/tests/java/com/twitter/heron/scheduler/aurora/AuroraSchedulerTest.java
@@ -245,7 +245,7 @@
when(commandLine.getOptionValue("config_path")).thenReturn("/some/config/path");
when(commandLine.getOptionValue("topology_package")).thenReturn("jar");
when(commandLine.getOptionValue("topology_defn")).thenReturn("/mock/defnFile.defn");
- when(commandLine.getOptionValue("topology_bin")).thenReturn("/mock/binaryFile.jar");
+ when(commandLine.getOptionValue("topology_bin")).thenReturn("binaryFile.jar");
Config config = Mockito.spy(SubmitterMain.loadConfig(commandLine, topology));
AuroraScheduler testScheduler = new AuroraScheduler();