[
https://issues.apache.org/jira/browse/HDFS-16716?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17624112#comment-17624112
]
ASF GitHub Bot commented on HDFS-16716:
---------------------------------------
tomscut commented on code in PR #4697:
URL: https://github.com/apache/hadoop/pull/4697#discussion_r1005123080
##########
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDFSShell.java:
##########
@@ -3043,6 +3044,101 @@ public void testAppendToFileBadArgs() throws Exception {
assertThat(res, not(0));
}
+ @Test (timeout = 300000)
+ public void testAppendToFileWithOptionN() throws Exception {
+ final int inputFileLength = 1024 * 1024;
+ File testRoot = new File(TEST_ROOT_DIR, "testAppendToFileWithOptionN");
+ testRoot.mkdirs();
+
+ File file1 = new File(testRoot, "file1");
+ createLocalFileWithRandomData(inputFileLength, file1);
+
+ Configuration conf = new HdfsConfiguration();
+ MiniDFSCluster cluster = new
MiniDFSCluster.Builder(conf).numDataNodes(6).build();
+ cluster.waitActive();
+
+ try {
Review Comment:
Hi @M1eyu2018 , please change the code here and rebase to the latest commit,
as this PR is a bit old. The other changes look good to me.
> Improve appendToFile command: support appending on file with new block
> ----------------------------------------------------------------------
>
> Key: HDFS-16716
> URL: https://issues.apache.org/jira/browse/HDFS-16716
> Project: Hadoop HDFS
> Issue Type: Improvement
> Reporter: guojunhao
> Priority: Minor
> Labels: pull-request-available
> Time Spent: 1h
> Remaining Estimate: 0h
>
> HDFS client DistributedFileSystem#append supports appending to a file with
> optional create flags.
> However, appendToFile command only supports the default create flag APPEND so
> that append on EC file without NEW_BLOCK create flag is not supported.
> Thus, it's necessary to improve appendToFile command by adding option n for
> it. Option n represents that use NEW_BLOCK create flag while appending file.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]