yandrey321 commented on code in PR #11971:
URL: https://github.com/apache/ozone/pull/11971#discussion_r4566336813
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/AbstractOzoneFileSystemTest.java:
##########
@@ -1859,20 +1860,29 @@ void testOzoneManagerFileSystemInterface() throws
IOException {
}
@Test
- public void testOzoneManagerLocatedFileStatus() throws IOException {
+ public void testOzoneManagerFileBlockLocations() throws IOException {
String data = RandomStringUtils.secure().nextAlphanumeric(20);
String filePath = RandomStringUtils.secure().nextAlphanumeric(5);
Path path = createPath("/" + filePath);
try (FSDataOutputStream stream = fs.create(path)) {
stream.writeBytes(data);
}
+ // like HDFS, getFileStatus has no block locations, getFileBlockLocations
fetches them
FileStatus status = fs.getFileStatus(path);
- LocatedFileStatus locatedFileStatus =
assertInstanceOf(LocatedFileStatus.class, status);
-
assertThat(locatedFileStatus.getBlockLocations().length).isGreaterThanOrEqualTo(1);
-
- for (BlockLocation blockLocation : locatedFileStatus.getBlockLocations()) {
- assertThat(blockLocation.getNames().length).isGreaterThanOrEqualTo(1);
- assertThat(blockLocation.getHosts().length).isGreaterThanOrEqualTo(1);
+ assertFalse(status instanceof LocatedFileStatus);
Review Comment:
fixed
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]