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 Marco Piovesana <pi...@esteco.com> on 2017/10/05 13:51:20 UTC

start oak with file system storage

Hi all,
I'm using Oak 1.6.1 with a file system storage (no migration from a
previous version of the data). I think I kinda got lost between the options
available to create the repository. I'm currently using a FileBlobStore
with the following configuration:

File repositoryFolder = new File(repositoryRoot, "repository");
File dataStoreFolder = new File(repositoryRoot, "datastore");

BlobStore blobStore = new FileBlobStore(dataStoreFolder.getAbsolutePath());
FileStore repositoryFileStore =
FileStoreBuilder.fileStoreBuilder(repositoryFolder).withBlobStore(blobStore).build();
SegmentNodeStore segmentNodeStore =
SegmentNodeStoreBuilders.builder(repositoryFileStore).build();
Jcr jcr = new Jcr(segmentNodeStore)
        .with(new InitialContent());

I was wondering if this configuration is the suggested one or there is a
better one (for example using a DataStoreBlobStore).


Marco.

Re: start oak with file system storage

Posted by Marco Piovesana <pi...@esteco.com>.
Hi Matt,
thanks for the reply. Something like this right?

File repositoryRootFolder = new File(directory, "oakrepo");
File repositoryFile = new File(repositoryRootFolder, "repository");
File dataStoreFile = new File(repositoryRootFolder, "datastore");
FileDataStore fileDataStore = new FileDataStore();
fileDataStore.init(dataStoreFile.getAbsolutePath());
DataStoreBlobStore dataStoreBlobStore = new DataStoreBlobStore(fileDataStore);
FileStore fileStore =
FileStoreBuilder.fileStoreBuilder(repositoryFile).withBlobStore(dataStoreBlobStore).build();
NodeStore nodeStore = SegmentNodeStoreBuilders.builder(fileStore).build();
Jcr jcr = new Jcr(nodeStore).with(new InitialContent()).with(new
SecurityProviderImpl());
Repository repository = jcr.createRepository();

I just have one more question. If I have a repository already created using
the FileBlobStore, do I have to migrate it to be able to use it with this
new configuration?

Marco.

On Thu, Oct 5, 2017 at 5:31 PM, Matt Ryan <os...@mvryan.org> wrote:

> Hi Marco,
>
> I’d probably use data store classes instead (e.g. FileDataStore) and wrap
> them inside DataStoreBlobStore.
>
> -MR
>
>
> On October 5, 2017 at 7:51:58 AM, Marco Piovesana (piovesana@esteco.com)
> wrote:
>
> Hi all,
> I'm using Oak 1.6.1 with a file system storage (no migration from a
> previous version of the data). I think I kinda got lost between the options
> available to create the repository. I'm currently using a FileBlobStore
> with the following configuration:
>
> File repositoryFolder = new File(repositoryRoot, "repository");
> File dataStoreFolder = new File(repositoryRoot, "datastore");
>
> BlobStore blobStore = new FileBlobStore(dataStoreFolder.
> getAbsolutePath());
> FileStore repositoryFileStore =
> FileStoreBuilder.fileStoreBuilder(repositoryFolder).
> withBlobStore(blobStore).build();
>
> SegmentNodeStore segmentNodeStore =
> SegmentNodeStoreBuilders.builder(repositoryFileStore).build();
> Jcr jcr = new Jcr(segmentNodeStore)
> .with(new InitialContent());
>
> I was wondering if this configuration is the suggested one or there is a
> better one (for example using a DataStoreBlobStore).
>
>
> Marco.
>

Re: start oak with file system storage

Posted by Matt Ryan <os...@mvryan.org>.
Hi Marco,

I’d probably use data store classes instead (e.g. FileDataStore) and wrap
them inside DataStoreBlobStore.

-MR


On October 5, 2017 at 7:51:58 AM, Marco Piovesana (piovesana@esteco.com)
wrote:

Hi all,
I'm using Oak 1.6.1 with a file system storage (no migration from a
previous version of the data). I think I kinda got lost between the options
available to create the repository. I'm currently using a FileBlobStore
with the following configuration:

File repositoryFolder = new File(repositoryRoot, "repository");
File dataStoreFolder = new File(repositoryRoot, "datastore");

BlobStore blobStore = new FileBlobStore(dataStoreFolder.getAbsolutePath());
FileStore repositoryFileStore =
FileStoreBuilder.fileStoreBuilder(repositoryFolder).withBlobStore(blobStore).build();

SegmentNodeStore segmentNodeStore =
SegmentNodeStoreBuilders.builder(repositoryFileStore).build();
Jcr jcr = new Jcr(segmentNodeStore)
.with(new InitialContent());

I was wondering if this configuration is the suggested one or there is a
better one (for example using a DataStoreBlobStore).


Marco.