瀏覽代碼

HADOOP-2821. Removes deprecated ShellUtil and ToolBase classes from the util package. Contributed by Amareshwari Sri Ramadasu.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/trunk@633428 13f79535-47bb-0310-9956-ffa450edef68
Devaraj Das 17 年之前
父節點
當前提交
353f77b3bd
共有 3 個文件被更改,包括 3 次插入124 次删除
  1. 3 0
      CHANGES.txt
  2. 0 67
      src/java/org/apache/hadoop/util/ShellUtil.java
  3. 0 57
      src/java/org/apache/hadoop/util/ToolBase.java

+ 3 - 0
CHANGES.txt

@@ -134,6 +134,9 @@ Trunk (unreleased changes)
     HADOOP-2817. Removes deprecated mapred.tasktracker.tasks.maximum and 
     ClusterStatus.getMaxTasks(). (Amareshwari Sri Ramadasu via ddas) 
 
+    HADOOP-2821. Removes deprecated ShellUtil and ToolBase classes from
+    the util package. (Amareshwari Sri Ramadasu via ddas) 
+
 Release 0.16.1 - Unreleased
 
   IMPROVEMENTS

+ 0 - 67
src/java/org/apache/hadoop/util/ShellUtil.java

@@ -1,67 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.hadoop.util;
-
-import java.util.List;
-import java.util.Map;
-import java.io.File;
-import java.io.IOException;
-
-import org.apache.hadoop.util.Shell.ShellCommandExecutor;
-
-/**
- *  Class to execute a shell.
- *  @deprecated Use {@link ShellCommandExecutor} instead.
- */
-public class ShellUtil {
-  
-  ShellCommandExecutor shexec; // shell to execute a command
-  
-    /**
-     * @param args list containing command and command line arguments
-     * @param dir Current working directory
-     * @param env Environment for the command
-     */
-    public ShellUtil (List<String> args, File dir, Map<String, String> env) {
-      shexec = new ShellCommandExecutor(args.toArray(new String[0]), dir, 
-                                         env);
-    }
-	
-    /**
-     * Executes the command.
-     * @throws IOException
-     * @throws InterruptedException
-     */
-    public void execute() throws IOException {
-      // start the process and wait for it to execute
-      shexec.execute();
-    }
-    /**
-     * @return process
-     */
-    public Process getProcess() {
-      return shexec.getProcess();
-    }
-
-    /**
-     * @return exit-code of the process
-     */
-    public int getExitCode() {
-      return shexec.getExitCode();
-   }
-}

+ 0 - 57
src/java/org/apache/hadoop/util/ToolBase.java

@@ -1,57 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.hadoop.util;
-
-import org.apache.hadoop.conf.Configuration;
-
-/*************************************************************
- * @deprecated This class is depracated. Classes 
- * extending ToolBase should rather implement {@link Tool} 
- * interface, and use {@link ToolRunner} for execution 
- * functionality. Alternatively, {@link GenericOptionsParser} 
- * can be used to parse generic arguments related to hadoop 
- * framework. 
- */
-@Deprecated
-public abstract class ToolBase implements Tool {
-  
-  public Configuration conf;
-
-  public void setConf(Configuration conf) {
-    this.conf = conf;
-  }
-
-  public Configuration getConf() {
-    return conf;
-  }
-     
-  /**
-   * Work as a main program: execute a command and handle exception if any
-   * @param conf Application default configuration
-   * @param args User-specified arguments
-   * @throws Exception
-   * @return exit code to be passed to a caller. General contract is that code
-   * equal zero signifies a normal return, negative values signify errors, and
-   * positive non-zero values can be used to return application-specific codes.
-   */
-  public final int doMain(Configuration conf, String[] args) throws Exception {
-    return ToolRunner.run(conf, this, args);
-  }
-
-}