You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "ivandika3 (via GitHub)" <gi...@apache.org> on 2024/03/08 08:59:05 UTC
[PR] HDDS-10494. Recon datanode page to support sort by other storage metrics [ozone]
ivandika3 opened a new pull request, #6350:
URL: https://github.com/apache/ozone/pull/6350
## What changes were proposed in this pull request?
Currently in the Datanode page the "Storage Capacity" columns only supports sorting by "storageRemaining". Add an filter option for user to be able to pick other storage metrics.
The options are:
- Storage Remaining (default)
- Storage Used
- Storage Committed
- Storage Total
This patch will reuse the Antd table filter and uses the filter info state to set which storage metric the column will be sorted by. You can refer to https://3x.ant.design/components/table/#components-table-demo-reset-filter for some the implementation (See `filteredInfo` and `onChange`).
This requires some React state management which requires moving the columns definition into the React class.
## What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-10494
## How was this patch tested?
Manual test using `pnpm run dev`.
Screenshot:

--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-10494. Recon datanode page to support sort by other storage metrics [ozone]
Posted by "ivandika3 (via GitHub)" <gi...@apache.org>.
ivandika3 commented on PR #6350:
URL: https://github.com/apache/ozone/pull/6350#issuecomment-2024497523
@devmadhuu Thank you for checking this out again.
Let me try to address this in the future. Was working on it, but had to deal with some other tasks.
@dombizita I will let you know once I think it's ready for the subsequent review.
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-10494. Recon datanode page to support sort by other storage metrics [ozone]
Posted by "devmadhuu (via GitHub)" <gi...@apache.org>.
devmadhuu commented on PR #6350:
URL: https://github.com/apache/ozone/pull/6350#issuecomment-2024454720
@dombizita pls have a relook on this PR.
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-10494. Recon datanode page to support sort by other storage metrics [ozone]
Posted by "ivandika3 (via GitHub)" <gi...@apache.org>.
ivandika3 commented on code in PR #6350:
URL: https://github.com/apache/ozone/pull/6350#discussion_r1519183078
##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/datanodes/datanodes.tsx:
##########
@@ -17,26 +17,27 @@
*/
import React from 'react';
-import {Table, Icon, Tooltip, Popover} from 'antd';
+import {Icon, Popover, Table, Tooltip} from 'antd';
Review Comment:
Thank you for the catch. Seems it's automatically updated by the IDE. I have reverted it.
##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/datanodes/datanodes.tsx:
##########
@@ -17,26 +17,27 @@
*/
import React from 'react';
-import {Table, Icon, Tooltip, Popover} from 'antd';
+import {Icon, Popover, Table, Tooltip} from 'antd';
import {PaginationConfig} from 'antd/lib/pagination';
import moment from 'moment';
import {ReplicationIcon} from 'utils/themeIcons';
import StorageBar from 'components/storageBar/storageBar';
import {
- DatanodeState,
- DatanodeStateList,
DatanodeOpState,
DatanodeOpStateList,
+ DatanodeState,
+ DatanodeStateList,
IStorageReport
} from 'types/datanode.types';
import './datanodes.less';
import {AutoReloadHelper} from 'utils/autoReloadHelper';
import AutoReloadPanel from 'components/autoReloadPanel/autoReloadPanel';
-import {MultiSelect, IOption} from 'components/multiSelect/multiSelect';
+import {IOption, MultiSelect} from 'components/multiSelect/multiSelect';
Review Comment:
Reverted.
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-10494. Recon datanode page to support sort by other storage metrics [ozone]
Posted by "ivandika3 (via GitHub)" <gi...@apache.org>.
ivandika3 commented on code in PR #6350:
URL: https://github.com/apache/ozone/pull/6350#discussion_r1519183194
##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/datanodes/datanodes.tsx:
##########
@@ -17,26 +17,27 @@
*/
import React from 'react';
-import {Table, Icon, Tooltip, Popover} from 'antd';
+import {Icon, Popover, Table, Tooltip} from 'antd';
import {PaginationConfig} from 'antd/lib/pagination';
import moment from 'moment';
import {ReplicationIcon} from 'utils/themeIcons';
import StorageBar from 'components/storageBar/storageBar';
import {
- DatanodeState,
- DatanodeStateList,
DatanodeOpState,
DatanodeOpStateList,
+ DatanodeState,
+ DatanodeStateList,
IStorageReport
} from 'types/datanode.types';
import './datanodes.less';
import {AutoReloadHelper} from 'utils/autoReloadHelper';
import AutoReloadPanel from 'components/autoReloadPanel/autoReloadPanel';
-import {MultiSelect, IOption} from 'components/multiSelect/multiSelect';
+import {IOption, MultiSelect} from 'components/multiSelect/multiSelect';
import {ActionMeta, ValueType} from 'react-select';
-import {showDataFetchError} from 'utils/common';
+import {getCapacityPercent, showDataFetchError} from 'utils/common';
import {ColumnSearch} from 'utils/columnSearch';
-import { AxiosGetHelper } from 'utils/axiosRequestHelper';
+import {AxiosGetHelper} from 'utils/axiosRequestHelper';
Review Comment:
Reverted.
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-10494. Recon datanode page to support sort by other storage metrics [ozone]
Posted by "ivandika3 (via GitHub)" <gi...@apache.org>.
ivandika3 commented on PR #6350:
URL: https://github.com/apache/ozone/pull/6350#issuecomment-2421907177
I'll abandon this for now. Feel free to pick this up if there is a need.
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-10494. Recon datanode page to support sort by other storage metrics [ozone]
Posted by "ivandika3 (via GitHub)" <gi...@apache.org>.
ivandika3 closed pull request #6350: HDDS-10494. Recon datanode page to support sort by other storage metrics
URL: https://github.com/apache/ozone/pull/6350
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-10494. Recon datanode page to support sort by other storage metrics [ozone]
Posted by "devmadhuu (via GitHub)" <gi...@apache.org>.
devmadhuu commented on code in PR #6350:
URL: https://github.com/apache/ozone/pull/6350#discussion_r1519156227
##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/datanodes/datanodes.tsx:
##########
@@ -17,26 +17,27 @@
*/
import React from 'react';
-import {Table, Icon, Tooltip, Popover} from 'antd';
+import {Icon, Popover, Table, Tooltip} from 'antd';
Review Comment:
If no impact in ordering of imports, then kindly don't change this line.
##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/datanodes/datanodes.tsx:
##########
@@ -343,41 +152,298 @@ let cancelSignal: AbortController;
export class Datanodes extends React.Component<Record<string, object>, IDatanodesState> {
autoReload: AutoReloadHelper;
+ columns: ColumnProps<IDatanode>[];
+ defaultColumns: IOption[];
constructor(props = {}) {
super(props);
+ this.columns = [
+ {
+ title: 'Hostname',
+ dataIndex: 'hostname',
+ key: 'hostname',
+ isVisible: true,
+ isSearchable: true,
+ sorter: (a: IDatanode, b: IDatanode) => a.hostname.localeCompare(b.hostname, undefined, {numeric: true}),
+ defaultSortOrder: 'ascend' as const,
+ fixed: 'left'
+ },
+ {
+ title: 'State',
+ dataIndex: 'state',
+ key: 'state',
+ isVisible: true,
+ isSearchable: true,
+ filterMultiple: true,
+ filters: DatanodeStateList && DatanodeStateList.map(state => ({text: state, value: state})),
+ onFilter: (value: DatanodeState, record: IDatanode) => record.state === value,
+ render: (text: DatanodeState) => renderDatanodeState(text),
+ sorter: (a: IDatanode, b: IDatanode) => a.state.localeCompare(b.state)
+ },
+ {
+ title: 'Operational State',
+ dataIndex: 'opState',
+ key: 'opState',
+ isVisible: true,
+ isSearchable: true,
+ filterMultiple: true,
+ filters: DatanodeOpStateList && DatanodeOpStateList.map(state => ({text: state, value: state})),
+ onFilter: (value: DatanodeOpState, record: IDatanode) => record.opState === value,
+ render: (text: DatanodeOpState) => renderDatanodeOpState(text),
+ sorter: (a: IDatanode, b: IDatanode) => a.opState.localeCompare(b.opState)
+ },
+ {
+ title: 'Uuid',
+ dataIndex: 'uuid',
+ key: 'uuid',
+ isVisible: true,
+ isSearchable: true,
+ sorter: (a: IDatanode, b: IDatanode) => a.uuid.localeCompare(b.uuid),
+ defaultSortOrder: 'ascend' as const
+ },
+ {
+ title: 'Storage Capacity',
+ dataIndex: 'storageCapacity',
+ key: 'storageCapacity',
+ isVisible: true,
+ filters: [
+ {
+ text: 'Storage Remaining (default)',
+ value: 'storageRemaining',
+ },
+ {
+ text: 'Storage Used',
+ value: 'storageUsed',
+ },
+ {
+ text: 'Storage Committed',
+ value: 'storageCommitted'
+ },
+ {
+ text: 'Storage Total',
+ value: 'storageTotal',
+ },
+ {
+ text: 'Storage Utilization',
+ value: 'storageUtilization',
+ }
+ ],
+ filterIcon: () => (
+ <Icon type={'sort-ascending'} />
+ ),
+ filterMultiple: false,
+ onFilter: () => {
+ // This filter is only used for placeholder, so return true regardless of the filter
+ return true;
+ },
+ sorter: (a: IDatanode, b: IDatanode) => {
+ let sortBy = "storageRemaining"
+ if (this.state.filteredInfo.storageCapacity &&
Review Comment:
Not clear with this part, whenever user tries to sort, here we are checking storageCapacity column length and has data, and if yes, then we are setting `sortBy=first filter value ` always ? Am i missing something here ?
##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/datanodes/datanodes.tsx:
##########
@@ -17,26 +17,27 @@
*/
import React from 'react';
-import {Table, Icon, Tooltip, Popover} from 'antd';
+import {Icon, Popover, Table, Tooltip} from 'antd';
import {PaginationConfig} from 'antd/lib/pagination';
import moment from 'moment';
import {ReplicationIcon} from 'utils/themeIcons';
import StorageBar from 'components/storageBar/storageBar';
import {
- DatanodeState,
- DatanodeStateList,
DatanodeOpState,
DatanodeOpStateList,
+ DatanodeState,
+ DatanodeStateList,
IStorageReport
} from 'types/datanode.types';
import './datanodes.less';
import {AutoReloadHelper} from 'utils/autoReloadHelper';
import AutoReloadPanel from 'components/autoReloadPanel/autoReloadPanel';
-import {MultiSelect, IOption} from 'components/multiSelect/multiSelect';
+import {IOption, MultiSelect} from 'components/multiSelect/multiSelect';
Review Comment:
Same as above.
##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/datanodes/datanodes.tsx:
##########
@@ -17,26 +17,27 @@
*/
import React from 'react';
-import {Table, Icon, Tooltip, Popover} from 'antd';
+import {Icon, Popover, Table, Tooltip} from 'antd';
import {PaginationConfig} from 'antd/lib/pagination';
import moment from 'moment';
import {ReplicationIcon} from 'utils/themeIcons';
import StorageBar from 'components/storageBar/storageBar';
import {
- DatanodeState,
- DatanodeStateList,
DatanodeOpState,
DatanodeOpStateList,
+ DatanodeState,
Review Comment:
Same comment here, If no impact in ordering of imports, then kindly don't change this line.
##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/datanodes/datanodes.tsx:
##########
@@ -17,26 +17,27 @@
*/
import React from 'react';
-import {Table, Icon, Tooltip, Popover} from 'antd';
+import {Icon, Popover, Table, Tooltip} from 'antd';
import {PaginationConfig} from 'antd/lib/pagination';
import moment from 'moment';
import {ReplicationIcon} from 'utils/themeIcons';
import StorageBar from 'components/storageBar/storageBar';
import {
- DatanodeState,
- DatanodeStateList,
DatanodeOpState,
DatanodeOpStateList,
+ DatanodeState,
+ DatanodeStateList,
IStorageReport
} from 'types/datanode.types';
import './datanodes.less';
import {AutoReloadHelper} from 'utils/autoReloadHelper';
import AutoReloadPanel from 'components/autoReloadPanel/autoReloadPanel';
-import {MultiSelect, IOption} from 'components/multiSelect/multiSelect';
+import {IOption, MultiSelect} from 'components/multiSelect/multiSelect';
import {ActionMeta, ValueType} from 'react-select';
-import {showDataFetchError} from 'utils/common';
+import {getCapacityPercent, showDataFetchError} from 'utils/common';
import {ColumnSearch} from 'utils/columnSearch';
-import { AxiosGetHelper } from 'utils/axiosRequestHelper';
+import {AxiosGetHelper} from 'utils/axiosRequestHelper';
Review Comment:
Same as above, don't see any change.
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-10494. Recon datanode page to support sort by other storage metrics [ozone]
Posted by "smitajoshi12 (via GitHub)" <gi...@apache.org>.
smitajoshi12 commented on PR #6350:
URL: https://github.com/apache/ozone/pull/6350#issuecomment-1988101777
@ivandika3
1) Can you give more brief regarding Mapping Storage Commited ,Storage Commited or How it is computed from Which API values in UI

--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-10494. Recon datanode page to support sort by other storage metrics [ozone]
Posted by "ivandika3 (via GitHub)" <gi...@apache.org>.
ivandika3 commented on code in PR #6350:
URL: https://github.com/apache/ozone/pull/6350#discussion_r1519190323
##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/datanodes/datanodes.tsx:
##########
@@ -343,41 +152,298 @@ let cancelSignal: AbortController;
export class Datanodes extends React.Component<Record<string, object>, IDatanodesState> {
autoReload: AutoReloadHelper;
+ columns: ColumnProps<IDatanode>[];
+ defaultColumns: IOption[];
constructor(props = {}) {
super(props);
+ this.columns = [
+ {
+ title: 'Hostname',
+ dataIndex: 'hostname',
+ key: 'hostname',
+ isVisible: true,
+ isSearchable: true,
+ sorter: (a: IDatanode, b: IDatanode) => a.hostname.localeCompare(b.hostname, undefined, {numeric: true}),
+ defaultSortOrder: 'ascend' as const,
+ fixed: 'left'
+ },
+ {
+ title: 'State',
+ dataIndex: 'state',
+ key: 'state',
+ isVisible: true,
+ isSearchable: true,
+ filterMultiple: true,
+ filters: DatanodeStateList && DatanodeStateList.map(state => ({text: state, value: state})),
+ onFilter: (value: DatanodeState, record: IDatanode) => record.state === value,
+ render: (text: DatanodeState) => renderDatanodeState(text),
+ sorter: (a: IDatanode, b: IDatanode) => a.state.localeCompare(b.state)
+ },
+ {
+ title: 'Operational State',
+ dataIndex: 'opState',
+ key: 'opState',
+ isVisible: true,
+ isSearchable: true,
+ filterMultiple: true,
+ filters: DatanodeOpStateList && DatanodeOpStateList.map(state => ({text: state, value: state})),
+ onFilter: (value: DatanodeOpState, record: IDatanode) => record.opState === value,
+ render: (text: DatanodeOpState) => renderDatanodeOpState(text),
+ sorter: (a: IDatanode, b: IDatanode) => a.opState.localeCompare(b.opState)
+ },
+ {
+ title: 'Uuid',
+ dataIndex: 'uuid',
+ key: 'uuid',
+ isVisible: true,
+ isSearchable: true,
+ sorter: (a: IDatanode, b: IDatanode) => a.uuid.localeCompare(b.uuid),
+ defaultSortOrder: 'ascend' as const
+ },
+ {
+ title: 'Storage Capacity',
+ dataIndex: 'storageCapacity',
+ key: 'storageCapacity',
+ isVisible: true,
+ filters: [
+ {
+ text: 'Storage Remaining (default)',
+ value: 'storageRemaining',
+ },
+ {
+ text: 'Storage Used',
+ value: 'storageUsed',
+ },
+ {
+ text: 'Storage Committed',
+ value: 'storageCommitted'
+ },
+ {
+ text: 'Storage Total',
+ value: 'storageTotal',
+ },
+ {
+ text: 'Storage Utilization',
+ value: 'storageUtilization',
+ }
+ ],
+ filterIcon: () => (
+ <Icon type={'sort-ascending'} />
+ ),
+ filterMultiple: false,
+ onFilter: () => {
+ // This filter is only used for placeholder, so return true regardless of the filter
+ return true;
+ },
+ sorter: (a: IDatanode, b: IDatanode) => {
+ let sortBy = "storageRemaining"
+ if (this.state.filteredInfo.storageCapacity &&
Review Comment:
Thank you for the review.
> here we are checking storageCapacity column length and has data, and if yes, then we are setting sortBy=first filter value always ?
From the AntD table API documentation (https://3x.ant.design/components/table/#API).
<img width="1026" alt="image" src="https://github.com/apache/ozone/assets/36403683/d9510c7c-165f-4211-9637-705ee90862a7">
The filter value has a type `string[]` and therefore the filtered info has the type `Partial<Record<string, string[]>>` (in `IDatanodeState`).
So when we change the filter value, the filtered info would be something like
Storage remaining
```
{
"storageCapacity": ["storageRemaining"]
}
```
Storage Used
```
{
"storageCapacity": ["storageUsed"]
}
```
The reason why the filter only contains 1 element is that `filterMultiple` for the 'Storage Capacity' column is set to `false`. If it's set to true, user can pick more than one filter and the array will be larger than 1.
Therefore, since at any point of time, at most one filter value can be picked, we can pick the first value of the array after doing the nullity check and length check. If the filter is not picked yet, we will pick the default storage metric (in this case `storageRemaining`)
Hopefully this clarifies.
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-10494. Recon datanode page to support sort by other storage metrics [ozone]
Posted by "ivandika3 (via GitHub)" <gi...@apache.org>.
ivandika3 commented on PR #6350:
URL: https://github.com/apache/ozone/pull/6350#issuecomment-1985320667
@devabhishekpal @devmadhuu @dombizita @smitajoshi12 @ArafatKhan2198 Could you help review when you have time
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-10494. Recon datanode page to support sort by other storage metrics [ozone]
Posted by "ivandika3 (via GitHub)" <gi...@apache.org>.
ivandika3 commented on PR #6350:
URL: https://github.com/apache/ozone/pull/6350#issuecomment-1990911395
@smitajoshi12 Thank you for the review
> 1. Can you give more brief regarding Mapping Storage Commited ,Storage Commited or How it is computed from Which API values in UI or may be in some tooltip
The "Storage Committed" was introduced recently in https://github.com/apache/ozone/pull/5721. Our cluster has not backported this patch, but I put this in this patch just for completeness sake.
Reading the implementation, seems that committed bytes is used to represent unused bytes for a container. For example, if there is 1GB written in a 5GB container, the committed bytes would be 5GB - 1GB = 4GB. @vtutrinov @xichen01 maybe you can confirm.
Seems in https://github.com/apache/ozone/pull/5721, only the tooltip is updated, but `Progress` component is not updated. Perhaps we can add the "storage committed" in the `Progress` component in future patch.
> 2. Can you check with actual cluster data
Fix some incorrect calculation and tested against our internal cluster.
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-10494. Recon datanode page to support sort by other storage metrics [ozone]
Posted by "ivandika3 (via GitHub)" <gi...@apache.org>.
ivandika3 commented on code in PR #6350:
URL: https://github.com/apache/ozone/pull/6350#discussion_r1519190323
##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/datanodes/datanodes.tsx:
##########
@@ -343,41 +152,298 @@ let cancelSignal: AbortController;
export class Datanodes extends React.Component<Record<string, object>, IDatanodesState> {
autoReload: AutoReloadHelper;
+ columns: ColumnProps<IDatanode>[];
+ defaultColumns: IOption[];
constructor(props = {}) {
super(props);
+ this.columns = [
+ {
+ title: 'Hostname',
+ dataIndex: 'hostname',
+ key: 'hostname',
+ isVisible: true,
+ isSearchable: true,
+ sorter: (a: IDatanode, b: IDatanode) => a.hostname.localeCompare(b.hostname, undefined, {numeric: true}),
+ defaultSortOrder: 'ascend' as const,
+ fixed: 'left'
+ },
+ {
+ title: 'State',
+ dataIndex: 'state',
+ key: 'state',
+ isVisible: true,
+ isSearchable: true,
+ filterMultiple: true,
+ filters: DatanodeStateList && DatanodeStateList.map(state => ({text: state, value: state})),
+ onFilter: (value: DatanodeState, record: IDatanode) => record.state === value,
+ render: (text: DatanodeState) => renderDatanodeState(text),
+ sorter: (a: IDatanode, b: IDatanode) => a.state.localeCompare(b.state)
+ },
+ {
+ title: 'Operational State',
+ dataIndex: 'opState',
+ key: 'opState',
+ isVisible: true,
+ isSearchable: true,
+ filterMultiple: true,
+ filters: DatanodeOpStateList && DatanodeOpStateList.map(state => ({text: state, value: state})),
+ onFilter: (value: DatanodeOpState, record: IDatanode) => record.opState === value,
+ render: (text: DatanodeOpState) => renderDatanodeOpState(text),
+ sorter: (a: IDatanode, b: IDatanode) => a.opState.localeCompare(b.opState)
+ },
+ {
+ title: 'Uuid',
+ dataIndex: 'uuid',
+ key: 'uuid',
+ isVisible: true,
+ isSearchable: true,
+ sorter: (a: IDatanode, b: IDatanode) => a.uuid.localeCompare(b.uuid),
+ defaultSortOrder: 'ascend' as const
+ },
+ {
+ title: 'Storage Capacity',
+ dataIndex: 'storageCapacity',
+ key: 'storageCapacity',
+ isVisible: true,
+ filters: [
+ {
+ text: 'Storage Remaining (default)',
+ value: 'storageRemaining',
+ },
+ {
+ text: 'Storage Used',
+ value: 'storageUsed',
+ },
+ {
+ text: 'Storage Committed',
+ value: 'storageCommitted'
+ },
+ {
+ text: 'Storage Total',
+ value: 'storageTotal',
+ },
+ {
+ text: 'Storage Utilization',
+ value: 'storageUtilization',
+ }
+ ],
+ filterIcon: () => (
+ <Icon type={'sort-ascending'} />
+ ),
+ filterMultiple: false,
+ onFilter: () => {
+ // This filter is only used for placeholder, so return true regardless of the filter
+ return true;
+ },
+ sorter: (a: IDatanode, b: IDatanode) => {
+ let sortBy = "storageRemaining"
+ if (this.state.filteredInfo.storageCapacity &&
Review Comment:
Thank you for the review.
> here we are checking storageCapacity column length and has data, and if yes, then we are setting sortBy=first filter value always ?
From the AntD table API documentation (https://3x.ant.design/components/table/#API).
<img width="1026" alt="image" src="https://github.com/apache/ozone/assets/36403683/d9510c7c-165f-4211-9637-705ee90862a7">
The filter value has a type `string[]` and therefore the filtered info has the type `Partial<Record<string, string[]>>` (in `IDatanodeState`).
So when we change the filter value, the filtered info would be something like
Storage remaining
```
{
"storageCapacity": ["storageRemaining"]
}
```
Storage Used
```
{
"storageCapacity": ["storageUsed"]
}
The reason why the filter only contains 1 element is that `filterMultiple` for the 'Storage Capacity' column is set to `false`. If it's set to true, user can pick more than one filter and the array will be larger than 1.
Therefore, since at any point of time, at most one filter value can be picked, we can pick the first value of the array after doing the nullity check and length check. If the filter is not picked yet, we will pick the default storage metric (in this case `storageRemaining`)
Hopefully this clarifies.
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-10494. Recon datanode page to support sort by other storage metrics [ozone]
Posted by "ivandika3 (via GitHub)" <gi...@apache.org>.
ivandika3 commented on code in PR #6350:
URL: https://github.com/apache/ozone/pull/6350#discussion_r1519201958
##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/datanodes/datanodes.tsx:
##########
@@ -17,26 +17,27 @@
*/
import React from 'react';
-import {Table, Icon, Tooltip, Popover} from 'antd';
+import {Icon, Popover, Table, Tooltip} from 'antd';
import {PaginationConfig} from 'antd/lib/pagination';
import moment from 'moment';
import {ReplicationIcon} from 'utils/themeIcons';
import StorageBar from 'components/storageBar/storageBar';
import {
- DatanodeState,
- DatanodeStateList,
DatanodeOpState,
DatanodeOpStateList,
+ DatanodeState,
Review Comment:
Reverted.
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org