Fixed a checkstyle and few review comments

This commit is contained in:
Uma Maheswara Rao G 2020-06-19 10:55:31 -07:00
parent 2c55c9a5cf
commit 2d2ec00ca3
4 changed files with 17 additions and 16 deletions

View File

@ -1116,7 +1116,7 @@ public class ViewFileSystem extends FileSystem {
final long creationTime; // of the the mount table
final UserGroupInformation ugi; // the user/group of user who created mtable
final URI myUri;
final boolean showMountLinksAsSymlinks;
private final boolean showMountLinksAsSymlinks;
public InternalDirOfViewFs(final InodeTree.INodeDir<FileSystem> dir,
final long cTime, final UserGroupInformation ugi, URI uri,
@ -1262,10 +1262,10 @@ public class ViewFileSystem extends FileSystem {
throw ex;
}
} else {
result[i++] = new FileStatus(0, true, 0, 0,
creationTime, creationTime, PERMISSION_555,
ugi.getShortUserName(), ugi.getPrimaryGroupName(),
path);
result[i++] =
new FileStatus(0, true, 0, 0, creationTime, creationTime,
PERMISSION_555, ugi.getShortUserName(),
ugi.getPrimaryGroupName(), path);
}
}
if (fallbackStatuses.length > 0) {

View File

@ -1056,11 +1056,10 @@ public class ViewFs extends AbstractFileSystem {
throw ex;
}
} else {
result[i++] = new FileStatus(0, true, 0, 0,
creationTime, creationTime,
PERMISSION_555, ugi.getShortUserName(), ugi.getGroupNames()[0],
new Path(inode.fullPath).makeQualified(
myUri, null));
result[i++] =
new FileStatus(0, true, 0, 0, creationTime, creationTime,
PERMISSION_555, ugi.getShortUserName(),
ugi.getGroupNames()[0], path);
}
}
if (fallbackStatuses.length > 0) {

View File

@ -47,12 +47,14 @@ public class TestViewFsOverloadSchemeListStatus {
private static final File TEST_DIR =
GenericTestUtils.getTestDir(TestViewfsFileStatus.class.getSimpleName());
@Before public void setUp() {
@Before
public void setUp() {
FileUtil.fullyDelete(TEST_DIR);
assertTrue(TEST_DIR.mkdirs());
}
@After public void tearDown() throws IOException {
@After
public void tearDown() throws IOException {
FileUtil.fullyDelete(TEST_DIR);
}
@ -112,11 +114,11 @@ public class TestViewFsOverloadSchemeListStatus {
if (status.getPath().getName().equals(fileScheme)) {
assertEquals(FsPermission.valueOf("-rwxr--r--"),
status.getPermission());
assertEquals(false, status.isDirectory());
assertFalse(status.isDirectory());
} else {
assertEquals(FsPermission.valueOf("-r--rwxr--"),
status.getPermission());
assertEquals(true, status.isDirectory());
assertTrue(status.isDirectory());
}
}
}

View File

@ -148,11 +148,11 @@ public class TestViewfsFileStatus {
if (status.getPath().getName().equals("file")) {
assertEquals(FsPermission.valueOf("-rwxr--r--"),
status.getPermission());
assertEquals(false, status.isDirectory());
assertFalse(status.isDirectory());
} else {
assertEquals(FsPermission.valueOf("-r--rwxr--"),
status.getPermission());
assertEquals(true, status.isDirectory());
assertTrue(status.isDirectory());
}
}
}