[
https://issues.apache.org/jira/browse/HDFS-8834?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Lei (Eddy) Xu updated HDFS-8834:
--------------------------------
Description:
{{TestReplication#testReplicationWhenBlockCorruption}} assumes DN has one level
of directory:
{code}
File[] listFiles = participatedNodeDirs.listFiles();
{code}
However, HDFS-6482 changed the layout of block directories and used two level
directories, which makes the following code invalidate (not running).
{code}
for (File file : listFiles) {
if (file.getName().startsWith(Block.BLOCK_FILE_PREFIX)
&& !file.getName().endsWith("meta")) {
blockFile = file.getName();
for (File file1 : nonParticipatedNodeDirs) {
file1.mkdirs();
new File(file1, blockFile).createNewFile();
new File(file1, blockFile + "_1000.meta").createNewFile();
}
break;
}
}
{code}
was:
{{TestReplication#testReplicationWhenBlockCorruption}} assumes DN has one level
of directory:
{code}
File[] listFiles = participatedNodeDirs.listFiles();
{code}
However, HDFS-6482 changed the layout of block directories and used two level
directories, which makes the following code invalidate (not running).
{code}
for (File file : listFiles) {
if (file.getName().startsWith(Block.BLOCK_FILE_PREFIX)
&& !file.getName().endsWith("meta")) {
blockFile = file.getName();
for (File file1 : nonParticipatedNodeDirs) {
file1.mkdirs();
new File(file1, blockFile).createNewFile();
new File(file1, blockFile + "_1000.meta").createNewFile();
}
break;
}
}
{code}
> TestReplication#testReplicationWhenBlockCorruption is not valid after
> HDFS-6482
> -------------------------------------------------------------------------------
>
> Key: HDFS-8834
> URL: https://issues.apache.org/jira/browse/HDFS-8834
> Project: Hadoop HDFS
> Issue Type: Test
> Components: datanode
> Affects Versions: 2.7.1
> Reporter: Lei (Eddy) Xu
> Assignee: Lei (Eddy) Xu
> Priority: Minor
> Labels: testing
>
> {{TestReplication#testReplicationWhenBlockCorruption}} assumes DN has one
> level of directory:
> {code}
> File[] listFiles = participatedNodeDirs.listFiles();
> {code}
> However, HDFS-6482 changed the layout of block directories and used two level
> directories, which makes the following code invalidate (not running).
> {code}
> for (File file : listFiles) {
> if (file.getName().startsWith(Block.BLOCK_FILE_PREFIX)
> && !file.getName().endsWith("meta")) {
> blockFile = file.getName();
> for (File file1 : nonParticipatedNodeDirs) {
> file1.mkdirs();
> new File(file1, blockFile).createNewFile();
> new File(file1, blockFile + "_1000.meta").createNewFile();
> }
> break;
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)