clintropolis commented on code in PR #18176:
URL: https://github.com/apache/druid/pull/18176#discussion_r2261086430
##########
processing/src/main/java/org/apache/druid/segment/SegmentMapFunction.java:
##########
@@ -23,24 +23,22 @@
import java.util.function.Function;
/**
- * Functional interface that captures the process of acquiring a {@link
Segment} from a
- * {@link ReferenceCountedObjectProvider<Segment>} and performing any
transformations done on top of this leaf {@link Segment}
- * before it is available to query processing engines.
+ * Functional interface that captures the process of transforming a {@link
Segment} to another {@link Segment} if
+ * possible.
* <p>
- * The {@link Segment} returned by this method, if present, must always be
closed to return the reference to the base
- * {@link ReferenceCountedObjectProvider<Segment>} that it came from.
+ * The {@link Segment} returned by this method, if present, must always be
closed by the caller.
*/
@FunctionalInterface
-public interface SegmentMapFunction extends
Function<ReferenceCountedObjectProvider<Segment>, Optional<Segment>>
+public interface SegmentMapFunction extends Function<Optional<Segment>,
Optional<Segment>>
Review Comment:
right now at the lowest level the input is
`ReferenceCountedSegmentProvider.acquireReference()` which spits out a
`Optional<Segment>`, so i found it a little easier to compose stuff with
segment map functions with it being symmetrical like this. Other stuff like
joins can also possibly not return a segment if like they cannot acquire
references on their joinables.
I'm not sure if there would ever be a use case for doing something if the
input is missing.
--
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]