HDDS-16037. Support Storage Tier per pipeline in Ozone Admin Datanode List Command - #11066
HDDS-16037. Support Storage Tier per pipeline in Ozone Admin Datanode List Command#11066anuragp010 wants to merge 1 commit into
Conversation
| } | ||
|
|
||
| @ParameterizedTest | ||
| @EnumSource(value = StorageTier.class, names = {"EMPTY"}, mode = EnumSource.Mode.EXCLUDE) |
There was a problem hiding this comment.
Why exclude EMPTY? EMPTY.getTierName() is "EMPTY", so an EMPTY-tier pipeline prints /[EMPTY] (not /[] like null). If that value is reachable, is /[EMPTY] the intended output or should it render like null? Either way, worth covering it rather than excluding.
There was a problem hiding this comment.
@rich7420 , thanks for taking a look !
I initially left StorageTier.EMPTY out of testRelatedPipelineShowsStorageTier because it shouldn't be reachable on the client side. Specifically because:
- Pipeline creation prevents it (
RatisPipelineProviderandSimplePipelineProvideruseStorageTierUtil.validateNotEmpty). - Serialization would fail (
listPipelinescallingpipeline.getProtobufMessage()inStorageContainerLocationProtocolServerSideTranslatorPBtriggersStorageTier.toProto(), which throws anIllegalStateExceptionforEMPTY).
Given that it's an unreachable state, do you think it's still worth adding handling and a test case for EMPTY?
There was a problem hiding this comment.
Agreed — EMPTY isn't reachable as a pipeline tier (providers validate non-EMPTY or set null on create, and fromProto only yields SSD/DISK/ARCHIVE), so excluding it is correct. The reachable case, null, is already covered by testRelatedPipelineOmitsTierWhenNull. Nothing to change here.
|
@anuragp010 thanks for the patch! |
What changes were proposed in this pull request?
The command
ozone admin datanode listincludes all the pipelines a given node is part of. But, the supportedstorageTierof every pipeline is not displayed. This PR adds the supportedstorageTierwhen printing related pipelines.What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-16037
How was this patch tested?
Generated using Cursor