[26/50] hadoop git commit: HDFS-8242. Erasure Coding: XML based end-to-end test for ECCli commands (Contributed by Rakesh R)
HDFS-8242. Erasure Coding: XML based end-to-end test for ECCli commands (Contributed by Rakesh R) Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/f76d0d66 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/f76d0d66 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/f76d0d66 Branch: refs/heads/HDFS-7285 Commit: f76d0d668c91f7fa923561c2d22d958d8e809034 Parents: 6fea26e Author: Vinayakumar B vinayakum...@apache.org Authored: Tue May 5 11:54:30 2015 +0530 Committer: Jing Zhao ji...@apache.org Committed: Mon May 18 22:11:08 2015 -0700 -- .../hadoop-hdfs/CHANGES-HDFS-EC-7285.txt| 3 + .../hdfs/tools/erasurecode/ECCommand.java | 9 +- .../hadoop/cli/CLITestCmdErasureCoding.java | 38 +++ .../apache/hadoop/cli/TestErasureCodingCLI.java | 114 +++ .../cli/util/CLICommandErasureCodingCli.java| 21 ++ .../cli/util/ErasureCodingCliCmdExecutor.java | 37 ++ .../test/resources/testErasureCodingConf.xml| 342 +++ 7 files changed, 561 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hadoop/blob/f76d0d66/hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-EC-7285.txt -- diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-EC-7285.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-EC-7285.txt index faec023..ef760fc 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-EC-7285.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-EC-7285.txt @@ -166,3 +166,6 @@ (jing9) HDFS-8137. Send the EC schema to DataNode via EC encoding/recovering command(umamahesh) + +HDFS-8242. Erasure Coding: XML based end-to-end test for ECCli commands +(Rakesh R via vinayakumarb) http://git-wip-us.apache.org/repos/asf/hadoop/blob/f76d0d66/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/erasurecode/ECCommand.java -- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/erasurecode/ECCommand.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/erasurecode/ECCommand.java index 84c2275..802a46d 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/erasurecode/ECCommand.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/erasurecode/ECCommand.java @@ -17,7 +17,9 @@ package org.apache.hadoop.hdfs.tools.erasurecode; import java.io.IOException; +import java.util.ArrayList; import java.util.LinkedList; +import java.util.List; import org.apache.hadoop.HadoopIllegalArgumentException; import org.apache.hadoop.classification.InterfaceAudience; @@ -120,11 +122,12 @@ public abstract class ECCommand extends Command { sb.append(Schema '); sb.append(schemaName); sb.append(' does not match any of the supported schemas.); -sb.append(Please select any one of [); +sb.append( Please select any one of ); +ListString schemaNames = new ArrayListString(); for (ECSchema ecSchema : ecSchemas) { - sb.append(ecSchema.getSchemaName()); - sb.append(, ); + schemaNames.add(ecSchema.getSchemaName()); } +sb.append(schemaNames); throw new HadoopIllegalArgumentException(sb.toString()); } } http://git-wip-us.apache.org/repos/asf/hadoop/blob/f76d0d66/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/cli/CLITestCmdErasureCoding.java -- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/cli/CLITestCmdErasureCoding.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/cli/CLITestCmdErasureCoding.java new file mode 100644 index 000..6c06a8d --- /dev/null +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/cli/CLITestCmdErasureCoding.java @@ -0,0 +1,38 @@ +/** + * 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 + * p/ + * http://www.apache.org/licenses/LICENSE-2.0 + * p/ + * 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
[26/50] hadoop git commit: HDFS-8242. Erasure Coding: XML based end-to-end test for ECCli commands (Contributed by Rakesh R)
HDFS-8242. Erasure Coding: XML based end-to-end test for ECCli commands (Contributed by Rakesh R) Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/9004be1a Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/9004be1a Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/9004be1a Branch: refs/heads/HDFS-7285 Commit: 9004be1a29e99ec583f55612ce88b25ac6127f90 Parents: 0c8de16 Author: Vinayakumar B vinayakum...@apache.org Authored: Tue May 5 11:54:30 2015 +0530 Committer: Jing Zhao ji...@apache.org Committed: Sat May 16 15:16:05 2015 -0700 -- .../hadoop-hdfs/CHANGES-HDFS-EC-7285.txt| 3 + .../hdfs/tools/erasurecode/ECCommand.java | 9 +- .../hadoop/cli/CLITestCmdErasureCoding.java | 38 +++ .../apache/hadoop/cli/TestErasureCodingCLI.java | 114 +++ .../cli/util/CLICommandErasureCodingCli.java| 21 ++ .../cli/util/ErasureCodingCliCmdExecutor.java | 37 ++ .../test/resources/testErasureCodingConf.xml| 342 +++ 7 files changed, 561 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hadoop/blob/9004be1a/hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-EC-7285.txt -- diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-EC-7285.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-EC-7285.txt index faec023..ef760fc 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-EC-7285.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-EC-7285.txt @@ -166,3 +166,6 @@ (jing9) HDFS-8137. Send the EC schema to DataNode via EC encoding/recovering command(umamahesh) + +HDFS-8242. Erasure Coding: XML based end-to-end test for ECCli commands +(Rakesh R via vinayakumarb) http://git-wip-us.apache.org/repos/asf/hadoop/blob/9004be1a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/erasurecode/ECCommand.java -- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/erasurecode/ECCommand.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/erasurecode/ECCommand.java index 84c2275..802a46d 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/erasurecode/ECCommand.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/erasurecode/ECCommand.java @@ -17,7 +17,9 @@ package org.apache.hadoop.hdfs.tools.erasurecode; import java.io.IOException; +import java.util.ArrayList; import java.util.LinkedList; +import java.util.List; import org.apache.hadoop.HadoopIllegalArgumentException; import org.apache.hadoop.classification.InterfaceAudience; @@ -120,11 +122,12 @@ public abstract class ECCommand extends Command { sb.append(Schema '); sb.append(schemaName); sb.append(' does not match any of the supported schemas.); -sb.append(Please select any one of [); +sb.append( Please select any one of ); +ListString schemaNames = new ArrayListString(); for (ECSchema ecSchema : ecSchemas) { - sb.append(ecSchema.getSchemaName()); - sb.append(, ); + schemaNames.add(ecSchema.getSchemaName()); } +sb.append(schemaNames); throw new HadoopIllegalArgumentException(sb.toString()); } } http://git-wip-us.apache.org/repos/asf/hadoop/blob/9004be1a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/cli/CLITestCmdErasureCoding.java -- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/cli/CLITestCmdErasureCoding.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/cli/CLITestCmdErasureCoding.java new file mode 100644 index 000..6c06a8d --- /dev/null +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/cli/CLITestCmdErasureCoding.java @@ -0,0 +1,38 @@ +/** + * 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 + * p/ + * http://www.apache.org/licenses/LICENSE-2.0 + * p/ + * 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