Currently oak-run (and to some extent oak-upgrade) both instantiate
Repository (or NodeStore) instance outside of OSGi env. So far some
level of customizations are supported.

Looking for some guidance on how to support bit more complex
configuration like using different DataStore and providing config to
those DataStore?

Current way of configuring custom BlobStore relies on system
properties to achieve the same. As part of OAK-1502 I need to refactor
the way the BlobStores are configured. I would like to configure them
via OSGi configuration and use SCR annotation for the same

With such a change supporting oak-run and oak-upgrade becomes tricky.

One option is to expose all such config options as command line
options but then that would require duplicate work for handling
configuration.

Another way is to switch to proposed PojoSR based setup [2]. So one
would provide all the config in a single json file for example

oak-config.json
{
  "properties": {
    "oak.documentMK.revisionAge": 70000
  },
  "configs": {
    "org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreService": {
      "db": "test",
      "mongouri": "mongodb://localhost:27017"
    },
    "org.apache.jackrabbit.oak.security.user.UserConfigurationImpl": {
      "usersPath": "/home/users",
      "/home/users": "/home/groups"
    }
  }
}

And on command line we pass on that file as one of the arguments

java -jar oak-run-*.jar --config oak-config.json

Chetan Mehrotra
[1] 
https://github.com/apache/jackrabbit-oak/blob/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/blob/BlobStoreHelper.java#L52-52
[2] http://markmail.org/thread/26g2fqbda3uyahmm

Reply via email to