Repository navigation
[CSTACKEX-339] ASUP Upstream review comments #117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -152,6 +152,8 @@ public Cluster getClusterInfo() { | |
| * Sets {@link Cluster#setModel(String)} and {@link Cluster#setPlatformType(String)} from one | ||
| * {@code GET /api/cluster/nodes}. Distinct models are joined with a comma. Platform type is | ||
| * {@code performance}, {@code capacity}, {@code fas}, or {@code composite} when personalities mix. | ||
| * A node that omits {@code is_all_flash_optimized} is left out of the rollup so a partial | ||
| * response is not reported as {@code fas}. | ||
| */ | ||
| private void populateNodeAsupFields(Cluster cluster, String authHeader) { | ||
| try { | ||
|
|
@@ -170,7 +172,10 @@ private void populateNodeAsupFields(Cluster cluster, String authHeader) { | |
| if (node.getModel() != null && !node.getModel().isBlank()) { | ||
| models.add(node.getModel().trim()); | ||
| } | ||
| platformTypes.add(classifyNodePlatformType(node)); | ||
| String platformType = classifyNodePlatformType(node); | ||
| if (platformType != null) { | ||
| platformTypes.add(platformType); | ||
| } | ||
| } | ||
| if (!models.isEmpty()) { | ||
| cluster.setModel(String.join(OntapStorageConstants.COMMA, models)); | ||
|
|
@@ -210,14 +215,17 @@ public String getClusterVersion(Cluster cluster) { | |
| /** | ||
| * Classifies one node: not all-flash → {@code fas}; all-flash + capacity → {@code capacity}; | ||
| * otherwise all-flash (including performance-optimized or classic AFF) → {@code performance}. | ||
| * Returns {@code null} when {@code is_all_flash_optimized} is absent, so unknown hardware is | ||
| * not reported as {@code fas}. | ||
| */ | ||
| private static String classifyNodePlatformType(ClusterNode node) { | ||
| boolean allFlash = Boolean.TRUE.equals(node.getAllFlashOptimized()); | ||
| boolean capacity = Boolean.TRUE.equals(node.getCapacityOptimized()); | ||
| if (!allFlash) { | ||
| if (node.getAllFlashOptimized() == null) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i think this null check is not required as value will always come , also if we want to keep null check , we can keep for node.getCapacityOptimized() also. Harmless code change , can take it as part of any other PR also.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, this value can never be null, it will always be true or false. |
||
| return null; | ||
| } | ||
| if (!node.getAllFlashOptimized()) { | ||
| return OntapStorageConstants.ASUP_PLATFORM_TYPE_FAS; | ||
| } | ||
| if (capacity) { | ||
| if (Boolean.TRUE.equals(node.getCapacityOptimized())) { | ||
| return OntapStorageConstants.ASUP_PLATFORM_TYPE_CAPACITY; | ||
| } | ||
| return OntapStorageConstants.ASUP_PLATFORM_TYPE_PERFORMANCE; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.