Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions hadoop-hdds/docs/content/interface/ReconApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**

Expand All @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions hadoop-hdds/docs/content/interface/ReconApi.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ Recon API v1 是一组 HTTP 端点,可以帮助您了解 Ozone 集群的当前

如果任何 `num` 字段为 `-1`,则该路径请求不适用于该实体类型。

### GET /api/v1/namespace/du
### GET /api/v1/namespace/usage

**参数**

Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -573,7 +573,7 @@ paths:
description: |
Successful operation<br>
#### **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**.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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\"
Wait For Summary ${FILE_SIZE_DIST_URL}?path=/ \"dist\"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whats the change here ? Pls don't commit any changes with spaces.

Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class NavBar extends React.Component<INavBarProps> {
), (
<Menu.Item key='/DiskUsage'
icon={<PieChartOutlined />}>
<span>Disk Usage</span>
<span>Namespace Usage</span>
<Link to='/DiskUsage' />
</Menu.Item>
), (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
};
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ const DUMetadata: React.FC<MetadataProps> = ({
// 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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ const NavBar: React.FC<NavBarProps> = ({
), (
<Menu.Item key='/DiskUsage'
icon={<PieChartOutlined />}>
<span>Disk Usage</span>
<span>Namespace Usage</span>
<Link to='/DiskUsage' />
</Menu.Item>
), (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
};
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -101,7 +101,7 @@ const DiskUsage: React.FC<{}> = () => {
return (
<>
<div className='page-header-v2'>
Disk Usage
Namespace Usage
</div>
<div className='data-container'>
<Alert
Expand All @@ -123,7 +123,7 @@ const DiskUsage: React.FC<{}> = () => {
subPaths={duResponse.subPaths}
updateHandler={loadData} />
<Tooltip
title="Click to reload Disk Usage data">
title="Click to reload Namespace Usage data">
<Button
type='primary'
icon={<ReloadOutlined />}
Expand Down Expand Up @@ -154,4 +154,4 @@ const DiskUsage: React.FC<{}> = () => {
);
}

export default DiskUsage;
export default DiskUsage;
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export class DiskUsage extends React.Component<Record<string, object>, IDUState>
this.setState({
isLoading: true
});
const duEndpoint = `/api/v1/namespace/du?path=${path}&files=true&sortSubPaths=true`;
const duEndpoint = `/api/v1/namespace/usage?path=${path}&files=true&sortSubPaths=true`;
const { request, controller } = AxiosGetHelper(duEndpoint, cancelPieSignal)
cancelPieSignal = controller;
request.then(response => {
Expand Down Expand Up @@ -323,7 +323,7 @@ export class DiskUsage extends React.Component<Record<string, object>, IDUState>

if (summaryResponse.status !== 'INITIALIZING' && summaryResponse.status !== 'PATH_NOT_FOUND') {
if (summaryResponse.type === 'KEY') {
const keyEndpoint = `/api/v1/namespace/du?path=${path}&replica=true`;
const keyEndpoint = `/api/v1/namespace/usage?path=${path}&replica=true`;
const { request: metadataRequest, controller: metadataNewController } = AxiosGetHelper(keyEndpoint, cancelKeyMetadataSignal);
cancelKeyMetadataSignal = metadataNewController;
metadataRequest.then(response => {
Expand Down Expand Up @@ -572,7 +572,7 @@ export class DiskUsage extends React.Component<Record<string, object>, IDUState>

const eChartsOptions = {
title: {
text: `Disk Usage for ${returnPath} (Total Size: ${byteToSize(duResponse.size, 1)})`,
text: `Namespace Usage for ${returnPath} (Total Size: ${byteToSize(duResponse.size, 1)})`,
left: 'center'
},
tooltip: {
Expand Down Expand Up @@ -613,7 +613,7 @@ export class DiskUsage extends React.Component<Record<string, object>, IDUState>
return (
<div className='du-container'>
<div className='page-header'>
Disk Usage
Namespace Usage
</div>
<div className='content-div'>
{isLoading ? <span><LoadingOutlined /> Loading...</span> : (
Expand Down Expand Up @@ -683,7 +683,7 @@ export class DiskUsage extends React.Component<Record<string, object>, IDUState>
</div>
:
<div style={{ height: 800 }} className='metadatainformation'><br />
This object is empty. Add files to it to see a visualization on disk usage.{' '}<br />
This object is empty. Add files to it to see a visualization on namespace usage.{' '}<br />
You can also view its metadata details by clicking the top right button.
</div>}
<DetailPanel path={returnPath} keys={panelKeys} values={panelValues} visible={showPanel} />
Expand Down
Loading