Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,10 @@ private void verifyDirTree(String volumeName, String bucketName,
// verify root path details
FileStatus[] fileStatuses = fileSystem.listStatus(rootDir);
Path p = null;
for (FileStatus fileStatus : fileStatuses) {
// verify the num of peer directories and span directories
p = depthBFS(fileSystem, fileStatuses, span, actualDepth);
int actualSpan = spanCheck(fileSystem, span, p);
assertEquals(span, actualSpan, "Mismatch span in a path");
}
// verify the num of peer directories and span directories
p = depthBFS(fileSystem, fileStatuses, span, actualDepth);
int actualSpan = spanCheck(fileSystem, p);
assertEquals(span, actualSpan, "Mismatch span in a path");
}
}

Expand Down Expand Up @@ -143,14 +141,8 @@ private Path depthBFS(FileSystem fs, FileStatus[] fileStatuses,
* and count the span directories.
*/

private int spanCheck(FileSystem fs, int span, Path p) throws IOException {
private int spanCheck(FileSystem fs, Path p) throws IOException {
int sp = 0;
int depth = 0;
if (span >= 0) {
depth = 0;
} else {
LOG.info("Span value can never be negative");
}
FileStatus[] fileStatuses = fs.listStatus(p);
for (FileStatus fileStatus : fileStatuses) {
if (fileStatus.isDirectory()) {
Expand Down