gianm commented on code in PR #18777:
URL: https://github.com/apache/druid/pull/18777#discussion_r2560835198
##########
processing/src/main/java/org/apache/druid/timeline/partition/PartitionHolder.java:
##########
@@ -41,42 +45,44 @@ public static <T extends Overshadowable<T>>
PartitionHolder<T> copyWithOnlyVisib
)
{
return new PartitionHolder<>(
-
OvershadowableManager.copyVisible(partitionHolder.overshadowableManager),
+ partitionHolder.contents.copyVisible(),
partitionHolder.maxMinorVersion
);
}
public static <T extends Overshadowable<T>> PartitionHolder<T>
deepCopy(PartitionHolder<T> partitionHolder)
{
return new PartitionHolder<>(
- OvershadowableManager.deepCopy(partitionHolder.overshadowableManager),
+ partitionHolder.contents.deepCopy(),
partitionHolder.maxMinorVersion
);
}
public PartitionHolder(PartitionChunk<T> initialChunk)
{
- this.overshadowableManager = new OvershadowableManager<>();
add(initialChunk);
}
public PartitionHolder(List<PartitionChunk<T>> initialChunks)
{
- this.overshadowableManager = new OvershadowableManager<>();
for (PartitionChunk<T> chunk : initialChunks) {
add(chunk);
}
}
- protected PartitionHolder(OvershadowableManager<T> overshadowableManager,
short maxMinorVersion)
+ protected PartitionHolder(PartitionHolderContents<T> contents, short
maxMinorVersion)
{
- this.overshadowableManager = overshadowableManager;
+ this.contents = contents;
this.maxMinorVersion = maxMinorVersion;
}
public boolean add(PartitionChunk<T> chunk)
{
- boolean added = overshadowableManager.addChunk(chunk);
+ if (chunk.getObject().getMinorVersion() != 0 && contents instanceof
SimplePartitionHolderContents) {
+ // Swap simple map for an OvershadowableManager when minor versions are
encountered.
+ contents =
OvershadowableManager.fromSimple((SimplePartitionHolderContents<T>) contents);
Review Comment:
I think it'll get logged too much, since timelines are created all the time.
##########
processing/src/main/java/org/apache/druid/timeline/partition/OvershadowableManager.java:
##########
@@ -65,7 +65,7 @@
*
* This class is not thread-safe.
*/
-class OvershadowableManager<T extends Overshadowable<T>>
+class OvershadowableManager<T extends Overshadowable<T>> implements
PartitionHolderContents<T>
Review Comment:
Hmm, rather than rename I added a javadoc.
--
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]