[ 
https://issues.apache.org/jira/browse/HADOOP-17021?focusedWorklogId=490983&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-490983
 ]

ASF GitHub Bot logged work on HADOOP-17021:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 25/Sep/20 13:32
            Start Date: 25/Sep/20 13:32
    Worklog Time Spent: 10m 
      Work Description: wojiaodoubao commented on a change in pull request 
#1993:
URL: https://github.com/apache/hadoop/pull/1993#discussion_r494212185



##########
File path: 
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/Concat.java
##########
@@ -0,0 +1,90 @@
+/**
+ * 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.fs.shell;
+
+import com.google.common.annotations.VisibleForTesting;
+import org.apache.hadoop.classification.InterfaceAudience;
+import org.apache.hadoop.classification.InterfaceStability;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.fs.PathIOException;
+
+import java.io.FileNotFoundException;

Review comment:
       done

##########
File path: 
hadoop-common-project/hadoop-common/src/site/markdown/FileSystemShell.md
##########
@@ -824,6 +824,19 @@ Example:
 * `hadoop fs -truncate 55 /user/hadoop/file1 /user/hadoop/file2`
 * `hadoop fs -truncate -w 127 hdfs://nn1.example.com/user/hadoop/file1`
 
+concat
+--------
+
+Usage: `hadoop fs -concat <target file> <source files>`
+
+Concatenate existing source files into the target file. Target file and source
+files should be in the same directory.
+
+Example:
+
+* `hadoop fs -concat /user/hadoop/target-file /user/hadoop/file-0 
/user/hadoop/file-1`
+* `hadoop fs -concat /user/hadoop/target-file /user/hadoop/file-*`

Review comment:
       Oh I see, thanks very much for your explanation ! In the example I want 
to show the user that he can use both the two commands. The results are the 
same. Both will concat target-file+file-0+file-1. Seems it makes the user even 
more confused. So let me just remove the second command.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 490983)
    Time Spent: 3h  (was: 2h 50m)

> Add concat fs command
> ---------------------
>
>                 Key: HADOOP-17021
>                 URL: https://issues.apache.org/jira/browse/HADOOP-17021
>             Project: Hadoop Common
>          Issue Type: Improvement
>            Reporter: Jinglun
>            Assignee: Jinglun
>            Priority: Minor
>              Labels: pull-request-available
>         Attachments: HADOOP-17021.001.patch
>
>          Time Spent: 3h
>  Remaining Estimate: 0h
>
> We should add one concat fs command for ease of use. It concatenates existing 
> source files into the target file using FileSystem.concat().



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to