ArafatKhan2198 commented on code in PR #9705: URL: https://github.com/apache/ozone/pull/9705#discussion_r2845497302
########## hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/pages/capacity/capacity.tsx: ########## Review Comment: Red for `Open Key/File` Bytes and green for Multipart Key Bytes is arbitrary red conventionally signals a warning/error. The unusedSpaceBreakdown uses red for minimum free space (a constraint) which is semantically justified. Here neither value has a warning connotation. Use neutral colours (e.g., blue/orange) ########## hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/types/OpenKeyBytesInfo.java: ########## @@ -0,0 +1,50 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.ozone.recon.api.types; + +/** + * Represents information about the open keys in a storage system. + * This class provides details regarding different types of open key bytes + * and calculates the total size of open key bytes. + */ +public class OpenKeyBytesInfo { + + private long totalOpenKeyBytes; + private long openKeyAndFileBytes; + private long multipartOpenKeyBytes; Review Comment: Missing @JsonProperty on OpenKeyBytesInfo ########## hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/views/datanodes/datanodes.less: ########## @@ -39,6 +39,6 @@ } } -.ant-popover-inner{ +.datanodes-container .ant-popover-inner { Review Comment: What is the use of this change? ########## hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/pages/capacity/capacity.tsx: ########## @@ -259,6 +259,26 @@ const Capacity: React.FC<object> = () => { </span> ); +const openKeyUsageBreakdown = ( + <span> Review Comment: Minor change - openKeyUsageBreakdown is declared at column 0 inside the component body, while unusedSpaceBreakdown and dnSelectorTitle above it use 2-space indentation. Also the closing ); has a trailing space before it (the extra indentation on line 280). ########## hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/types/OpenKeyBytesInfo.java: ########## @@ -0,0 +1,50 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.ozone.recon.api.types; + +/** + * Represents information about the open keys in a storage system. + * This class provides details regarding different types of open key bytes + * and calculates the total size of open key bytes. + */ +public class OpenKeyBytesInfo { + + private long totalOpenKeyBytes; Review Comment: totalOpenKeyBytes is always openKeyAndFileBytes + multipartOpenKeyBytes. No need to store it as a field make `getTotalOpenKeyBytes()` a computed getter. ########## hadoop-ozone/integration-test-recon/src/test/java/org/apache/hadoop/ozone/recon/TestStorageDistributionEndpoint.java: ########## @@ -214,7 +214,9 @@ private boolean verifyStorageDistributionAfterKeyCreation() { assertEquals(20, storageResponse.getGlobalNamespace().getTotalKeys()); assertEquals(60, storageResponse.getGlobalNamespace().getTotalUsedSpace()); - assertEquals(0, storageResponse.getUsedSpaceBreakDown().getOpenKeyBytes()); + assertEquals(0, storageResponse.getUsedSpaceBreakDown().getOpenKeyBytes().getTotalOpenKeyBytes()); + assertEquals(0, storageResponse.getUsedSpaceBreakDown().getOpenKeyBytes().getMultipartOpenKeyBytes()); + assertEquals(0, storageResponse.getUsedSpaceBreakDown().getOpenKeyBytes().getOpenKeyAndFileBytes()); Review Comment: The only test covering this is the integration test which only asserts all-zero values. There's no test that verifies the `openKeyAndFileBytes` and `multipartOpenKeyBytes` are correctly split (e.g., non-zero MPU size is correctly put in multipartOpenKeyBytes and not added to openKeyAndFileBytes). ########## hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/StorageDistributionEndpoint.java: ########## @@ -88,23 +89,23 @@ public Response getStorageDistribution() { try { List<DatanodeStorageReport> nodeStorageReports = collectDatanodeReports(); GlobalStorageReport globalStorageReport = calculateGlobalStorageReport(); + OpenKeyBytesInfo totalOpenKeySize = calculateOpenKeySizes(); Review Comment: The behaviour changed here. Previously, calculateOpenKeySizes() was called inside calculateNamespaceMetrics(), which was wrapped in the inner try-catch with fallback values. Now it's been moved outside so if getOpenKeySummary() or getMPUKeySummary() throw, the exception skips the inner fallback entirely and hits the outer catch, returning a 500 instead of a partial response with zeros. -- 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]
