hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bra...@apache.org
Subject [3/3] hadoop git commit: HADOOP-14533. Size of args cannot be less than zero in TraceAdmin#run as its linkedlist. Contributed by Weisen Han.
Date Tue, 20 Jun 2017 12:50:49 GMT
HADOOP-14533. Size of args cannot be less than zero in TraceAdmin#run as its linkedlist. Contributed
by Weisen Han.

(cherry picked from commit 2e9daa2e27536484846d9c5f020c6afaf27932ce)


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

Branch: refs/heads/branch-2.8
Commit: a526c3b0bfe42e340a21ea06d36f52a1c6231abd
Parents: f16524e
Author: Brahma Reddy Battula <brahma@apache.org>
Authored: Tue Jun 20 20:44:31 2017 +0800
Committer: Brahma Reddy Battula <brahma@apache.org>
Committed: Tue Jun 20 20:46:21 2017 +0800

----------------------------------------------------------------------
 .../src/main/java/org/apache/hadoop/tracing/TraceAdmin.java  | 2 +-
 .../test/java/org/apache/hadoop/tracing/TestTraceAdmin.java  | 8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/a526c3b0/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/tracing/TraceAdmin.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/tracing/TraceAdmin.java
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/tracing/TraceAdmin.java
index 038435c..766fb0a 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/tracing/TraceAdmin.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/tracing/TraceAdmin.java
@@ -166,7 +166,7 @@ public class TraceAdmin extends Configured implements Tool {
       System.err.println("You must specify a host with -host.");
       return 1;
     }
-    if (args.size() < 0) {
+    if (args.isEmpty()) {
       System.err.println("You must specify an operation.");
       return 1;
     }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/a526c3b0/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/tracing/TestTraceAdmin.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/tracing/TestTraceAdmin.java
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/tracing/TestTraceAdmin.java
index d6d0550..ee9494b 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/tracing/TestTraceAdmin.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/tracing/TestTraceAdmin.java
@@ -78,6 +78,14 @@ public class TestTraceAdmin extends SaslDataTransferTestCase {
   }
 
   @Test
+  public void testNoOperator() throws Exception {
+    TraceAdmin trace = new TraceAdmin();
+    trace.setConf(new Configuration());
+    Assert.assertEquals("ret:1, You must specify an operation." + NEWLINE,
+        runTraceCommand(trace, "-host", "127.0.0.1:12346"));
+  }
+
+  @Test
   public void testCreateAndDestroySpanReceiver() throws Exception {
     Configuration conf = new Configuration();
     conf = new Configuration();


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message