Description
The MigrationCliArguments class creates a deep structure of helper classes in its constructor. As a result simply creating the MigrationCliArguments leads to repository creation (sic!), as one of the nested classes needs to do this in order to check if the repository uses embedded nodestore.
All of this automatic object creations should be replaced with explicit actions, like:
OptionSet parsed = OptionParserFactory.create().parse(args); MigrationCliArguments cliArgs = new MigrationCliArguments(parsed); MigrationOptions options = new MigrationOptions(cliArguments); options.logOptions(); // optionally log the diagnostic info StoreArguments stores = new StoreArguments(options, cliArgs.getArguments()); stores.logOptions(); // optionally log the diagnostic info // following method initializes (and closes) a repository in order to find out whether // an embedded store is being used boolean isSrcEmbedded = stores.srcUsesEmbeddedDatastore(); DatastoreArguments datastores = new DatastoreArguments(options, stores, isSrcEmbedded);
Attachments
Issue Links
- Is contained by
-
OAK-5290 Backport the performance improvements for oak-upgrade from trunk
- Closed