Class LegacySchemaImporter

java.lang.Object
com.illumon.iris.db.schema.LegacySchemaImporter

public class LegacySchemaImporter extends Object
One-time (?) bridge to import schema stored on disk into the schema service.
  • Constructor Details

    • LegacySchemaImporter

      public LegacySchemaImporter()
  • Method Details

    • doMigration

      public static void doMigration(@NotNull com.fishlib.io.logger.Logger log, @NotNull SchemaService schemaService, @NotNull org.apache.commons.cli.CommandLine commandLine)
    • gatherSchemaFiles

      public static Map<String,Map<String,SchemaXml>> gatherSchemaFiles(@NotNull com.fishlib.io.logger.Logger log, @NotNull com.fishlib.configuration.Configuration configuration, @NotNull List<String> errorMessages, @NotNull Collection<String> includeNamespaces, @NotNull Collection<String> excludeNamespaces, boolean allowErrors, @Nullable String[] schemaFileNames, @Nullable SchemaService schemaService, @Nullable String directory, @Nullable List<NamespaceSet> namespaceSets, boolean migrateOption, boolean verbose, boolean lenientValidation, boolean compileListeners)
      Search the (legacy) schema resource locations for schema files. If locations are specified, only those locations will be used. Otherwise, migration mode must be enabled and the legacy locations are searched for schema files.
      Parameters:
      log - for logging warnings
      configuration - the configuration to use
      errorMessages - any errors found while parsing schema files
      includeNamespaces - if non-empty, only these namespaces will be processed and all will be included (even if empty)
      excludeNamespaces - namespaces in this list will not be processed
      allowErrors - if false, any error parsing a schema file will be fatal. If true, valid schemas will be processed even if some schemas have errors
      schemaFileNames - an optional array of schema file names to be imported (this takes priority over legacy schema resolution)
      schemaService - an optional schema service that can be used to see if copy table sources already exist
      directory - an optional directory in which to find schema files (this takes priority over schemaFileNames and legacy resource resolution)
      namespaceSets - if specified, the namespace sets to add
      migrateOption - if true, schemas will be gathered from legacy resource locations if no directory or files are specified
      verbose - if true, log full exception text
      lenientValidation - if true, ClassNotFoundExceptions will be ignored when validating
      compileListeners - if true, try to compile listeners
      Returns:
      a map of namespace to table to schema
    • main

      public static void main(String... commandLineArguments)