hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vinayakum...@apache.org
Subject [2/2] hadoop git commit: HDFS-9159. [OIV] : return value of the command is not correct if invalid value specified in '-p (processor)' option (Contributed by nijel)
Date Wed, 07 Oct 2015 09:00:41 GMT
HDFS-9159. [OIV] : return value of the command is not correct if invalid value specified in
'-p (processor)' option (Contributed by nijel)

(cherry picked from commit 61b3547c462a4e51d0a31c0a8c8ce210e2d90df8)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/2b6fe907
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/2b6fe907
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/2b6fe907

Branch: refs/heads/branch-2
Commit: 2b6fe90764b5995cd9a34a99330db22be7c0fd36
Parents: 960b19e
Author: Vinayakumar B <vinayakumarb@apache.org>
Authored: Wed Oct 7 14:29:34 2015 +0530
Committer: Vinayakumar B <vinayakumarb@apache.org>
Committed: Wed Oct 7 14:30:07 2015 +0530

----------------------------------------------------------------------
 hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt                 | 3 +++
 .../hdfs/tools/offlineImageViewer/OfflineImageViewerPB.java | 4 ++++
 .../tools/offlineImageViewer/TestOfflineImageViewer.java    | 9 +++++++++
 3 files changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/2b6fe907/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
index 0c1f935..c6fb3b7 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
@@ -1160,6 +1160,9 @@ Release 2.8.0 - UNRELEASED
 
     HDFS-9196. Fix TestWebHdfsContentLength. (Masatake Iwasaki via jing9)
 
+    HDFS-9159. [OIV] : return value of the command is not correct if invalid
+    value specified in "-p (processor)" option (nijel via vinayakumarb)
+
 Release 2.7.2 - UNRELEASED
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/2b6fe907/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/OfflineImageViewerPB.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/OfflineImageViewerPB.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/OfflineImageViewerPB.java
index c9158d9..f15c81f 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/OfflineImageViewerPB.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/OfflineImageViewerPB.java
@@ -182,6 +182,10 @@ public class OfflineImageViewerPB {
             writer.visit(new RandomAccessFile(inputFile, "r"));
           }
           break;
+        default:
+          System.err.println("Invalid processor specified : " + processor);
+          printUsage();
+          return -1;
       }
       return 0;
     } catch (EOFException e) {

http://git-wip-us.apache.org/repos/asf/hadoop/blob/2b6fe907/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/TestOfflineImageViewer.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/TestOfflineImageViewer.java
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/TestOfflineImageViewer.java
index a8d1d54..e1beca5 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/TestOfflineImageViewer.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/TestOfflineImageViewer.java
@@ -341,6 +341,15 @@ public class TestOfflineImageViewer {
         new FileSystemTestHelper().getTestRootDir() + "/delimited.db");
   }
 
+  @Test
+  public void testInvalidProcessorOption() throws Exception {
+    int status =
+        OfflineImageViewerPB.run(new String[] { "-i",
+            originalFsimage.getAbsolutePath(), "-o", "-", "-p", "invalid" });
+    assertTrue("Exit code returned for invalid processor option is incorrect",
+        status != 0);
+  }
+
   private void testPBDelimitedWriter(String db)
       throws IOException, InterruptedException {
     final String DELIMITER = "\t";


Mime
View raw message