Package com.illumon.iris.db.schema
Class SchemaExporter
java.lang.Object
com.illumon.iris.db.schema.SchemaExporter
Simple class to export schemas from a kv-store to .schema XML files. Each file will be called namespace.tableName.schema.
-
Constructor Summary
ConstructorsConstructorDescriptionSchemaExporter
(com.fishlib.io.logger.Logger log, String directory, String[] namespacesToExport, boolean overwrite, boolean listSchemas, List<NamespaceSet> namespaceSets) Constructor for the schema exporter. -
Method Summary
Modifier and TypeMethodDescriptionvoid
export
(SchemaService schemaService) Export or list the schemas to the XML files.static void
exportSchemas
(com.fishlib.io.logger.Logger log, List<SchemaXml> schemasToExport, File directory, boolean overwrite) static void
-
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 messagesdirectory
- 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 processedoverwrite
- if true, then overwrite existing schema files, otherwise skip writing a schema if the file already existslistSchemas
- if true, list but don't export the schemasnamespaceSets
- the namespace sets to be processed
-
-
Method Details
-
export
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
- Throws:
IOException
-