dombizita commented on code in PR #6198:
URL: https://github.com/apache/ozone/pull/6198#discussion_r1489411455


##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/datanodes/datanodes.tsx:
##########
@@ -192,21 +192,36 @@ const COLUMNS = [
     key: 'pipelines',
     isVisible: true,
     render: (pipelines: IPipeline[], record: IDatanode) => {
+      let firstThreePipelinesIDs = [];
+      let remainingPipelinesIDs: any[] = [];
+      firstThreePipelinesIDs = pipelines && pipelines.filter((element, index) 
=> index < 3);
+      remainingPipelinesIDs = pipelines && pipelines.slice(3, 
pipelines.length);
+
+      const RenderPipelineIds = ({ pipelinesIds }) => {
+        return pipelinesIds && pipelinesIds.map((pipeline: any, index: any) => 
(
+          <div key={index} className='pipeline-container'>
+            <ReplicationIcon
+              replicationFactor={pipeline.replicationFactor}
+              replicationType={pipeline.replicationType}
+              leaderNode={pipeline.leaderNode}
+              isLeader={pipeline.leaderNode === record.hostname} />
+            {pipeline.pipelineID}
+          </div >
+        ))
+      }
+
       return (
-        <div>
+        <>
           {
-            pipelines && pipelines.map((pipeline, index) => (
-              <div key={index} className='pipeline-container'>
-                <ReplicationIcon
-                  replicationFactor={pipeline.replicationFactor}
-                  replicationType={pipeline.replicationType}
-                  leaderNode={pipeline.leaderNode}
-                  isLeader={pipeline.leaderNode === record.hostname}/>
-                {pipeline.pipelineID}
-              </div>
-            ))
+            <RenderPipelineIds pipelinesIds={firstThreePipelinesIDs} />
           }
-        </div>
+          {
+            remainingPipelinesIDs.length > 1 &&

Review Comment:
   This is incorrect, if a datanode would have 4 pipelines, which means there 
will be 1 remaining pipeline, it will only show the first 3 pipelines and miss 
the last one. I also tested it in a cluster:
   
   <img width="3007" alt="datanode" 
src="https://github.com/apache/ozone/assets/50611074/fb8b9b49-27df-41c6-9cbb-2921db782c03";>
   
   Could you look into this @smitajoshi12?
   
   ```suggestion
               remainingPipelinesIDs.length > 0 &&
   ```



-- 
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]

Reply via email to