Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-4849

Refactor the MigrationCliArguments from implicit to explicit

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.4.12, 1.5.13, 1.6.0
    • Component/s: upgrade
    • Labels:
      None

      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

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                tomek.rekawek Tomek Rękawek
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: