Hi Tomek,

Thanks for the pointer on using a factory - I’m looking into that now.

It is still unclear to me how this works in terms of configuration files,
and how this would work for the CompositeDataStore.  This is how I believe
it would work for two FileDataStores in the composite:

FDS config 1:

path=datastore/ds1
role=local1


FDS config 2:

path=datastore/ds2
role=local2


CompositeDataStore config:

local1:readOnly=false
local2:readOnly=true


Something like that anyway.

My questions then are:  How do we store both FileDataStore configuration
files when both have the same PID?  What is the file name for each one?
And how to do they associate with the FileDataStoreFactory?

Thanks

-MR

On October 23, 2017 at 1:44:57 AM, Tomek Rekawek ([email protected])
wrote:

Hi Matt,

> On 20 Oct 2017, at 23:02, Matt Ryan <[email protected]> wrote:
>
> I think I basically understand all of this, except I don’t know how you
go
> about configuring two file data stores. What would that look like in
> practice? Normally if I were going to configure a FileDataStore I would
> create a configuration file with the pid
> “org.apache.jackrabbit.oak.plugins.blob.datastore.FileDataStore”. So it
is
> unclear to me how I would go about configuring more than one of these.
>
> This is important because being able to have more than one of the same
type
> of data store in the composite is a requirement IMO.

Yes, it’ll need implementing the FileDataStoreFactory - an OSGi type that
allows creating multiple service instances with different configurations
[1].

It was similar with the composite node store - we had to implement the
SegmentNodeStoreFactory [2], to create multiple SegmentMK in different
locations.

Regards,
Tomek

[1]
https://cqdump.wordpress.com/2014/08/05/managing-multiple-instances-of-services-osgi-service-factories/
[2]
https://github.com/apache/jackrabbit-oak/blob/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/SegmentNodeStoreFactory.java

-- 
Tomek Rękawek | Adobe Research | www.adobe.com
[email protected]

Reply via email to