devmadhuu commented on code in PR #6755:
URL: https://github.com/apache/ozone/pull/6755#discussion_r1621824993
##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/admin/nssummary/NSSummaryAdmin.java:
##########
@@ -115,6 +115,11 @@ public boolean isNotValidBucketOrOBSBucket(String path) {
OzoneConfiguration.of(getOzoneConfig()));
try (OzoneClient ozoneClient =
OzoneClientFactory.getRpcClient(getOzoneConfig())) {
ObjectStore objectStore = ozoneClient.getObjectStore();
+ // Return false if path is root, just a volume
Review Comment:
Pls correct and update the comment here as well.
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestNSSummaryAdmin.java:
##########
@@ -115,7 +115,25 @@ public void testNSSummaryCLIRoot() throws
UnsupportedEncodingException {
String path = "/";
executeAdminCommands(path);
// Should throw warning - only buckets can have bucket layout.
Review Comment:
Pls correct the comments.
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestNSSummaryAdmin.java:
##########
@@ -115,7 +115,25 @@ public void testNSSummaryCLIRoot() throws
UnsupportedEncodingException {
String path = "/";
executeAdminCommands(path);
// Should throw warning - only buckets can have bucket layout.
- assertThat(getOutContentString()).contains("[Warning] Namespace CLI is not
designed for OBS bucket layout.");
+ assertThat(getOutContentString()).doesNotContain("INVALID_VOLUME_NAME");
+ assertThat(getOutContentString()).doesNotContain(
+ "[Warning] Namespace CLI is not designed for OBS bucket layout.");
+ assertThat(getOutContentString()).contains("Put more files into it to
visualize DU");
+ assertThat(getOutContentString()).contains("Put more files into it to
visualize file size distribution");
+ }
+
+ /**
+ * Test NSSummaryCLI on volume.
+ */
+ @Test
+ public void testNSSummaryCLIVolume() throws UnsupportedEncodingException {
+ // Running on root path.
Review Comment:
Pls correct the comments. We are running here on /volume
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestNSSummaryAdmin.java:
##########
@@ -115,7 +115,25 @@ public void testNSSummaryCLIRoot() throws
UnsupportedEncodingException {
String path = "/";
executeAdminCommands(path);
// Should throw warning - only buckets can have bucket layout.
- assertThat(getOutContentString()).contains("[Warning] Namespace CLI is not
designed for OBS bucket layout.");
+ assertThat(getOutContentString()).doesNotContain("INVALID_VOLUME_NAME");
+ assertThat(getOutContentString()).doesNotContain(
+ "[Warning] Namespace CLI is not designed for OBS bucket layout.");
+ assertThat(getOutContentString()).contains("Put more files into it to
visualize DU");
+ assertThat(getOutContentString()).contains("Put more files into it to
visualize file size distribution");
+ }
+
+ /**
+ * Test NSSummaryCLI on volume.
+ */
+ @Test
+ public void testNSSummaryCLIVolume() throws UnsupportedEncodingException {
+ // Running on root path.
+ String path = "/" + volumeName;
+ executeAdminCommands(path);
+ // Should throw warning - only buckets can have bucket layout.
+ assertThat(getOutContentString()).doesNotContain("INVALID_BUCKET_NAME");
+ assertThat(getOutContentString()).doesNotContain(
+ "[Warning] Namespace CLI is not designed for OBS bucket layout.");
Review Comment:
Pls correct the source of this message as NSSummary /du supports all types
of buckets now.
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestNSSummaryAdmin.java:
##########
@@ -115,7 +115,25 @@ public void testNSSummaryCLIRoot() throws
UnsupportedEncodingException {
String path = "/";
executeAdminCommands(path);
// Should throw warning - only buckets can have bucket layout.
- assertThat(getOutContentString()).contains("[Warning] Namespace CLI is not
designed for OBS bucket layout.");
+ assertThat(getOutContentString()).doesNotContain("INVALID_VOLUME_NAME");
+ assertThat(getOutContentString()).doesNotContain(
+ "[Warning] Namespace CLI is not designed for OBS bucket layout.");
Review Comment:
Pls correct the source of this message as NSSummary /du supports all types
of buckets now.
--
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]