clintropolis commented on code in PR #19461:
URL: https://github.com/apache/druid/pull/19461#discussion_r3239311029


##########
server/src/main/java/org/apache/druid/client/HttpServerInventoryView.java:
##########
@@ -659,6 +664,24 @@ public CallbackAction apply(SegmentCallback input)
       }
     }
 
+    /**
+     * Builds a {@link PartialLoadProfile} from a load announcement when the 
historical populated the partial-load
+     * fields ({@code fingerprint} + {@code loadedBytes}). Returns null for 
full-load announcements.
+     */
+    @Nullable
+    private static PartialLoadProfile 
partialLoadProfileFor(SegmentChangeRequestLoad loadRequest)
+    {
+      final String fingerprint = loadRequest.getFingerprint();
+      final Long loadedBytes = loadRequest.getLoadedBytes();
+      if (fingerprint == null || loadedBytes == null) {
+        return null;
+      }
+      // The wrapped LoadSpec is on the segment itself when a partial load was 
requested by the coordinator; we don't
+      // duplicate it on the inventory profile; the announcement uses the 
full-fallback factory which carries the
+      // fingerprint and the realized loadedBytes only.
+      return PartialLoadProfile.forFullFallback(fingerprint, loadedBytes);

Review Comment:
   reworked this a bit to make this a bit clearer/cleaner



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