You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "devmadhuu (via GitHub)" <gi...@apache.org> on 2023/09/08 06:18:01 UTC

[GitHub] [ozone] devmadhuu commented on a diff in pull request #5249: HDDS-9212. HeatMap UI doesn't load On Disabling & Enable Recon HeatMap using Feature Flag.

devmadhuu commented on code in PR #5249:
URL: https://github.com/apache/ozone/pull/5249#discussion_r1319411879


##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/AccessHeatMapEndpoint.java:
##########
@@ -88,4 +92,19 @@ public Response getReadAccessMetaData(
     }
     return Response.ok(entityReadAccessHeatMapResponse).build();
   }
+
+  private static void checkIfHeatMapFeatureIsEnabled() {
+    FeatureProvider.Feature heatMapFeature = null;
+    List<FeatureProvider.Feature> allDisabledFeatures =
+        FeatureProvider.getAllDisabledFeatures();
+    for (FeatureProvider.Feature feature : allDisabledFeatures) {
+      if (feature.getFeatureName().equals("HeatMap")) {

Review Comment:
   > nit: to avoid NPE. Constant should be on left side e.g. `"HeatMap".equals(feature.getFeatureName())` or use `Objects.equals()`.
   
   Thanks @hemantk-12  for noticing this, however this line will not hit NPE because if any disabled features are there, then this list will be populated  as Feature enum with non-null feature name, however , yes, as a good practice, we should use Constant on left side. Thank you.



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