From 713f094a8e9051d60c6c59926a75d8235104e19e Mon Sep 17 00:00:00 2001 From: Abhishek Pal Date: Fri, 6 Jun 2025 13:08:28 +0530 Subject: [PATCH 1/8] HDDS-13130. Rename all instances of Disk Usage to Namespace usage, change the API to be /usage instead of /du --- .../docs/content/interface/ReconApi.md | 8 ++-- .../static/swagger-resources/recon-api.yaml | 8 ++-- .../hadoop/ozone/recon/ReconConstants.java | 2 +- .../ozone/recon/api/NSSummaryEndpoint.java | 2 +- .../recon/ozone-recon-web/api/routes.json | 38 +++++++++---------- .../src/components/navBar/navBar.tsx | 2 +- .../src/constants/breadcrumbs.constants.tsx | 2 +- .../v2/components/duMetadata/duMetadata.tsx | 2 +- .../src/v2/components/navBar/navBar.tsx | 2 +- .../v2/constants/breadcrumbs.constants.tsx | 2 +- .../src/v2/pages/diskUsage/diskUsage.tsx | 8 ++-- .../src/views/diskUsage/diskUsage.tsx | 10 ++--- 12 files changed, 43 insertions(+), 43 deletions(-) diff --git a/hadoop-hdds/docs/content/interface/ReconApi.md b/hadoop-hdds/docs/content/interface/ReconApi.md index b5b885b403e9..d047ba0a6568 100644 --- a/hadoop-hdds/docs/content/interface/ReconApi.md +++ b/hadoop-hdds/docs/content/interface/ReconApi.md @@ -612,7 +612,7 @@ Example: /api/v1/namespace/summary?path=/volume1/bucket1/dir/nestedDir If any `num` field is `-1`, the path request is not applicable to such an entity type. -### GET /api/v1/namespace/du +### GET /api/v1/namespace/usage **Parameters** @@ -622,17 +622,17 @@ If any `num` field is `-1`, the path request is not applicable to such an entity * files (optional) - A boolean with a default value of `false`. If set to `true`, computes disk usage for keys + A boolean with a default value of `false`. If set to `true`, computes namespace usage for keys under the path. * replica (optional) - A boolean with a default value of `false`. If set to `true`, computes disk usage with replicated + A boolean with a default value of `false`. If set to `true`, computes namespace usage with replicated size of keys. **Returns** -Returns disk usage of all sub-paths under the path. Normalizes `path` fields, returns +Returns the namespace usage of all sub-paths under the path. Normalizes `path` fields, returns total size of keys directly under the path as `sizeDirectKey`, and returns `size`/`sizeWithReplica` in number of bytes. diff --git a/hadoop-hdds/docs/themes/ozonedoc/static/swagger-resources/recon-api.yaml b/hadoop-hdds/docs/themes/ozonedoc/static/swagger-resources/recon-api.yaml index f5209d63c290..3e73bfdddd41 100644 --- a/hadoop-hdds/docs/themes/ozonedoc/static/swagger-resources/recon-api.yaml +++ b/hadoop-hdds/docs/themes/ozonedoc/static/swagger-resources/recon-api.yaml @@ -540,11 +540,11 @@ paths: application/json: schema: $ref: '#/components/schemas/NamespaceMetadataResponse' - /namespace/du: + /namespace/usage: get: tags: - Namespace Metadata - summary: Returns disk usage of all sub-paths under the path. + summary: Returns namespace usage of all sub-paths under the path. operationId: getDiskUsage parameters: - name: path @@ -556,14 +556,14 @@ paths: type: string - name: files in: query - description: This boolean has a default value of false. When set to true, it calculates the disk usage for keys within the specified path and also provides a list of their corresponding sub-paths. + description: This boolean has a default value of false. When set to true, it calculates the namespace usage for keys within the specified path and also provides a list of their corresponding sub-paths. example: true required: false schema: type: boolean - name: replica in: query - description: A boolean with a default value of false. If set to true, computes disk usage with replicated size of keys. + description: A boolean with a default value of false. If set to true, computes namespace usage with replicated size of keys. example: true required: false schema: diff --git a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/ReconConstants.java b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/ReconConstants.java index 00950cfd716b..d1919f4f7b4f 100644 --- a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/ReconConstants.java +++ b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/ReconConstants.java @@ -35,7 +35,7 @@ public final class ReconConstants { // By default, limit the number of results returned /** - * The maximum number of top disk usage records to return in a /du response. + * The maximum number of top disk usage records to return in a /namespace/usage response. */ public static final int DISK_USAGE_TOP_RECORDS_LIMIT = 30; public static final String DEFAULT_OPEN_KEY_INCLUDE_NON_FSO = "false"; diff --git a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/NSSummaryEndpoint.java b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/NSSummaryEndpoint.java index 3a994df8b6c4..1adf521bd679 100644 --- a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/NSSummaryEndpoint.java +++ b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/NSSummaryEndpoint.java @@ -106,7 +106,7 @@ public Response getBasicInfo( * @throws IOException */ @GET - @Path("/du") + @Path("/usage") @SuppressWarnings("methodlength") public Response getDiskUsage(@QueryParam("path") String path, @DefaultValue("false") @QueryParam("files") boolean listFile, diff --git a/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/api/routes.json b/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/api/routes.json index e094f2b6ea19..af586efb3fae 100644 --- a/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/api/routes.json +++ b/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/api/routes.json @@ -3,25 +3,25 @@ "/containers/:id/keys": "/keys", "/utilization/fileCount": "/fileSizeCounts", "/utilization/containerCount": "/containerCount", - "/namespace/du?path=/&files=true&sortSubpaths=true": "/root", - "/namespace/du?path=/vol:id&files=true&sortSubPaths=true": "/volume", - "/namespace/du?path=/vol:id/&files=true&sortSubPaths=true": "/volume", - "/namespace/du?path=/dummyVolume&files=true&sortSubPaths=true": "/volume", - "/namespace/du?path=/vol:id/bucket:id&files=true&sortSubPaths=true": "/bucket", - "/namespace/du?path=/dummyVolume/bucket:id&files=true&sortSubPaths=true": "/bucket", - "/namespace/du?path=/dummyVolume/bucket:id/&files=true&sortSubPaths=true": "/bucket", - "/namespace/du?path=/dummyVolume/dummyBucket&files=true&sortSubPaths=true": "/bucket", - "/namespace/du?path=/vol:id/bucket:id/dir:id*&files=true&sortSubPaths=true": "/dir", - "/namespace/du?path=/dummyVolume/dummyBucket/dir:id&files=true&sortSubPaths=true": "/dir", - "/namespace/du?path=/dummyVolume/dummyBucket/dir:id/&files=true&sortSubPaths=true": "/dir", - "/namespace/du?path=/dummyVolume/dummyBucket/dummyDir&files=true&sortSubPaths=true": "/dir", - "/namespace/du?path=/vol:id/bucket:id/dir:id/key:id*&sortSubPaths=true": "/key", - "/namespace/du?path=/dummyVolume/dummyBucket/dummyDir/key:id*&sortSubPaths=true": "/key", - "/namespace/du?path=/vol:id/bucket:id/key:id*&sortSubPaths=true": "/key", - "/namespace/du?path=/dummyVolume/dummyBucket/key:id*&sortSubPaths=true": "/key", - "/namespace/du?path=/vol1/bucket1/empty&files=true&sortSubPaths=true": "/empty", - "/namespace/du?path=/clunky&files=true&sortSubpaths=true": "/clunky", - "/namespace/du?path=/*&replica=true": "/replica", + "/namespace/usage?path=/&files=true&sortSubpaths=true": "/root", + "/namespace/usage?path=/vol:id&files=true&sortSubPaths=true": "/volume", + "/namespace/usage?path=/vol:id/&files=true&sortSubPaths=true": "/volume", + "/namespace/usage?path=/dummyVolume&files=true&sortSubPaths=true": "/volume", + "/namespace/usage?path=/vol:id/bucket:id&files=true&sortSubPaths=true": "/bucket", + "/namespace/usage?path=/dummyVolume/bucket:id&files=true&sortSubPaths=true": "/bucket", + "/namespace/usage?path=/dummyVolume/bucket:id/&files=true&sortSubPaths=true": "/bucket", + "/namespace/usage?path=/dummyVolume/dummyBucket&files=true&sortSubPaths=true": "/bucket", + "/namespace/usage?path=/vol:id/bucket:id/dir:id*&files=true&sortSubPaths=true": "/dir", + "/namespace/usage?path=/dummyVolume/dummyBucket/dir:id&files=true&sortSubPaths=true": "/dir", + "/namespace/usage?path=/dummyVolume/dummyBucket/dir:id/&files=true&sortSubPaths=true": "/dir", + "/namespace/usage?path=/dummyVolume/dummyBucket/dummyDir&files=true&sortSubPaths=true": "/dir", + "/namespace/usage?path=/vol:id/bucket:id/dir:id/key:id*&sortSubPaths=true": "/key", + "/namespace/usage?path=/dummyVolume/dummyBucket/dummyDir/key:id*&sortSubPaths=true": "/key", + "/namespace/usage?path=/vol:id/bucket:id/key:id*&sortSubPaths=true": "/key", + "/namespace/usage?path=/dummyVolume/dummyBucket/key:id*&sortSubPaths=true": "/key", + "/namespace/usage?path=/vol1/bucket1/empty&files=true&sortSubPaths=true": "/empty", + "/namespace/usage?path=/clunky&files=true&sortSubpaths=true": "/clunky", + "/namespace/usage?path=/*&replica=true": "/replica", "/namespace/summary?path=*": "/metadata", "/namespace/quota?path=*": "/quota", "/task/status": "/taskStatus", diff --git a/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/components/navBar/navBar.tsx b/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/components/navBar/navBar.tsx index 51a6c67f4e65..0957f059d01d 100644 --- a/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/components/navBar/navBar.tsx +++ b/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/components/navBar/navBar.tsx @@ -143,7 +143,7 @@ class NavBar extends React.Component { ), ( }> - Disk Usage + Namespace Usage ), ( diff --git a/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/constants/breadcrumbs.constants.tsx b/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/constants/breadcrumbs.constants.tsx index a9f7a53eda44..3debe0efa2af 100644 --- a/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/constants/breadcrumbs.constants.tsx +++ b/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/constants/breadcrumbs.constants.tsx @@ -29,7 +29,7 @@ export const breadcrumbNameMap: IBreadcrumbNameMap = { '/MissingContainers': 'Missing Containers', '/Containers': 'Containers', '/Insights': 'Insights', - '/DiskUsage': 'Disk Usage', + '/NamespaceUsage': 'Namespace Usage', '/Heatmap': 'Heatmap', '/Om': 'Om' }; diff --git a/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/components/duMetadata/duMetadata.tsx b/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/components/duMetadata/duMetadata.tsx index 609b768aec5f..8f9ca632c109 100644 --- a/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/components/duMetadata/duMetadata.tsx +++ b/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/components/duMetadata/duMetadata.tsx @@ -270,7 +270,7 @@ const DUMetadata: React.FC = ({ // If the entity is a Key then fetch the Key metadata only if (summaryResponse.type === 'KEY') { const { request: metadataRequest, controller: metadataNewController } = AxiosGetHelper( - `/api/v1/namespace/du?path=${path}&replica=true`, + `/api/v1/namespace/usage?path=${path}&replica=true`, keyMetadataSummarySignal.current ); keyMetadataSummarySignal.current = metadataNewController; diff --git a/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/components/navBar/navBar.tsx b/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/components/navBar/navBar.tsx index 1dd1ede48db4..03341fd9cd88 100644 --- a/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/components/navBar/navBar.tsx +++ b/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/components/navBar/navBar.tsx @@ -134,7 +134,7 @@ const NavBar: React.FC = ({ ), ( }> - Disk Usage + Namespace Usage ), ( diff --git a/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/constants/breadcrumbs.constants.tsx b/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/constants/breadcrumbs.constants.tsx index 807a68cc8d25..69e904f3df7b 100644 --- a/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/constants/breadcrumbs.constants.tsx +++ b/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/constants/breadcrumbs.constants.tsx @@ -28,7 +28,7 @@ export const breadcrumbNameMap: BreadcrumbNameMap = { '/Pipelines': 'Pipelines', '/Containers': 'Containers', '/Insights': 'Insights', - '/DiskUsage': 'Disk Usage', + '/NamespaceUsage': 'Namespace Usage', '/Heatmap': 'Heatmap', '/Om': 'OM DB Insights' }; diff --git a/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/pages/diskUsage/diskUsage.tsx b/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/pages/diskUsage/diskUsage.tsx index ee6f8c6c6c50..b826ea469cea 100644 --- a/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/pages/diskUsage/diskUsage.tsx +++ b/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/pages/diskUsage/diskUsage.tsx @@ -63,7 +63,7 @@ const DiskUsage: React.FC<{}> = () => { function loadData(path: string) { setLoading(true); const { request, controller } = AxiosGetHelper( - `/api/v1/namespace/du?path=${path}&files=true&sortSubPaths=true`, + `/api/v1/namespace/usage?path=${path}&files=true&sortSubPaths=true`, cancelPieSignal.current ); cancelPieSignal.current = controller; @@ -101,7 +101,7 @@ const DiskUsage: React.FC<{}> = () => { return ( <>
- Disk Usage + Namespace Usage
= () => { subPaths={duResponse.subPaths} updateHandler={loadData} /> + title="Click to reload Namespace Usage data">