azkaban-developers

Finishing unfinished comment in the plugin set. Also had second

4/23/2014 5:24:50 PM

Details

diff --git a/src/main/java/azkaban/jobtype/JobTypeManager.java b/src/main/java/azkaban/jobtype/JobTypeManager.java
index d66c92f..ebabaa1 100644
--- a/src/main/java/azkaban/jobtype/JobTypeManager.java
+++ b/src/main/java/azkaban/jobtype/JobTypeManager.java
@@ -296,18 +296,11 @@ public class JobTypeManager
 		return jobTypeLoader;
 	}
 	
-	public Job buildJobExecutor(String jobId, Props jobProps, Logger logger) 
-			throws JobTypeManagerException {
-		JobTypePluginSet pluginSet = getJobTypePluginSet();
-		return buildJobExecutor(jobId, jobProps, pluginSet, logger);
-	}
-	
-	private Job buildJobExecutor(
-			String jobId, 
-			Props jobProps, 
-			JobTypePluginSet pluginSet, 
-			Logger logger) 
-			throws JobTypeManagerException {
+	public Job buildJobExecutor( String jobId, Props jobProps, Logger logger) throws JobTypeManagerException {
+		// This is final because during build phase, you should never need to swap
+		// the pluginSet for safety reasons
+		final JobTypePluginSet pluginSet = getJobTypePluginSet();
+		
 		Job job = null;
 		try {
 			String jobType = jobProps.getString("type");
diff --git a/src/main/java/azkaban/jobtype/JobTypePluginSet.java b/src/main/java/azkaban/jobtype/JobTypePluginSet.java
index 052d750..f897435 100644
--- a/src/main/java/azkaban/jobtype/JobTypePluginSet.java
+++ b/src/main/java/azkaban/jobtype/JobTypePluginSet.java
@@ -12,8 +12,8 @@ import azkaban.utils.Props;
  * This contains the jobClass objects, the properties for loading plugins, and the
  * properties given by default to the plugin.
  * 
- * This class is not thread safe, so adding to this class should only occur when
- * 
+ * This class is not thread safe, so adding to this class should only be populated 
+ * and controlled by the JobTypeManager
  */
 public class JobTypePluginSet {
 	private Map<String, Class<? extends Job>> jobToClass;