You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by om...@apache.org on 2008/06/19 09:17:37 UTC

svn commit: r669409 - in /hadoop/core/branches/branch-0.18: ./ src/core/org/apache/hadoop/ipc/ src/core/org/apache/hadoop/metrics/util/ src/mapred/org/apache/hadoop/mapred/ src/test/org/apache/hadoop/dfs/ src/test/org/apache/hadoop/fs/

Author: omalley
Date: Thu Jun 19 00:17:37 2008
New Revision: 669409

URL: http://svn.apache.org/viewvc?rev=669409&view=rev
Log:
HADOOP-3533. Add deprecated methods to provide API compatibility
between 0.18 and 0.17. Remove the deprecated methods in trunk.

Modified:
    hadoop/core/branches/branch-0.18/CHANGES.txt
    hadoop/core/branches/branch-0.18/src/core/org/apache/hadoop/ipc/Client.java
    hadoop/core/branches/branch-0.18/src/core/org/apache/hadoop/ipc/Server.java
    hadoop/core/branches/branch-0.18/src/core/org/apache/hadoop/metrics/util/MetricsIntValue.java
    hadoop/core/branches/branch-0.18/src/core/org/apache/hadoop/metrics/util/MetricsTimeVaryingInt.java
    hadoop/core/branches/branch-0.18/src/core/org/apache/hadoop/metrics/util/MetricsTimeVaryingRate.java
    hadoop/core/branches/branch-0.18/src/mapred/org/apache/hadoop/mapred/JobHistory.java
    hadoop/core/branches/branch-0.18/src/mapred/org/apache/hadoop/mapred/JobStatus.java
    hadoop/core/branches/branch-0.18/src/mapred/org/apache/hadoop/mapred/JobTracker.java
    hadoop/core/branches/branch-0.18/src/mapred/org/apache/hadoop/mapred/LineRecordReader.java
    hadoop/core/branches/branch-0.18/src/mapred/org/apache/hadoop/mapred/TaskCompletionEvent.java
    hadoop/core/branches/branch-0.18/src/mapred/org/apache/hadoop/mapred/TaskLog.java
    hadoop/core/branches/branch-0.18/src/mapred/org/apache/hadoop/mapred/TaskTracker.java
    hadoop/core/branches/branch-0.18/src/test/org/apache/hadoop/dfs/NNBench.java
    hadoop/core/branches/branch-0.18/src/test/org/apache/hadoop/fs/AccumulatingReducer.java

Modified: hadoop/core/branches/branch-0.18/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.18/CHANGES.txt?rev=669409&r1=669408&r2=669409&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.18/CHANGES.txt (original)
+++ hadoop/core/branches/branch-0.18/CHANGES.txt Thu Jun 19 00:17:37 2008
@@ -620,6 +620,9 @@
     HADOOP-3586. Provide deprecated, backwards compatibile semantics for the
     combiner to be run once and only once on each record. (cdouglas)
 
+    HADOOP-3533. Add deprecated methods to provide API compatibility
+    between 0.18 and 0.17. Remove the deprecated methods in trunk. (omalley)
+
 Release 0.17.1 - Unreleased
 
   INCOMPATIBLE CHANGES

Modified: hadoop/core/branches/branch-0.18/src/core/org/apache/hadoop/ipc/Client.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.18/src/core/org/apache/hadoop/ipc/Client.java?rev=669409&r1=669408&r2=669409&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.18/src/core/org/apache/hadoop/ipc/Client.java (original)
+++ hadoop/core/branches/branch-0.18/src/core/org/apache/hadoop/ipc/Client.java Thu Jun 19 00:17:37 2008
@@ -79,7 +79,7 @@
   private int refCount = 1;
   
   final private static String PING_INTERVAL_NAME = "ipc.ping.interval";
-  final public static int DEFAULT_PING_INTERVAL = 60000; // 1 min
+  final static int DEFAULT_PING_INTERVAL = 60000; // 1 min
   final static int PING_CALL_ID = -1;
   
   /**
@@ -523,7 +523,15 @@
         notifyAll();
       }
     }
-    
+
+    /**
+     * No longer used.
+     */
+    @Deprecated
+    public void setTimeout(int len) {
+      // NOTHING
+    }
+
     /** Close the connection. */
     private synchronized void close() {
       if (!shouldCloseConnection.get()) {

Modified: hadoop/core/branches/branch-0.18/src/core/org/apache/hadoop/ipc/Server.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.18/src/core/org/apache/hadoop/ipc/Server.java?rev=669409&r1=669408&r2=669409&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.18/src/core/org/apache/hadoop/ipc/Server.java (original)
+++ hadoop/core/branches/branch-0.18/src/core/org/apache/hadoop/ipc/Server.java Thu Jun 19 00:17:37 2008
@@ -968,7 +968,15 @@
     } catch (IOException e) {
     }
   }
-  
+
+  /**
+   * No longer used.
+   */
+  @Deprecated
+  public void setTimeout(int len) {
+    // NOTHING
+  }
+
   /** Sets the socket buffer size used for responding to RPCs */
   public void setSocketSendBufSize(int size) { this.socketSendBufferSize = size; }
 

Modified: hadoop/core/branches/branch-0.18/src/core/org/apache/hadoop/metrics/util/MetricsIntValue.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.18/src/core/org/apache/hadoop/metrics/util/MetricsIntValue.java?rev=669409&r1=669408&r2=669409&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.18/src/core/org/apache/hadoop/metrics/util/MetricsIntValue.java (original)
+++ hadoop/core/branches/branch-0.18/src/core/org/apache/hadoop/metrics/util/MetricsIntValue.java Thu Jun 19 00:17:37 2008
@@ -32,7 +32,7 @@
  */
 public class MetricsIntValue {  
 
-  protected static final Log LOG =
+  private static final Log LOG =
     LogFactory.getLog("org.apache.hadoop.metrics.util");
 
   private String name;

Modified: hadoop/core/branches/branch-0.18/src/core/org/apache/hadoop/metrics/util/MetricsTimeVaryingInt.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.18/src/core/org/apache/hadoop/metrics/util/MetricsTimeVaryingInt.java?rev=669409&r1=669408&r2=669409&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.18/src/core/org/apache/hadoop/metrics/util/MetricsTimeVaryingInt.java (original)
+++ hadoop/core/branches/branch-0.18/src/core/org/apache/hadoop/metrics/util/MetricsTimeVaryingInt.java Thu Jun 19 00:17:37 2008
@@ -34,7 +34,7 @@
  */
 public class MetricsTimeVaryingInt {
 
-  protected static final Log LOG =
+  private static final Log LOG =
     LogFactory.getLog("org.apache.hadoop.metrics.util");
   
   private String name;

Modified: hadoop/core/branches/branch-0.18/src/core/org/apache/hadoop/metrics/util/MetricsTimeVaryingRate.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.18/src/core/org/apache/hadoop/metrics/util/MetricsTimeVaryingRate.java?rev=669409&r1=669408&r2=669409&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.18/src/core/org/apache/hadoop/metrics/util/MetricsTimeVaryingRate.java (original)
+++ hadoop/core/branches/branch-0.18/src/core/org/apache/hadoop/metrics/util/MetricsTimeVaryingRate.java Thu Jun 19 00:17:37 2008
@@ -34,7 +34,7 @@
  */
 public class MetricsTimeVaryingRate {
 
-  protected static final Log LOG =
+  private static final Log LOG =
     LogFactory.getLog("org.apache.hadoop.metrics.util");
 
   static class Metrics {

Modified: hadoop/core/branches/branch-0.18/src/mapred/org/apache/hadoop/mapred/JobHistory.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.18/src/mapred/org/apache/hadoop/mapred/JobHistory.java?rev=669409&r1=669408&r2=669409&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.18/src/mapred/org/apache/hadoop/mapred/JobHistory.java (original)
+++ hadoop/core/branches/branch-0.18/src/mapred/org/apache/hadoop/mapred/JobHistory.java Thu Jun 19 00:17:37 2008
@@ -62,7 +62,7 @@
  */
 public class JobHistory {
   
-  public static final Log LOG = LogFactory.getLog("org.apache.hadoop.mapred.JobHistory");
+  private static final Log LOG = LogFactory.getLog("org.apache.hadoop.mapred.JobHistory");
   private static final String DELIMITER = " ";
   private static final String KEY = "(\\w+)";
   private static final String VALUE = "[[^\"]?]+"; // anything but a " in ""
@@ -338,7 +338,12 @@
      * Returns all map and reduce tasks <taskid-Task>. 
      */
     public Map<String, Task> getAllTasks() { return allTasks; }
-    
+
+    @Deprecated
+    public static String getLocalJobFilePath(String jobid) {
+      return getLocalJobFilePath(JobID.forName(jobid));
+    }
+
     /**
      * Get the path of the locally stored job file
      * @param jobId id of the job
@@ -417,7 +422,14 @@
       }
       return decodedFileName;
     }
-    
+
+    @Deprecated
+    public static void logSubmitted(String jobid, JobConf jobConf,
+                                    String jobConfPath, long submitTime
+                                   ) throws IOException {
+      logSubmitted(JobID.forName(jobid), jobConf, jobConfPath, submitTime);
+    }
+
     /**
      * Log job submitted event to history. Creates a new file in history 
      * for the job. if history file creation fails, it disables history 
@@ -576,6 +588,13 @@
         }
       } 
     }
+
+    @Deprecated
+    public static void logStarted(String jobid, long startTime, int totalMaps,
+                                  int totalReduces) {
+      logStarted(JobID.forName(jobid), startTime, totalMaps, totalReduces);
+    }
+
     /**
      * Logs launch time of job. 
      * @param jobId job id, assigned by jobtracker. 
@@ -595,6 +614,16 @@
         }
       }
     }
+    
+    @Deprecated
+    public static void logFinished(String jobId, long finishTime,
+                                   int finishedMaps, int finishedReduces,
+                                   int failedMaps, int failedReduces,
+                                   Counters counters) {
+      logFinished(JobID.forName(jobId), finishTime, finishedMaps,
+                  finishedReduces, failedMaps, failedReduces, counters);
+    }
+
     /**
      * Log job finished. closes the job file in history. 
      * @param jobId job id, assigned by jobtracker. 
@@ -637,6 +666,13 @@
         historyCleaner.start(); 
       }
     }
+    
+    @Deprecated
+    public static void logFailed(String jobid, long timestamp, 
+                                 int finishedMaps, int finishedReduces) {
+      logFailed(JobID.forName(jobid), timestamp, finishedMaps, finishedReduces);
+    }
+
     /**
      * Logs job failed event. Closes the job history log file. 
      * @param jobid job id
@@ -670,6 +706,12 @@
   public static class Task extends KeyValuePair{
     private Map <String, TaskAttempt> taskAttempts = new TreeMap<String, TaskAttempt>(); 
 
+    @Deprecated
+    public static void logStarted(String jobId, String taskId, String taskType,
+                                  long startTime) {
+      logStarted(TaskID.forName(taskId), taskType, startTime, "n/a");
+    }
+
     /**
      * Log start time of task (TIP).
      * @param taskId task id
@@ -692,6 +734,13 @@
         }
       }
     }
+    
+    @Deprecated
+    public static void logFinished(String jobid, String taskid, String taskType,
+                                   long finishTime, Counters counters) {
+      logFinished(TaskID.forName(taskid), taskType, finishTime, counters);
+    }
+
     /**
      * Log finish time of task. 
      * @param taskId task id
@@ -715,6 +764,13 @@
         }
       }
     }
+    
+    @Deprecated
+    public static void logFailed(String jobid, String taskid, String taskType,
+                                 long time, String error) {
+      logFailed(TaskID.forName(taskid), taskType, time, error);
+    }
+
     /**
      * Log job failed event.
      * @param taskId task id
@@ -753,6 +809,12 @@
    * a Map Attempt on a node.
    */
   public static class MapAttempt extends TaskAttempt{
+    @Deprecated
+    public static void logStarted(String jobid, String taskid, String attemptid,
+                                  long startTime, String hostName) {
+      logStarted(TaskAttemptID.forName(attemptid), startTime, hostName);
+    }
+
     /**
      * Log start time of this map task attempt. 
      * @param taskAttemptId task attempt id
@@ -774,6 +836,13 @@
         }
       }
     }
+    
+    @Deprecated
+    public static void logFinished(String jobid, String taskid, 
+                                   String attemptid, long time, String host) {
+      logFinished(TaskAttemptID.forName(attemptid), time, host);
+    }
+
     /**
      * Log finish time of map task attempt. 
      * @param taskAttemptId task attempt id 
@@ -798,6 +867,13 @@
       }
     }
 
+    @Deprecated
+    public static void logFailed(String jobid, String taskid,
+                                 String attemptid, long timestamp, String host, 
+                                 String err) {
+      logFailed(TaskAttemptID.forName(attemptid), timestamp, host, err);
+    }
+
     /**
      * Log task attempt failed event.  
      * @param taskAttemptId task attempt id
@@ -821,6 +897,13 @@
         }
       }
     }
+
+    @Deprecated
+    public static void logKilled(String jobid, String taskid, String attemptid,
+                                 long timestamp, String hostname, String error){
+      logKilled(TaskAttemptID.forName(attemptid), timestamp, hostname, error);
+    }
+
     /**
      * Log task attempt killed event.  
      * @param taskAttemptId task attempt id
@@ -850,6 +933,13 @@
    * a Map Attempt on a node.
    */
   public static class ReduceAttempt extends TaskAttempt{
+    
+    @Deprecated
+    public static void logStarted(String jobid, String taskid, String attemptid,
+                                  long startTime, String hostName) {
+      logStarted(TaskAttemptID.forName(attemptid), startTime, hostName);
+    }
+
     /**
      * Log start time of  Reduce task attempt. 
      * @param taskAttemptId task attempt id
@@ -871,6 +961,15 @@
         }
       }
     }
+    
+    @Deprecated
+    public static void logFinished(String jobid, String taskid, String attemptid,
+                                   long shuffleFinished, long sortFinished,
+                                   long finishTime, String hostname) {
+      logFinished(TaskAttemptID.forName(attemptid), shuffleFinished, 
+                  sortFinished, finishTime, hostname);
+    }
+
     /**
      * Log finished event of this task. 
      * @param taskAttemptId task attempt id
@@ -899,6 +998,13 @@
         }
       }
     }
+
+    @Deprecated
+    public static void logFailed(String jobid, String taskid, String attemptid,
+                                 long timestamp, String hostname, String error){
+      logFailed(TaskAttemptID.forName(attemptid), timestamp, hostname, error);
+    }
+
     /**
      * Log failed reduce task attempt. 
      * @param taskAttemptId task attempt id
@@ -922,6 +1028,13 @@
         }
       }
     }
+    
+    @Deprecated
+    public static void logKilled(String jobid, String taskid, String attemptid,
+                                 long timestamp, String hostname, String error){
+      logKilled(TaskAttemptID.forName(attemptid), timestamp, hostname, error);
+    }
+
     /**
      * Log killed reduce task attempt. 
      * @param taskAttemptId task attempt id

Modified: hadoop/core/branches/branch-0.18/src/mapred/org/apache/hadoop/mapred/JobStatus.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.18/src/mapred/org/apache/hadoop/mapred/JobStatus.java?rev=669409&r1=669408&r2=669409&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.18/src/mapred/org/apache/hadoop/mapred/JobStatus.java (original)
+++ hadoop/core/branches/branch-0.18/src/mapred/org/apache/hadoop/mapred/JobStatus.java Thu Jun 19 00:17:37 2008
@@ -58,6 +58,12 @@
   public JobStatus() {
   }
 
+  @Deprecated
+  public JobStatus(String jobid, float mapProgress, float reduceProgress, 
+                   int runState) {
+    this(JobID.forName(jobid), mapProgress, reduceProgress, runState);
+  }
+
   /**
    * Create a job status object for a given jobid.
    * @param jobid The jobid of the job

Modified: hadoop/core/branches/branch-0.18/src/mapred/org/apache/hadoop/mapred/JobTracker.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.18/src/mapred/org/apache/hadoop/mapred/JobTracker.java?rev=669409&r1=669408&r2=669409&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.18/src/mapred/org/apache/hadoop/mapred/JobTracker.java (original)
+++ hadoop/core/branches/branch-0.18/src/mapred/org/apache/hadoop/mapred/JobTracker.java Thu Jun 19 00:17:37 2008
@@ -1728,6 +1728,11 @@
     return new JobID(getTrackerIdentifier(), nextJobId++);
   }
 
+  @Deprecated
+  public JobStatus submitJob(String jobid) throws IOException {
+    return submitJob(JobID.forName(jobid));
+  }
+
   /**
    * JobTracker.submitJob() kicks off a new job.  
    *
@@ -1800,12 +1805,22 @@
                                state);          
     }
   }
-    
+
+  @Deprecated
+  public void killJob(String id) {
+    killJob(JobID.forName(id));
+  }
+
   public synchronized void killJob(JobID jobid) {
     JobInProgress job = jobs.get(jobid);
     job.kill();
   }
 
+  @Deprecated
+  public JobProfile getJobProfile(String id) {
+    return getJobProfile(JobID.forName(id));
+  }
+
   public synchronized JobProfile getJobProfile(JobID jobid) {
     JobInProgress job = jobs.get(jobid);
     if (job != null) {
@@ -1814,6 +1829,12 @@
       return completedJobStatusStore.readJobProfile(jobid);
     }
   }
+  
+  @Deprecated
+  public JobStatus getJobStatus(String id) {
+    return getJobStatus(JobID.forName(id));
+  }
+
   public synchronized JobStatus getJobStatus(JobID jobid) {
     JobInProgress job = jobs.get(jobid);
     if (job != null) {
@@ -1822,6 +1843,12 @@
       return completedJobStatusStore.readJobStatus(jobid);
     }
   }
+
+  @Deprecated
+  public Counters getJobCounters(String id) {
+    return getJobCounters(JobID.forName(id));
+  }
+
   public synchronized Counters getJobCounters(JobID jobid) {
     JobInProgress job = jobs.get(jobid);
     if (job != null) {
@@ -1830,6 +1857,12 @@
       return completedJobStatusStore.readCounters(jobid);
     }
   }
+  
+  @Deprecated
+  public TaskReport[] getMapTaskReports(String jobid) {
+    return getMapTaskReports(JobID.forName(jobid));
+  }
+
   public synchronized TaskReport[] getMapTaskReports(JobID jobid) {
     JobInProgress job = jobs.get(jobid);
     if (job == null) {
@@ -1852,6 +1885,11 @@
     }
   }
 
+  @Deprecated
+  public TaskReport[] getReduceTaskReports(String jobid) {
+    return getReduceTaskReports(JobID.forName(jobid));
+  }
+
   public synchronized TaskReport[] getReduceTaskReports(JobID jobid) {
     JobInProgress job = jobs.get(jobid);
     if (job == null) {
@@ -1871,7 +1909,14 @@
       return reports.toArray(new TaskReport[reports.size()]);
     }
   }
-    
+
+  @Deprecated
+  public TaskCompletionEvent[] getTaskCompletionEvents(String jobid, int fromid, 
+                                                       int maxevents
+                                                      ) throws IOException {
+    return getTaskCompletionEvents(JobID.forName(jobid), fromid, maxevents);
+  }
+
   /* 
    * Returns a list of TaskCompletionEvent for the given job, 
    * starting from fromEventId.
@@ -1891,6 +1936,12 @@
     return events;
   }
 
+  @Deprecated
+  public String[] getTaskDiagnostics(String jobid, String tipid, 
+                                     String taskid) throws IOException {
+    return getTaskDiagnostics(TaskAttemptID.forName(taskid));
+  }
+
   /**
    * Get the diagnostics for a given task
    * @param taskId the id of the task
@@ -1943,7 +1994,12 @@
     JobInProgress job = jobs.get(tipid.getJobID());
     return (job == null ? null : job.getTaskInProgress(tipid));
   }
-    
+
+  @Deprecated
+  public boolean killTask(String taskId, boolean shouldFail) throws IOException{
+    return killTask(TaskAttemptID.forName(taskId), shouldFail);
+  }
+
   /** Mark a Task to be killed */
   public synchronized boolean killTask(TaskAttemptID taskid, boolean shouldFail) throws IOException{
     TaskInProgress tip = taskidToTIPMap.get(taskid);
@@ -1955,7 +2011,12 @@
       return false;
     }
   }
-  
+
+  @Deprecated
+  public String getAssignedTracker(String taskid) {
+    return getAssignedTracker(TaskAttemptID.forName(taskid));
+  }
+
   /**
    * Get tracker name for a given task id.
    * @param taskId the name of the task
@@ -2003,6 +2064,11 @@
   ///////////////////////////////////////////////////////////////
   // JobTracker methods
   ///////////////////////////////////////////////////////////////
+  @Deprecated
+  public JobInProgress getJob(String jobid) {
+    return getJob(JobID.forName(jobid));
+  }
+
   public JobInProgress getJob(JobID jobid) {
     return jobs.get(jobid);
   }
@@ -2300,6 +2366,11 @@
   }
   
 
+  @Deprecated
+  public String getLocalJobFilePath(String jobid) {
+    return getLocalJobFilePath(JobID.forName(jobid));
+  }
+
   /**
    * Get the localized job file path on the job trackers local file system
    * @param jobId id of the job

Modified: hadoop/core/branches/branch-0.18/src/mapred/org/apache/hadoop/mapred/LineRecordReader.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.18/src/mapred/org/apache/hadoop/mapred/LineRecordReader.java?rev=669409&r1=669408&r2=669409&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.18/src/mapred/org/apache/hadoop/mapred/LineRecordReader.java (original)
+++ hadoop/core/branches/branch-0.18/src/mapred/org/apache/hadoop/mapred/LineRecordReader.java Thu Jun 19 00:17:37 2008
@@ -222,6 +222,11 @@
     }
     this.pos = start;
   }
+
+  @Deprecated
+  public LineRecordReader(InputStream in, long offset, long endOffset) {
+    this(in, offset, endOffset, Integer.MAX_VALUE);
+  }
   
   public LineRecordReader(InputStream in, long offset, long endOffset,
                           int maxLineLength) {

Modified: hadoop/core/branches/branch-0.18/src/mapred/org/apache/hadoop/mapred/TaskCompletionEvent.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.18/src/mapred/org/apache/hadoop/mapred/TaskCompletionEvent.java?rev=669409&r1=669408&r2=669409&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.18/src/mapred/org/apache/hadoop/mapred/TaskCompletionEvent.java (original)
+++ hadoop/core/branches/branch-0.18/src/mapred/org/apache/hadoop/mapred/TaskCompletionEvent.java Thu Jun 19 00:17:37 2008
@@ -46,6 +46,18 @@
    *
    */
   public TaskCompletionEvent(){}
+  
+  @Deprecated
+  public TaskCompletionEvent(int eventId, 
+                             String taskId,
+                             int idWithinJob,
+                             boolean isMap,
+                             Status status, 
+                             String taskTrackerHttp){
+    this(eventId, TaskAttemptID.forName(taskId), idWithinJob, isMap, status, 
+         taskTrackerHttp);
+  }
+
   /**
    * Constructor. eventId should be created externally and incremented
    * per event for each job. 

Modified: hadoop/core/branches/branch-0.18/src/mapred/org/apache/hadoop/mapred/TaskLog.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.18/src/mapred/org/apache/hadoop/mapred/TaskLog.java?rev=669409&r1=669408&r2=669409&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.18/src/mapred/org/apache/hadoop/mapred/TaskLog.java (original)
+++ hadoop/core/branches/branch-0.18/src/mapred/org/apache/hadoop/mapred/TaskLog.java Thu Jun 19 00:17:37 2008
@@ -49,6 +49,11 @@
     }
   }
 
+  @Deprecated
+  public static File getTaskLogFile(String taskid, LogName filter) {
+    return getTaskLogFile(TaskAttemptID.forName(taskid), filter);
+  }
+
   public static File getTaskLogFile(TaskAttemptID taskid, LogName filter) {
     return new File(new File(LOG_DIR, taskid.toString()), filter.toString());
   }
@@ -116,7 +121,7 @@
     }
   }
 
-  public static class Reader extends InputStream {
+  static class Reader extends InputStream {
     private long bytesRemaining;
     private FileInputStream file;
     /**

Modified: hadoop/core/branches/branch-0.18/src/mapred/org/apache/hadoop/mapred/TaskTracker.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.18/src/mapred/org/apache/hadoop/mapred/TaskTracker.java?rev=669409&r1=669408&r2=669409&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.18/src/mapred/org/apache/hadoop/mapred/TaskTracker.java (original)
+++ hadoop/core/branches/branch-0.18/src/mapred/org/apache/hadoop/mapred/TaskTracker.java Thu Jun 19 00:17:37 2008
@@ -1986,6 +1986,12 @@
   // ///////////////////////////////////////////////////////////////
   // TaskUmbilicalProtocol
   /////////////////////////////////////////////////////////////////
+  
+  @Deprecated
+  public Task getTask(String id) throws IOException {
+    return getTask(TaskAttemptID.forName(id));
+  }
+
   /**
    * Called upon startup by the child process, to fetch Task data.
    */
@@ -1998,6 +2004,12 @@
     }
   }
 
+  @Deprecated
+  public boolean statusUpdate(String taskid, 
+                              TaskStatus status) throws IOException {
+    return statusUpdate(TaskAttemptID.forName(taskid), status);
+  }
+
   /**
    * Called periodically to report Task progress, from 0.0 to 1.0.
    */
@@ -2014,11 +2026,19 @@
     }
   }
 
+  @Deprecated
+  public void reportDiagnosticInfo(String taskid, 
+                                   String info) throws IOException {
+    reportDiagnosticInfo(TaskAttemptID.forName(taskid), info);
+  }
+
   /**
    * Called when the task dies before completion, and we want to report back
    * diagnostic info
    */
-  public synchronized void reportDiagnosticInfo(TaskAttemptID taskid, String info) throws IOException {
+  public synchronized void reportDiagnosticInfo(TaskAttemptID taskid, 
+                                                String info
+                                                ) throws IOException {
     TaskInProgress tip = tasks.get(taskid);
     if (tip != null) {
       tip.reportDiagnosticInfo(info);
@@ -2027,11 +2047,21 @@
     }
   }
 
+  @Deprecated
+  public boolean ping(String taskid) throws IOException {
+    return ping(TaskAttemptID.forName(taskid));
+  }
+
   /** Child checking to see if we're alive.  Normally does nothing.*/
   public synchronized boolean ping(TaskAttemptID taskid) throws IOException {
     return tasks.get(taskid) != null;
   }
 
+  @Deprecated
+  public void done(String taskid, boolean shouldPromote) throws IOException {
+    done(TaskAttemptID.forName(taskid), shouldPromote);
+  }
+
   /**
    * The task is done.
    */
@@ -2045,6 +2075,10 @@
     }
   }
 
+  @Deprecated 
+  public void shuffleError(String taskid, String msg) throws IOException {
+    shuffleError(TaskAttemptID.forName(taskid), msg);
+  }
 
   /** 
    * A reduce-task failed to shuffle the map-outputs. Kill the task.
@@ -2057,6 +2091,11 @@
     purgeTask(tip, true);
   }
 
+  @Deprecated
+  public void fsError(String taskid, String msg) throws IOException {
+    fsError(TaskAttemptID.forName(taskid), msg);
+  }
+
   /** 
    * A child task had a local filesystem error. Kill the task.
    */  
@@ -2068,6 +2107,13 @@
     purgeTask(tip, true);
   }
 
+  @Deprecated
+  public TaskCompletionEvent[] getMapCompletionEvents(String jobid, int fromid, 
+                                                      int maxlocs
+                                                     ) throws IOException {
+    return getMapCompletionEvents(JobID.forName(jobid), fromid, maxlocs);
+  }
+
   public TaskCompletionEvent[] getMapCompletionEvents(JobID jobId
       , int fromEventId, int maxLocs) throws IOException {
       
@@ -2109,6 +2155,11 @@
     }
   }
 
+  @Deprecated
+  public void mapOutputLost(String taskid, String msg) throws IOException {
+    mapOutputLost(TaskAttemptID.forName(taskid), msg);
+  }
+
   /**
    * A completed map task's output has been lost.
    */

Modified: hadoop/core/branches/branch-0.18/src/test/org/apache/hadoop/dfs/NNBench.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.18/src/test/org/apache/hadoop/dfs/NNBench.java?rev=669409&r1=669408&r2=669409&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.18/src/test/org/apache/hadoop/dfs/NNBench.java (original)
+++ hadoop/core/branches/branch-0.18/src/test/org/apache/hadoop/dfs/NNBench.java Thu Jun 19 00:17:37 2008
@@ -57,7 +57,6 @@
 import org.apache.hadoop.mapred.OutputCollector;
 import org.apache.hadoop.mapred.JobConf;
 import org.apache.hadoop.mapred.Reducer;
-import org.apache.hadoop.mapred.TaskTracker;
 
 /**
  * This program executes a specified operation that applies load to 
@@ -79,7 +78,7 @@
  */
 
 public class NNBench {
-  protected static final Log LOG = LogFactory.getLog(
+  private static final Log LOG = LogFactory.getLog(
           "org.apache.hadoop.dfs.NNBench");
   
   protected static String CONTROL_DIR_NAME = "control";
@@ -655,7 +654,7 @@
       
       // If the sleep time is greater than 0, then sleep and return
       if (sleepTime > 0) {
-        TaskTracker.LOG.info("Waiting in barrier for: " + sleepTime + " ms");
+        LOG.info("Waiting in barrier for: " + sleepTime + " ms");
       
         try {
           Thread.sleep(sleepTime);
@@ -773,7 +772,7 @@
 
             reporter.setStatus("Finish "+ l + " files");
           } catch (IOException e) {
-            TaskTracker.LOG.info("Exception recorded in op: " +
+            LOG.info("Exception recorded in op: " +
                     "Create/Write/Close");
  
             numOfExceptions++;
@@ -816,7 +815,7 @@
 
             reporter.setStatus("Finish "+ l + " files");
           } catch (IOException e) {
-            TaskTracker.LOG.info("Exception recorded in op: OpenRead " + e);
+            LOG.info("Exception recorded in op: OpenRead " + e);
             numOfExceptions++;
           }
         }
@@ -848,7 +847,7 @@
 
             reporter.setStatus("Finish "+ l + " files");
           } catch (IOException e) {
-            TaskTracker.LOG.info("Exception recorded in op: Rename");
+            LOG.info("Exception recorded in op: Rename");
 
             numOfExceptions++;
           }
@@ -879,7 +878,7 @@
 
             reporter.setStatus("Finish "+ l + " files");
           } catch (IOException e) {
-            TaskTracker.LOG.info("Exception in recorded op: Delete");
+            LOG.info("Exception in recorded op: Delete");
 
             numOfExceptions++;
           }
@@ -897,13 +896,13 @@
     protected String hostName;
 
     public NNBenchReducer () {
-      TaskTracker.LOG.info("Starting NNBenchReducer !!!");
+      LOG.info("Starting NNBenchReducer !!!");
       try {
         hostName = java.net.InetAddress.getLocalHost().getHostName();
       } catch(Exception e) {
         hostName = "localhost";
       }
-      TaskTracker.LOG.info("Starting NNBenchReducer on " + hostName);
+      LOG.info("Starting NNBenchReducer on " + hostName);
     }
 
     /**

Modified: hadoop/core/branches/branch-0.18/src/test/org/apache/hadoop/fs/AccumulatingReducer.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.18/src/test/org/apache/hadoop/fs/AccumulatingReducer.java?rev=669409&r1=669408&r2=669409&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.18/src/test/org/apache/hadoop/fs/AccumulatingReducer.java (original)
+++ hadoop/core/branches/branch-0.18/src/test/org/apache/hadoop/fs/AccumulatingReducer.java Thu Jun 19 00:17:37 2008
@@ -20,13 +20,14 @@
 import java.io.IOException;
 import java.util.Iterator;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.io.UTF8;
 import org.apache.hadoop.io.WritableComparable;
 import org.apache.hadoop.mapred.MapReduceBase;
 import org.apache.hadoop.mapred.OutputCollector;
 import org.apache.hadoop.mapred.Reducer;
 import org.apache.hadoop.mapred.Reporter;
-import org.apache.hadoop.mapred.TaskTracker;
 
 /**
  * Reducer that accumulates values based on their type.
@@ -46,17 +47,18 @@
  */
 public class AccumulatingReducer extends MapReduceBase
     implements Reducer<UTF8, UTF8, UTF8, UTF8> {
+  private static final Log LOG = LogFactory.getLog(AccumulatingReducer.class);
   
   protected String hostName;
   
   public AccumulatingReducer () {
-    TaskTracker.LOG.info("Starting AccumulatingReducer !!!");
+    LOG.info("Starting AccumulatingReducer !!!");
     try {
       hostName = java.net.InetAddress.getLocalHost().getHostName();
     } catch(Exception e) {
       hostName = "localhost";
     }
-    TaskTracker.LOG.info("Starting AccumulatingReducer on " + hostName);
+    LOG.info("Starting AccumulatingReducer on " + hostName);
   }
   
   public void reduce(UTF8 key,