diff --git a/hadoop-hdds/docs/content/interface/ReconApi.md b/hadoop-hdds/docs/content/interface/ReconApi.md index b5b885b403e9..e2df65d168b6 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,23 +622,23 @@ 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. `status` is `OK` if path exists, `PATH_NOT_FOUND` otherwise. -Example: /api/v1/namespace/du?path=/vol1/bucket1&files=true&replica=true +Example: /api/v1/namespace/usage?path=/vol1/bucket1&files=true&replica=true ```json { "status": OK, diff --git a/hadoop-hdds/docs/content/interface/ReconApi.zh.md b/hadoop-hdds/docs/content/interface/ReconApi.zh.md index 586fef16b2ff..85358d587598 100644 --- a/hadoop-hdds/docs/content/interface/ReconApi.zh.md +++ b/hadoop-hdds/docs/content/interface/ReconApi.zh.md @@ -582,7 +582,7 @@ Recon API v1 是一组 HTTP 端点,可以帮助您了解 Ozone 集群的当前 如果任何 `num` 字段为 `-1`,则该路径请求不适用于该实体类型。 -### GET /api/v1/namespace/du +### GET /api/v1/namespace/usage **参数** @@ -605,7 +605,7 @@ Recon API v1 是一组 HTTP 端点,可以帮助您了解 Ozone 集群的当前 如果路径存在,则 `status` 为 `OK`,否则为 `PATH_NOT_FOUND`。 -示例: /api/v1/namespace/du?path=/vol1/bucket1&files=true&replica=true +示例: /api/v1/namespace/usage?path=/vol1/bucket1&files=true&replica=true ```json { "status": OK, 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..964efb87affd 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: @@ -573,7 +573,7 @@ paths: description: | Successful operation
#### **Note**: - #### The below example response is for the sample endpoint: **namespace/du?path=/vol1/bucket1&files=true&replica=true** + #### The below example response is for the sample endpoint: **namespace/usage?path=/vol1/bucket1&files=true&replica=true** #### status can be either **OK** if path exists else **PATH_NOT_FOUND** #### If files is set to **false**, sub-path **/vol1/bucket1/key1-1 is omitted**. #### If replica is set to **false**, **sizeWithReplica returns -1**. diff --git a/hadoop-ozone/cli-admin/src/main/java/org/apache/hadoop/ozone/admin/nssummary/DiskUsageSubCommand.java b/hadoop-ozone/cli-admin/src/main/java/org/apache/hadoop/ozone/admin/nssummary/DiskUsageSubCommand.java index 6b85576b1e1c..1c4039be18e1 100644 --- a/hadoop-ozone/cli-admin/src/main/java/org/apache/hadoop/ozone/admin/nssummary/DiskUsageSubCommand.java +++ b/hadoop-ozone/cli-admin/src/main/java/org/apache/hadoop/ozone/admin/nssummary/DiskUsageSubCommand.java @@ -73,7 +73,7 @@ public class DiskUsageSubCommand implements Callable { @CommandLine.Mixin private PrefixFilterOption prefixFilter; - private static final String ENDPOINT = "/api/v1/namespace/du"; + private static final String ENDPOINT = "/api/v1/namespace/usage"; // For text alignment private static final String SIZE_HEADER = "Size"; diff --git a/hadoop-ozone/dist/src/main/smoketest/recon/recon-nssummary.robot b/hadoop-ozone/dist/src/main/smoketest/recon/recon-nssummary.robot index 86ca25e219ff..41dc28ae93f4 100644 --- a/hadoop-ozone/dist/src/main/smoketest/recon/recon-nssummary.robot +++ b/hadoop-ozone/dist/src/main/smoketest/recon/recon-nssummary.robot @@ -26,7 +26,7 @@ ${ENDPOINT_URL} http://recon:9888 ${API_ENDPOINT_URL} ${ENDPOINT_URL}/api/v1 ${ADMIN_NAMESPACE_URL} ${API_ENDPOINT_URL}/namespace ${SUMMARY_URL} ${ADMIN_NAMESPACE_URL}/summary -${DISK_USAGE_URL} ${ADMIN_NAMESPACE_URL}/du +${DISK_USAGE_URL} ${ADMIN_NAMESPACE_URL}/usage ${QUOTA_USAGE_URL} ${ADMIN_NAMESPACE_URL}/quota ${FILE_SIZE_DIST_URL} ${ADMIN_NAMESPACE_URL}/dist ${BUCKET_LAYOUT} FILE_SYSTEM_OPTIMIZED @@ -145,4 +145,4 @@ Check Recon Namespace Bucket Quota Usage Wait For Summary ${QUOTA_USAGE_URL}?path=/${VOLUME}/${BUCKET} \"used\" Check Recon Namespace File Size Distribution Root - Wait For Summary ${FILE_SIZE_DIST_URL}?path=/ \"dist\" \ No newline at end of file + Wait For Summary ${FILE_SIZE_DIST_URL}?path=/ \"dist\" 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">