Repository: incubator-edgent
Updated Branches:
  refs/heads/master 18d8f8b07 -> 282d14167


Set auto-assigned Job name at construction time instead of in getName()

Just simplifies the logic.

Project: http://git-wip-us.apache.org/repos/asf/incubator-edgent/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-edgent/commit/4266957b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-edgent/tree/4266957b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-edgent/diff/4266957b

Branch: refs/heads/master
Commit: 4266957be396321cc297a290f3ca985161a5201d
Parents: a6090c8
Author: Dale LaBossiere <dlab...@us.ibm.com>
Authored: Mon Jan 16 15:51:37 2017 -0500
Committer: Dale LaBossiere <dlab...@us.ibm.com>
Committed: Mon Jan 16 15:51:37 2017 -0500

----------------------------------------------------------------------
 .../java/org/apache/edgent/runtime/etiao/EtiaoJob.java | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/4266957b/runtime/etiao/src/main/java/org/apache/edgent/runtime/etiao/EtiaoJob.java
----------------------------------------------------------------------
diff --git 
a/runtime/etiao/src/main/java/org/apache/edgent/runtime/etiao/EtiaoJob.java 
b/runtime/etiao/src/main/java/org/apache/edgent/runtime/etiao/EtiaoJob.java
index 95bf8ce..db57e55 100644
--- a/runtime/etiao/src/main/java/org/apache/edgent/runtime/etiao/EtiaoJob.java
+++ b/runtime/etiao/src/main/java/org/apache/edgent/runtime/etiao/EtiaoJob.java
@@ -55,13 +55,15 @@ public class EtiaoJob extends AbstractGraphJob implements 
JobContext {
      * 
      * @param graph graph representation of the topology
      * @param topologyName name of the topology
-     * @param jobName name of the Job
+     * @param jobName name of the Job. If null, a name of {@code 
topologyName_jobId} is assigned.
      * @param container service container
      */
     EtiaoJob(DirectGraph graph, String topologyName, String jobName, 
ServiceContainer container) {
         this.graph = graph;
         this.id = ID_PREFIX + String.valueOf(jobID.getAndIncrement());
         this.topologyName = topologyName;
+        if (jobName == null)
+          jobName = this.topologyName + "_" + this.id;
         this.name = jobName;
         this.containerServices = container;
 
@@ -74,16 +76,9 @@ public class EtiaoJob extends AbstractGraphJob implements 
JobContext {
             jobs.addJob(this);
     }
 
-    /**
-     * {@inheritDoc}
-     * <P>
-     * If a job name is not specified, this implementation 
-     * creates a job name with the following format: {@code 
topologyName_jobId}.
-     * </P>
-     */
     @Override
     public String getName() {
-        return name != null ? name : topologyName + "_" + this.id;
+        return name;
     }
 
     @Override

Reply via email to