Selaa lähdekoodia

HADOOP-4275. Move public method isJobValidName from JobID to a private
method in JobTracker. (omalley)


git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/trunk@699437 13f79535-47bb-0310-9956-ffa450edef68

Owen O'Malley 17 vuotta sitten
vanhempi
commit
ef3e394909

+ 5 - 2
CHANGES.txt

@@ -237,8 +237,8 @@ Release 0.19.0 - Unreleased
     HADOOP-4205. hive: metastore and ql to use the refactored SerDe library.
     (zshao)
 
-    HADOOP-4106. libhdfs: add time, permission and user attribute support (part 2).
-    (Pete Wyckoff through zshao)
+    HADOOP-4106. libhdfs: add time, permission and user attribute support 
+    (part 2). (Pete Wyckoff through zshao)
 
     HADOOP-4104. libhdfs: add time, permission and user attribute support.
     (Pete Wyckoff through zshao)
@@ -765,6 +765,9 @@ Release 0.19.0 - Unreleased
     HADOOP-4259. Findbugs should run over tools.jar also. (cdouglas via 
     omalley)
 
+    HADOOP-4275. Move public method isJobValidName from JobID to a private
+    method in JobTracker. (omalley)
+
 Release 0.18.2 - Unreleased
 
   BUG FIXES

+ 0 - 17
src/mapred/org/apache/hadoop/mapred/JobID.java

@@ -152,23 +152,6 @@ public class JobID extends ID {
         + " is not properly formed");
   }
   
-  /** Check if the given string represents a job-id or not 
-   */
-  public static boolean isJobNameValid(String str) {
-    if(str == null) {
-      return false;
-    }
-    String[] parts = str.split("_");
-    if(parts.length == 3) {
-      if(parts[0].equals(JOB)) {
-          // other 2 parts should be parseable
-          return JobTracker.validateIdentifier(parts[1])
-                 && JobTracker.validateJobNumber(parts[2]);
-      }
-    }
-    return false;
-  }
-  
   /** 
    * Returns a regex pattern which matches task IDs. Arguments can 
    * be given null, in which case that part of the regex will be generic.  

+ 18 - 1
src/mapred/org/apache/hadoop/mapred/JobTracker.java

@@ -579,10 +579,27 @@ public class JobTracker implements MRConstants, InterTrackerProtocol,
       return jobsToRecover.size() != 0;
     }
 
+    /** Check if the given string represents a job-id or not 
+     */
+    private boolean isJobNameValid(String str) {
+      if(str == null) {
+        return false;
+      }
+      String[] parts = str.split("_");
+      if(parts.length == 3) {
+        if(parts[0].equals("job")) {
+            // other 2 parts should be parseable
+            return JobTracker.validateIdentifier(parts[1])
+                   && JobTracker.validateJobNumber(parts[2]);
+        }
+      }
+      return false;
+    }
+    
     // checks if the job dir has the required files
     public void checkAndAddJob(FileStatus status) throws IOException {
       String jobName = status.getPath().getName();
-      if (JobID.isJobNameValid(jobName)) {
+      if (isJobNameValid(jobName)) {
         if (JobClient.isJobDirValid(status.getPath(), fs)) {
           recoveryManager.addJobForRecovery(JobID.forName(jobName));
         } else {