Class SchemaExporter

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

public class SchemaExporter
extends Object
Simple class to export schemas from a kv-store to .schema XML files. Each file will be called namespace.tableName.schema.
  • Constructor Details

    • SchemaExporter

      public SchemaExporter​(@NotNull com.fishlib.io.logger.Logger log, @Nullable String directory, @Nullable String[] namespacesToExport, boolean overwrite, boolean listSchemas, @NotNull List<NamespaceSet> namespaceSets)
      Constructor for the schema exporter.
      Parameters:
      log - the logger to use for messages
      directory - the directory in which the files will be written (ignored if list is true)
      namespacesToExport - if supplied, the namespaces to process, otherwise all namespaces will be processed
      overwrite - if true, then overwrite existing schema files, otherwise skip writing a schema if the file already exists
      listSchemas - if true, list but don't export the schemas
      namespaceSets - the namespace sets to be processed
  • Method Details

    • export

      public void export​(@NotNull SchemaService schemaService) throws IOException
      Export or list the schemas to the XML files. If a file exists and the overwrite option is not specified, that file will be skipped.
      Parameters:
      schemaService - export from this schema service
      Throws:
      IOException - from the underlying file operations.
    • exportSchemas

      public static void exportSchemas​(@NotNull com.fishlib.io.logger.Logger log, @NotNull List<SchemaXml> schemasToExport, @Nullable File directory, boolean overwrite) throws IOException
      Throws:
      IOException
    • main

      public static void main​(String... commandLineArguments) throws IOException
      Throws:
      IOException