Nicolas Ettlin created OAK-11155:
------------------------------------

             Summary: Allow using a custom segment loading strategy
                 Key: OAK-11155
                 URL: https://issues.apache.org/jira/browse/OAK-11155
             Project: Jackrabbit Oak
          Issue Type: Improvement
          Components: segment-tar
            Reporter: Nicolas Ettlin


Currently, AbstractFileStore loads segments from the tar files by calling its 
package-private readSegmentUncached method. This is too limiting when its user 
needs to customize the segment loading strategy.

Ideally, the user would create a new class that would extend AbstractFileStore 
and overwrite readSegmentUncached. But this is complicated to do because in 
practice, users get their instances through FileStoreBuilder, which always 
instantiates a FileStore the same way.

My proposal is to allow the user of AbstractFileStore to customize the behavior 
of readSegmentUncached by adding a new @FunctionalInterface parameter, 
SegmentLoader. If not set explicitly by the caller, FileStoreBuilder would use 
an implementation of SegmentLoader which behaves the same way as it currently 
does, which makes this change backwards-compatible with existing code.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to