You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Tomek Rękawek (JIRA)" <ji...@apache.org> on 2018/03/17 21:40:00 UTC

[jira] [Comment Edited] (OAK-7355) Move the pluggable storage interfaces to the SPI package

    [ https://issues.apache.org/jira/browse/OAK-7355?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16402368#comment-16402368 ] 

Tomek Rękawek edited comment on OAK-7355 at 3/17/18 9:39 PM:
-------------------------------------------------------------

The patch introduces following changes:

*1. New segment.spi.\* packages*

* segment.spi.persistence - for the interfaces introduced in OAK-6921,
* segment.spi.monitor - for the FileMonitor and IOMonitor,

Only these 2 packages are exported now.

*2. Changes in the SegmentArchiveWriter and Reader*

As [~frm] suggested in the comment to OAK-6922, the SegmentArchiveReader doesn't return parsed structures in the getGraph() and getBinaryReferences(), but a raw ByteBuffer.

*3. Index and TarEntry*

The TarEntry has been removed. The SegmentArchiveWriter#writeSegment() doesn't return anything and the #readSegment() uses msb and lsb - now it have the same signature as in the SegmentArchiveReader.

Also, the Index is no longer exposed in the SPI. It's now treated as an implementation detail of the persistence. Since the SegmentArchiveReader must be able to provide a list of segments existing within the archive, it got a new method: listSegments(). It returns a list of SegmentArchiveEntry items, sorted by their position in the archive. The new SegmentArchiveEntry is almost identical to the IndexEntry, but it doesn't expose offset - as the SegmentArchiveReader consumer doesn't need to know it.


was (Author: tomek.rekawek):
The patch introduces following changes:

*1. New segment.spi.\* packages*

* segment.spi.persistence - for the interfaces introduced in OAK-6921,
* segment.spi.monitor - for the FileMonitor and IOMonitor,
* segment.spi.index - for the Index and IndexEntry interfaces (see the explanation below).

Only these 3 packages are exported now.

*2. Changes in the SegmentArchiveWriter and Reader*

As [~frm] suggested in the comment to OAK-6922, the SegmentArchiveReader doesn't return parsed structures in the getGraph() and getBinaryReferences(), but a raw ByteBuffer.

*3. Index and TarEntry*

The case is different for the getIndex(). Since the Index instance may be used internally by the SegmentArchiveReader to find the segment offsets, I assumed it's already parsed once the SegmentArchiveReader is opened. Because of that, the getIndex() still returns a Index object. Maintaining the index is a responsibility of the SegmentArchiveReader/Writer/Manager.

The writeSegment() and getSegment() methods in SegmentArchiveWriter no longer uses TarEntry (which has been removed), but also the IndexEntry. This change also makes the Writer and the Reader interfaces more symmetric - the Index is used in both. The implementations should use the IndexEntries as a way to maintain its internal list of the written and available segments. Also, the writer should persist its index once closed (so it'll be available for the reader later on).

The Index implementation depends on the used persistence. The reference tar-based implementation still uses the raw byte buffer at the end of the tar (and the helper classes). On the other hand, the Azure implementation may use the blob metadata to keep the same information (generation, etc.) with no extra data structures. Therefore, the package segment.tar.file.index doesn't have to be exported.

> Move the pluggable storage interfaces to the SPI package
> --------------------------------------------------------
>
>                 Key: OAK-7355
>                 URL: https://issues.apache.org/jira/browse/OAK-7355
>             Project: Jackrabbit Oak
>          Issue Type: Task
>          Components: segment-tar
>            Reporter: Tomek Rękawek
>            Priority: Major
>             Fix For: 1.9.0, 1.10
>
>
> OAK-6921 introduces a new abstraction layer in the oak-segment-tar, which allows to support storing the segments not only in the tar files, but in any types of persistence, implementing the SegmentArchiveManager.
> The types required to implement a custom SegmentArchiveManager are now spread across many places within the oak-segment-tar. This results in an extensive export list in the OSGi bundle. In order to keep the SegmentNodeStore implementation encapsulated, we should move the new interfaces and all the other required classes into a new {{org.apache.jackrabbit.oak.segment.spi}} package.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)