ChenSammi commented on code in PR #8681:
URL: https://github.com/apache/ozone/pull/8681#discussion_r2207529943
##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmLCRule.java:
##########
@@ -80,8 +92,19 @@ public String getId() {
}
@Nullable
- public String getPrefix() {
- return prefix;
+ public String getEffectivePrefix() {
+ return prefix != null ? prefix :
+ (filter != null && filter.getPrefix() != null) ? filter.getPrefix() :
+ (filter != null && filter.getAndOperator() != null &&
filter.getAndOperator().getPrefix() != null) ?
+ filter.getAndOperator().getPrefix() : null;
+ }
+
+ @Nullable
+ public String getEffectiveCanonicalPrefix() {
+ return canonicalPrefix != null ? canonicalPrefix :
+ (filter != null && filter.getPrefix() != null) ?
filter.getCanonicalPrefix() :
+ (filter != null && filter.getAndOperator() != null &&
filter.getAndOperator().getPrefix() != null) ?
+ filter.getAndOperator().getCanonicalPrefix() : null;
Review Comment:
This is because there are three places that can have prefix.
--
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]