dombizita commented on code in PR #6411:
URL: https://github.com/apache/ozone/pull/6411#discussion_r1632970627
##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/datanodes/datanodes.tsx:
##########
@@ -470,7 +517,28 @@ export class Datanodes extends
React.Component<Record<string, object>, IDatanode
</div>
<div className='content-div'>
+ {totalCount > 0 &&
+ <div style={{ marginBottom: 16 }}>
+ <Popconfirm
+ disabled={!hasSelected}
+ placement="topLeft"
+ title={`Are you sure you want Recon to stop tracking these
selected ${selectedRowKeys.length} datanodes ?`}
+ icon={
+ <Icon type='question-circle-o' style={{ color: 'red' }} />
+ }
+ onConfirm={this.popConfirm}
+ >
+ <Tooltip placement="topLeft" title="Remove and stop tracking
the DECOMMISSIONED, IN_MAINTENANCE, and DEAD nodes.">
Review Comment:
```suggestion
<Tooltip placement="topLeft" title="Remove the dead or
decommissioned or in maintenance datanodes.">
```
##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/datanodes/datanodes.tsx:
##########
@@ -436,8 +453,38 @@ export class Datanodes extends
React.Component<Record<string, object>, IDatanode
console.log(current, pageSize);
};
+ onSelectChange = (newSelectedRowKeys:any) => {
+ this.setState({
+ selectedRowKeys: newSelectedRowKeys
+ });
+ };
+
+ onDisable = (record:any) => {
+ //Enable Record for Remove whos state is Dead or operation state
Decommissioned or In Maintenance
+ if (record.state !== 'DEAD') {
+ return record.opState === 'IN_SERVICE' || record.opState ===
'ENTERING_MAINTENANCE' || record.opState === 'DECOMMISSIONING';
+ }
Review Comment:
This isn't doing what the comments says. Based on the comment you'd like to
enable the datanode deletion if either its state is dead or its operational
state is decommissioned or in maintenance.
The code checks if it's dead and it only later checks based on the
operational state. E.g. if a datanode is not dead, but in maintenance it won't
let it to be removed, but based on the comment and the PR description it should
act differently.
I'm not 100% sure what states can a decommissioned or in maintenance
operational stated datanode can be in, but I'd go with a steady solution and
check for all three conditions on the same level.
##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/datanodes/datanodes.tsx:
##########
@@ -470,7 +517,28 @@ export class Datanodes extends
React.Component<Record<string, object>, IDatanode
</div>
<div className='content-div'>
+ {totalCount > 0 &&
+ <div style={{ marginBottom: 16 }}>
+ <Popconfirm
+ disabled={!hasSelected}
+ placement="topLeft"
+ title={`Are you sure you want Recon to stop tracking these
selected ${selectedRowKeys.length} datanodes ?`}
Review Comment:
```suggestion
title={`Are you sure you want Recon to stop tracking the
selected ${selectedRowKeys.length} datanodes?`}
```
--
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]