gianm commented on code in PR #18777:
URL: https://github.com/apache/druid/pull/18777#discussion_r2562155972


##########
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 so, since timelines are created and populated as part of various 
operations. It would get logged semi-randomly and perhaps too frequently.



-- 
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]

Reply via email to