hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From inigo...@apache.org
Subject [31/50] [abbrv] hadoop git commit: HADOOP-14533. Size of args cannot be less than zero in TraceAdmin#run as its linkedlist. Contributed by Weisen Han.
Date Wed, 21 Jun 2017 23:24:18 GMT
HADOOP-14533. Size of args cannot be less than zero in TraceAdmin#run as its linkedlist. Contributed
by Weisen Han.


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

Branch: refs/heads/HDFS-10467
Commit: 2e9daa2e27536484846d9c5f020c6afaf27932ce
Parents: 099dfe9
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:44:31 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/2e9daa2e/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/2e9daa2e/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 ad20310..5a4d2a3 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