-
Notifications
You must be signed in to change notification settings - Fork 274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial upgrade process support #4954
Conversation
...provider/src/main/java/io/apicurio/registry/types/provider/AvroArtifactTypeUtilProvider.java
Show resolved
Hide resolved
app/src/main/java/io/apicurio/registry/storage/importing/v2/SqlDataUpgrader.java
Show resolved
Hide resolved
app/src/main/java/io/apicurio/registry/storage/importing/v2/SqlDataUpgrader.java
Outdated
Show resolved
Hide resolved
app/src/main/java/io/apicurio/registry/storage/importing/v2/SqlDataUpgrader.java
Outdated
Show resolved
Hide resolved
app/src/main/java/io/apicurio/registry/storage/importing/v2/SqlDataUpgrader.java
Outdated
Show resolved
Hide resolved
app/src/main/java/io/apicurio/registry/storage/impl/kafkasql/KafkaSqlRegistryStorage.java
Outdated
Show resolved
Hide resolved
app/src/test/java/io/apicurio/registry/DataUpgradeTestProfile.java
Outdated
Show resolved
Hide resolved
app/src/main/java/io/apicurio/registry/upgrade/DataUpgrader.java
Outdated
Show resolved
Hide resolved
app/src/main/java/io/apicurio/registry/upgrade/DataUpgrader.java
Outdated
Show resolved
Hide resolved
final URL registryV2ExportUrl = regisrtryV2ExportFile.get(); | ||
try (final InputStream registryV2ExportZip = new BufferedInputStream( | ||
registryV2ExportUrl.openStream())) { | ||
log.info("Importing {} on startup.", registryV2ExportUrl); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible to detect that the ZIP file really is a v2 export? Perhaps by examining the manifest info?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can detect it here, but even if I don't it will fail down the path if it's not since all the entities will be parsed to v2 versions, so if it's not a V2 export zip it will fail to import the data. That said, it's probably better to fail fast here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that's what I was thinking: fail fast. Of course that assumes the manifest file is the first entry. Which it is if the ZIP was created by Registry.
app/src/main/java/io/apicurio/registry/storage/importing/v2/SqlDataUpgrader.java
Outdated
Show resolved
Hide resolved
app/src/main/java/io/apicurio/registry/storage/importing/v2/SqlDataUpgrader.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good! Just a couple minor comments.
65c86c7
to
61d3090
Compare
app/src/main/java/io/apicurio/registry/storage/importing/v2/SqlDataUpgrader.java
Outdated
Show resolved
Hide resolved
ecb93e5
to
7f1d67a
Compare
f782dbc
to
ce59d31
Compare
ce59d31
to
aae7b85
Compare
This introduces the initial support for migrating from Registry V2 to V3. The current implementation is intended to work as follows:
apicurio.upgrade.file.location
the user can specify the location of a V2 export file that will be processed and imported into the server.