clintropolis commented on a change in pull request #7547: Add support minor compaction with segment locking URL: https://github.com/apache/incubator-druid/pull/7547#discussion_r306654550
########## File path: core/src/main/java/org/apache/druid/timeline/Overshadowable.java ########## @@ -0,0 +1,78 @@ +/* + * 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.druid.timeline; + +/** + * Interface to represent a class which can have overshadow relation between its instances. + * In {@link VersionedIntervalTimeline}, Overshadowable is used to represent each {@link DataSegment} + * which has the same major version in the same time chunk. + * + * An Overshadowable overshadows another if its root partition range contains that of another + * and has a higher minorVersion. For more details, check https://github.com/apache/incubator-druid/issues/7491. + */ +public interface Overshadowable<T extends Overshadowable> +{ + /** + * Returns true if this segment overshadows the other segment. + */ + default boolean isOvershadow(T other) Review comment: I think the purpose of this method would be clearer if it was called something like `overshadows` or `doesOvershadow` or `willOvershadow`. It reads with the intention `x.overshadows(y)` of `x.willOvershadow(y)` is very clear that it's a check if y will be overshadowed by x. I think `isOvershadow` it too close to `x is overshadowed by y`, which is why I keep having to check the javadoc to remember which one is the overshadowed segment, and will also help it standout/distinguish it from the timeline `isOvershadowed` method. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
