ChlineSaurus commented on code in PR #2903:
URL: https://github.com/apache/jackrabbit-oak/pull/2903#discussion_r3256960473
##########
oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/SegmentId.java:
##########
@@ -86,12 +88,17 @@ public static boolean isDataSegmentId(long lsb) {
/**
* Create a new segment id with access tracking.
- * @param store store this is belongs to
- * @param msb most significant bits of this id
- * @param lsb least significant bits of this id
- * @param onAccess callback called whenever an underlying and locally
memoised segment is accessed.
+ *
+ * @param store store this id belongs to
+ * @param msb most significant bits of this id
+ * @param lsb least significant bits of this id
+ * @param onAccess callback invoked whenever the locally memoised segment
is accessed
+ * ({@link #getSegment()}); receives {@code this} (e.g. to
notify {@link SegmentCache}).
+ * <p><strong>API note (Oak 2.1, OAK-12214):</strong> this
parameter type changed from
+ * {@link Runnable} to {@link java.util.function.Consumer
Consumer}{@code <SegmentId>} for
+ * L1-to-L2 propagation; downstream code that constructed
ids with a {@code Runnable} must be updated.
*/
- public SegmentId(@NotNull SegmentStore store, long msb, long lsb, @NotNull
Runnable onAccess) {
+ public SegmentId(@NotNull SegmentStore store, long msb, long lsb, @NotNull
Consumer<SegmentId> onAccess) {
Review Comment:
Not backwards compatible public function.
##########
oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/SegmentCache.java:
##########
Review Comment:
Also flagged, but not related to this PR: calling putSegment twice for the
same id might over-counts stats.currentWeight.
--
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]