You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-dev@jackrabbit.apache.org by Marc Pfaff <pf...@adobe.com> on 2014/05/19 11:59:51 UTC

NodeStore and BlobStore configurations in OSGi

Hi all

I try to understand how the different 'store' API' s and implementations
are working together, in order  to understand the different repository
configuration options. Browsing thought the code I think i understand most
of it, but have some questions left, mainly related to the BlobStore API.

* I try to find out about the default BlobStore implementations used for
SegmentNodeStore and DocumentNodeStore. For SegmentNodeStore my research
ends up in FileBlobStore and for the DocumentNodeStore it appears to be
the MongoBlobStore. Is that correct?

BlobStore API in an OSGi deployment:

* I was only able to find the FileBlobStoreService that registers the
FileBlobStore as an OSGi service. I was not able to find more BlobStore
implementations to be exposed in OSGi. Are there any more? And how about
the MongoBlobStore in particular?

* The SegmentNodeStoreService uses the registered BlobStore service, and
as so far only the FileBlobStore is exposed as a service, it uses the
FileBlobStore. But the reference to the BlobStore service is
OPTIONAL_UNARY. How is the right blob store selected if multiple blob
store services are registered?

* The DocumentNodeStoreService references the  same blob store service as
the SegmentNodeStoreService. As I'm not able to find the MongoBlobStore
exposed as service, does that mean the DocumentNodeStore uses the
FileBlobStore?

* Both, the SegmentNodeStoreService and the DocumentNodeStoreService
appear to check for 'custom blob store' property but both components do
not expose such a property? And how would they select from a specific
BlobStore service?

Kind regards

Marc

--

Marc Pfaff | Developer | Adobe Research (Schweiz) AG | www.adobe.com |
pfaffm@adobe.com 








Re: NodeStore and BlobStore configurations in OSGi

Posted by Chetan Mehrotra <ch...@gmail.com>.
On Mon, May 19, 2014 at 8:10 PM, Marc Pfaff <pf...@adobe.com> wrote:
> SegmentNodeStore.getBlob() does not seem to be used
> when reading binaries through JCR

Yes when reading via JCR the read is handled via Blob itself i.e.
SegmentBlob in this case. A SegmentBlob gets created when the JCR
property access -> SegmentNodeState.getProperty ->
SegmentPropertyState.getValue ->
SegmentPropertyState#getValue(Segment, RecordId, Type<T>)

>>Here there is an assumption that system has only one BlobStore
>>registered with OSGi Service Registry. If multiple BlobStore services
>>are registered then you can possibly specify a specific one by
>>configuring the 'blobStore.target' to the required OSGi service filter
>>(DS 112.6 of OSGi Compedium)
> Assuming same is true for NodeStore services.

Did not get the query?

btw I have update the docs at [1] (update should reflect on github in
couple of hours)

Chetan Mehrotra
[1] https://github.com/apache/jackrabbit-oak/blob/trunk/oak-doc/src/site/markdown/blobstore.md

Re: NodeStore and BlobStore configurations in OSGi

Posted by Marc Pfaff <pf...@adobe.com>.
Hi Chetan

Thanks a lot for the details.

On 5/19/14 1:05 PM, "Chetan Mehrotra" <ch...@gmail.com> wrote:

>On Mon, May 19, 2014 at 3:29 PM, Marc Pfaff <pf...@adobe.com> wrote:
>> For SegmentNodeStore my research
>> ends up in FileBlobStore and for the DocumentNodeStore it appears to be
>> the MongoBlobStore. Is that correct?
>
>SegementNodeStore does not uses BlobStore by default. Instead all the
>binary content is stored as part of segment data itself.
Ok, I see. I think can follow this when writing binaries using
SegmentNodeStore.createBlob(). But from looking at
SegmentNodeStore.getBlob(), I would expect it to fail if no blob store is
set. And apparently, SegmentNodeStore.getBlob() does not seem to be used
when reading binaries through JCR. I don't know how that works, need to
have a closer look first.

>Sofollowing
>points can be noted for BlobStore
>
>1. SegmentNodeStore does not require BlobStore by default
>2. DocumentNodeStore uses MongoBlobStore by default
>3. Both can be configured to use a BlobStore via OSGi config
>
>>* I was only able to find the FileBlobStoreService that registers the
>> FileBlobStore as an OSGi service. I was not able to find more BlobStore
>> implementations to be exposed in OSGi. Are there any more? And how about
>> the MongoBlobStore in particular?
>
>MongoBlobStore is not configured as an explicit service instead is
>used as the default fallback option if no other BlobStore is
>configured. As it just requires Mongo connection detail, it is
>currently configured along with MongoDocumentStore in
>DocumentNodeStore
Ok understand, makes sense.

>
>There is AbstractDataStoreService which wraps JR2 DataStore as
>BlobStore and configures and registers them with OSGi. it currently
>support FileDataStore and S3DataStore.
>
>Note that FileDataStore is currently preferred over FileBlobStore
Ok. I see that FileDataStore is as well exposed as BlobStore service using
the DataStoreBlobStore wrapper.

>
>> The DocumentNodeStoreService references the  same blob store service as
>> the SegmentNodeStoreService. As I'm not able to find the MongoBlobStore
>> exposed as service, does that mean the DocumentNodeStore uses the
>> FileBlobStore
>
>No. The MongoBlobStore is configured implicitly in
>org.apache.jackrabbit.oak.plugins.document.DocumentMK.Builder#setMongoDB(c
>om.mongodb.DB,
>int). So unless a BlobStore is explicitly configured DocumentNodeStore
>would use MongoBlobStore.
>
>> Both, the SegmentNodeStoreService and the DocumentNodeStoreService
>> appear to check for 'custom blob store' property but both components do
>> not expose such a property? And how would they select from a specific
>> BlobStore service?
>
>Here there is an assumption that system has only one BlobStore
>registered with OSGi Service Registry. If multiple BlobStore services
>are registered then you can possibly specify a specific one by
>configuring the 'blobStore.target' to the required OSGi service filter
>(DS 112.6 of OSGi Compedium)
Assuming same is true for NodeStore services.

Thanks a lot. 

Regards
Marc

>
>Chetan Mehrotra


Re: NodeStore and BlobStore configurations in OSGi

Posted by Chetan Mehrotra <ch...@gmail.com>.
On Mon, May 19, 2014 at 3:29 PM, Marc Pfaff <pf...@adobe.com> wrote:
> For SegmentNodeStore my research
> ends up in FileBlobStore and for the DocumentNodeStore it appears to be
> the MongoBlobStore. Is that correct?

SegementNodeStore does not uses BlobStore by default. Instead all the
binary content is stored as part of segment data itself. Sofollowing
points can be noted for BlobStore

1. SegmentNodeStore does not require BlobStore by default
2. DocumentNodeStore uses MongoBlobStore by default
3. Both can be configured to use a BlobStore via OSGi config

>* I was only able to find the FileBlobStoreService that registers the
> FileBlobStore as an OSGi service. I was not able to find more BlobStore
> implementations to be exposed in OSGi. Are there any more? And how about
> the MongoBlobStore in particular?

MongoBlobStore is not configured as an explicit service instead is
used as the default fallback option if no other BlobStore is
configured. As it just requires Mongo connection detail, it is
currently configured along with MongoDocumentStore in
DocumentNodeStore

There is AbstractDataStoreService which wraps JR2 DataStore as
BlobStore and configures and registers them with OSGi. it currently
support FileDataStore and S3DataStore.

Note that FileDataStore is currently preferred over FileBlobStore

> The DocumentNodeStoreService references the  same blob store service as
> the SegmentNodeStoreService. As I'm not able to find the MongoBlobStore
> exposed as service, does that mean the DocumentNodeStore uses the
> FileBlobStore

No. The MongoBlobStore is configured implicitly in
org.apache.jackrabbit.oak.plugins.document.DocumentMK.Builder#setMongoDB(com.mongodb.DB,
int). So unless a BlobStore is explicitly configured DocumentNodeStore
would use MongoBlobStore.

> Both, the SegmentNodeStoreService and the DocumentNodeStoreService
> appear to check for 'custom blob store' property but both components do
> not expose such a property? And how would they select from a specific
> BlobStore service?

Here there is an assumption that system has only one BlobStore
registered with OSGi Service Registry. If multiple BlobStore services
are registered then you can possibly specify a specific one by
configuring the 'blobStore.target' to the required OSGi service filter
(DS 112.6 of OSGi Compedium)

Chetan Mehrotra